Merge branch 'linux-3.10.61' into dev-kernel-3.10
Ishan Mittal [Mon, 1 Dec 2014 10:02:52 +0000 (15:02 +0530)]
Bug 200060080

Change-Id: I585caad7dbaaff7c1bdb56bef772a0d867bd1ce7
Signed-off-by: Ishan Mittal <imittal@nvidia.com>

33 files changed:
1  2 
Makefile
arch/arm/kernel/kprobes.c
arch/arm/mm/Kconfig
arch/arm64/mm/fault.c
drivers/base/core.c
drivers/net/Kconfig
drivers/net/usb/ax88179_178a.c
drivers/of/base.c
drivers/tty/serial/serial_core.c
drivers/usb/class/cdc-acm.c
drivers/usb/gadget/f_acm.c
drivers/usb/gadget/udc-core.c
fs/buffer.c
fs/ext4/ext4.h
fs/ext4/ioctl.c
fs/ext4/super.c
fs/nfs/inode.c
fs/nfs/nfs4proc.c
fs/pstore/inode.c
include/linux/clocksource.h
include/linux/compiler.h
include/linux/mm.h
include/linux/of.h
include/linux/sched.h
kernel/freezer.c
kernel/module.c
kernel/power/process.c
mm/filemap.c
mm/memory.c
mm/page_alloc.c
net/ipv4/ip_output.c
net/netlink/af_netlink.c
security/selinux/hooks.c

diff --cc Makefile
Simple merge
Simple merge
Simple merge
@@@ -320,15 -289,15 +320,22 @@@ retry
         */
        if (likely(!(fault & (VM_FAULT_ERROR | VM_FAULT_BADMAP |
                              VM_FAULT_BADACCESS))))
 -              return 0;
 +              goto return0;
 +
 +      /*
 +       * If we are in kernel mode at this point, we have no context to
 +       * handle this fault with.
 +       */
 +      if (!user_mode(regs))
 +              goto no_context;
  
+       /*
+        * If we are in kernel mode at this point, we have no context to
+        * handle this fault with.
+        */
+       if (!user_mode(regs))
+               goto no_context;
        if (fault & VM_FAULT_OOM) {
                /*
                 * We ran out of memory, call the OOM killer, and return to
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/buffer.c
Simple merge
diff --cc fs/ext4/ext4.h
Simple merge
diff --cc fs/ext4/ioctl.c
Simple merge
diff --cc fs/ext4/super.c
Simple merge
diff --cc fs/nfs/inode.c
Simple merge
Simple merge
@@@ -385,14 -316,11 +385,14 @@@ int pstore_mkfile(enum pstore_type_id t
                sprintf(name, "dmesg-%s-%lld", psname, id);
                break;
        case PSTORE_TYPE_CONSOLE:
-               sprintf(name, "console-%s", psname);
+               sprintf(name, "console-%s-%lld", psname, id);
                break;
        case PSTORE_TYPE_FTRACE:
-               sprintf(name, "ftrace-%s", psname);
+               sprintf(name, "ftrace-%s-%lld", psname, id);
                break;
 +      case PSTORE_TYPE_RTRACE:
 +              sprintf(name, "rtrace-%s", psname);
 +              break;
        case PSTORE_TYPE_MCE:
                sprintf(name, "mce-%s-%lld", psname, id);
                break;
@@@ -285,11 -285,9 +285,11 @@@ extern struct clocksource* clocksource_
  extern void clocksource_change_rating(struct clocksource *cs, int rating);
  extern void clocksource_suspend(void);
  extern void clocksource_resume(void);
- extern struct clocksource * __init __weak clocksource_default_clock(void);
+ extern struct clocksource * __init clocksource_default_clock(void);
  extern void clocksource_mark_unstable(struct clocksource *cs);
  
 +extern u64
 +clocks_calc_max_nsecs(u32 mult, u32 shift, u32 maxadj, u64 mask);
  extern void
  clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
  
Simple merge
Simple merge
Simple merge
@@@ -1429,11 -1412,10 +1429,10 @@@ struct task_struct 
        } memcg_batch;
        unsigned int memcg_kmem_skip_account;
        struct memcg_oom_info {
 +              unsigned int may_oom:1;
-               unsigned int in_memcg_oom:1;
-               unsigned int oom_locked:1;
-               int wakeups;
-               struct mem_cgroup *wait_on_memcg;
+               struct mem_cgroup *memcg;
+               gfp_t gfp_mask;
+               int order;
 -              unsigned int may_oom:1;
        } memcg_oom;
  #endif
  #ifdef CONFIG_HAVE_HW_BREAKPOINT
@@@ -39,9 -39,12 +39,12 @@@ static DEFINE_SPINLOCK(freezer_lock)
   */
  bool freezing_slow_path(struct task_struct *p)
  {
 -      if (p->flags & PF_NOFREEZE)
 +      if (p->flags & (PF_NOFREEZE | PF_SUSPEND_TASK))
                return false;
  
+       if (test_thread_flag(TIF_MEMDIE))
+               return false;
        if (pm_nosig_freezing || cgroup_freezing(p))
                return true;
  
diff --cc kernel/module.c
Simple merge
@@@ -108,10 -103,30 +108,32 @@@ static int try_to_freeze_tasks(bool use
        return todo ? -EBUSY : 0;
  }
  
+ /*
+  * Returns true if all freezable tasks (except for current) are frozen already
+  */
+ static bool check_frozen_processes(void)
+ {
+       struct task_struct *g, *p;
+       bool ret = true;
+       read_lock(&tasklist_lock);
+       for_each_process_thread(g, p) {
+               if (p != current && !freezer_should_skip(p) &&
+                   !frozen(p)) {
+                       ret = false;
+                       goto done;
+               }
+       }
+ done:
+       read_unlock(&tasklist_lock);
+       return ret;
+ }
  /**
   * freeze_processes - Signal user space processes to enter the refrigerator.
 + * The current thread will not be frozen.  The same process that calls
 + * freeze_processes must later call thaw_processes.
   *
   * On success, returns 0.  On failure, -errno and system is fully thawed.
   */
diff --cc mm/filemap.c
@@@ -1650,14 -1630,10 +1650,14 @@@ int filemap_fault(struct vm_area_struc
                 * We found the page, so try async readahead before
                 * waiting for the lock.
                 */
-               memcg_oom = mem_cgroup_toggle_oom(false);
++              mem_cgroup_oom_disable();
                do_async_mmap_readahead(vma, ra, file, page, offset);
-               mem_cgroup_toggle_oom(memcg_oom);
++              mem_cgroup_oom_enable();
        } else if (!page) {
                /* No page in the page cache at all */
-               memcg_oom = mem_cgroup_toggle_oom(false);
++              mem_cgroup_oom_disable();
                do_sync_mmap_readahead(vma, ra, file, offset);
-               mem_cgroup_toggle_oom(memcg_oom);
++              mem_cgroup_oom_enable();
                count_vm_event(PGMAJFAULT);
                mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT);
                ret = VM_FAULT_MAJOR;
diff --cc mm/memory.c
Simple merge
diff --cc mm/page_alloc.c
Simple merge
Simple merge
Simple merge
Simple merge