All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20160624150637.GD20203@dhcp22.suse.cz>

diff --git a/a/1.txt b/N1/1.txt
index 63702b2..c6cc422 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -31,7 +31,7 @@ on current rather than the given task. I will separate them into their
 own patches (was just too lazy for it now). If the approach looks
 reasonable then I will repost next week.
 ---
->From 1baaa1f8f9568f95d8feccb28cf1994f8ca0df9f Mon Sep 17 00:00:00 2001
+From 1baaa1f8f9568f95d8feccb28cf1994f8ca0df9f Mon Sep 17 00:00:00 2001
 From: Michal Hocko <mhocko@suse.com>
 Date: Fri, 24 Jun 2016 16:46:18 +0200
 Subject: [PATCH] mm, oom: move TIF_MEMDIE to the task_struct
diff --git a/a/content_digest b/N1/content_digest
index 484d839..4a4e31a 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -96,7 +96,7 @@
   "own patches (was just too lazy for it now). If the approach looks\n",
   "reasonable then I will repost next week.\n",
   "---\n",
-  ">From 1baaa1f8f9568f95d8feccb28cf1994f8ca0df9f Mon Sep 17 00:00:00 2001\n",
+  "From 1baaa1f8f9568f95d8feccb28cf1994f8ca0df9f Mon Sep 17 00:00:00 2001\n",
   "From: Michal Hocko <mhocko\@suse.com>\n",
   "Date: Fri, 24 Jun 2016 16:46:18 +0200\n",
   "Subject: [PATCH] mm, oom: move TIF_MEMDIE to the task_struct\n",
@@ -846,4 +846,4 @@
   "SUSE Labs"
 ]
 
-39abdaed444f4e9c9f5d49c7b0b2c43ef3e9cc265e668540ee44d2f98515cab9
+762d1aca76e4fb9ffd00a969185acf5e88e7b3b92e97ba377f9089cf1d10e273

diff --git a/a/1.txt b/N2/1.txt
index 63702b2..98d1eed 100644
--- a/a/1.txt
+++ b/N2/1.txt
@@ -30,752 +30,4 @@ Here is the patch. I've found two bugs when the TIF_MEMDIE was checked
 on current rather than the given task. I will separate them into their
 own patches (was just too lazy for it now). If the approach looks
 reasonable then I will repost next week.
----
->From 1baaa1f8f9568f95d8feccb28cf1994f8ca0df9f Mon Sep 17 00:00:00 2001
-From: Michal Hocko <mhocko@suse.com>
-Date: Fri, 24 Jun 2016 16:46:18 +0200
-Subject: [PATCH] mm, oom: move TIF_MEMDIE to the task_struct
-
-There is an interest to drop thread_info->flags usage for further clean
-ups. TIF_MEMDIE stands in the way so let's move it out of the
-thread_info into the task_struct. We cannot use flags because the oom
-killer will set it for !current task without any locking so let's add
-task_struct::memdie. It has to be atomic because we need it to be
-updated atomically.
-
-Signed-off-by: Michal Hocko <mhocko@suse.com>
----
- arch/alpha/include/asm/thread_info.h      |  1 -
- arch/arc/include/asm/thread_info.h        |  2 --
- arch/arm/include/asm/thread_info.h        |  1 -
- arch/arm64/include/asm/thread_info.h      |  1 -
- arch/avr32/include/asm/thread_info.h      |  2 --
- arch/blackfin/include/asm/thread_info.h   |  1 -
- arch/c6x/include/asm/thread_info.h        |  1 -
- arch/cris/include/asm/thread_info.h       |  1 -
- arch/frv/include/asm/thread_info.h        |  1 -
- arch/h8300/include/asm/thread_info.h      |  1 -
- arch/hexagon/include/asm/thread_info.h    |  1 -
- arch/ia64/include/asm/thread_info.h       |  1 -
- arch/m32r/include/asm/thread_info.h       |  1 -
- arch/m68k/include/asm/thread_info.h       |  1 -
- arch/metag/include/asm/thread_info.h      |  1 -
- arch/microblaze/include/asm/thread_info.h |  1 -
- arch/mips/include/asm/thread_info.h       |  1 -
- arch/mn10300/include/asm/thread_info.h    |  1 -
- arch/nios2/include/asm/thread_info.h      |  1 -
- arch/openrisc/include/asm/thread_info.h   |  1 -
- arch/parisc/include/asm/thread_info.h     |  1 -
- arch/powerpc/include/asm/thread_info.h    |  1 -
- arch/s390/include/asm/thread_info.h       |  1 -
- arch/score/include/asm/thread_info.h      |  1 -
- arch/sh/include/asm/thread_info.h         |  1 -
- arch/sparc/include/asm/thread_info_32.h   |  1 -
- arch/sparc/include/asm/thread_info_64.h   |  1 -
- arch/tile/include/asm/thread_info.h       |  2 --
- arch/um/include/asm/thread_info.h         |  2 --
- arch/unicore32/include/asm/thread_info.h  |  1 -
- arch/x86/include/asm/thread_info.h        |  1 -
- arch/xtensa/include/asm/thread_info.h     |  1 -
- drivers/staging/android/lowmemorykiller.c |  2 +-
- fs/ext4/mballoc.c                         |  2 +-
- include/linux/sched.h                     |  2 ++
- kernel/cpuset.c                           | 12 ++++++------
- kernel/exit.c                             |  2 +-
- kernel/freezer.c                          |  2 +-
- mm/ksm.c                                  |  4 ++--
- mm/memcontrol.c                           |  2 +-
- mm/oom_kill.c                             | 20 ++++++++++----------
- mm/page_alloc.c                           |  6 +++---
- 42 files changed, 28 insertions(+), 62 deletions(-)
-
-diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
-index 32e920a83ae5..126eaaf6559d 100644
---- a/arch/alpha/include/asm/thread_info.h
-+++ b/arch/alpha/include/asm/thread_info.h
-@@ -65,7 +65,6 @@ register struct thread_info *__current_thread_info __asm__("$8");
- #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
- #define TIF_SYSCALL_AUDIT	4	/* syscall audit active */
- #define TIF_DIE_IF_KERNEL	9	/* dik recursion lock */
--#define TIF_MEMDIE		13	/* is terminating due to OOM killer */
- #define TIF_POLLING_NRFLAG	14	/* idle is polling for TIF_NEED_RESCHED */
- 
- #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
-diff --git a/arch/arc/include/asm/thread_info.h b/arch/arc/include/asm/thread_info.h
-index 3af67455659a..46d1fc1a073d 100644
---- a/arch/arc/include/asm/thread_info.h
-+++ b/arch/arc/include/asm/thread_info.h
-@@ -88,14 +88,12 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)
- #define TIF_SYSCALL_TRACE	15	/* syscall trace active */
- 
- /* true if poll_idle() is polling TIF_NEED_RESCHED */
--#define TIF_MEMDIE		16
- 
- #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
- #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME)
- #define _TIF_SIGPENDING		(1<<TIF_SIGPENDING)
- #define _TIF_NEED_RESCHED	(1<<TIF_NEED_RESCHED)
- #define _TIF_SYSCALL_AUDIT	(1<<TIF_SYSCALL_AUDIT)
--#define _TIF_MEMDIE		(1<<TIF_MEMDIE)
- 
- /* work to do on interrupt/exception return */
- #define _TIF_WORK_MASK		(_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
-diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
-index 776757d1604a..6277e56f15fd 100644
---- a/arch/arm/include/asm/thread_info.h
-+++ b/arch/arm/include/asm/thread_info.h
-@@ -146,7 +146,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
- 
- #define TIF_NOHZ		12	/* in adaptive nohz mode */
- #define TIF_USING_IWMMXT	17
--#define TIF_MEMDIE		18	/* is terminating due to OOM killer */
- #define TIF_RESTORE_SIGMASK	20
- 
- #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
-diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
-index abd64bd1f6d9..d78b3b2945a9 100644
---- a/arch/arm64/include/asm/thread_info.h
-+++ b/arch/arm64/include/asm/thread_info.h
-@@ -114,7 +114,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_SYSCALL_AUDIT	9
- #define TIF_SYSCALL_TRACEPOINT	10
- #define TIF_SECCOMP		11
--#define TIF_MEMDIE		18	/* is terminating due to OOM killer */
- #define TIF_FREEZE		19
- #define TIF_RESTORE_SIGMASK	20
- #define TIF_SINGLESTEP		21
-diff --git a/arch/avr32/include/asm/thread_info.h b/arch/avr32/include/asm/thread_info.h
-index d4d3079541ea..680be13234ab 100644
---- a/arch/avr32/include/asm/thread_info.h
-+++ b/arch/avr32/include/asm/thread_info.h
-@@ -70,7 +70,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_NEED_RESCHED        2       /* rescheduling necessary */
- #define TIF_BREAKPOINT		4	/* enter monitor mode on return */
- #define TIF_SINGLE_STEP		5	/* single step in progress */
--#define TIF_MEMDIE		6	/* is terminating due to OOM killer */
- #define TIF_RESTORE_SIGMASK	7	/* restore signal mask in do_signal */
- #define TIF_CPU_GOING_TO_SLEEP	8	/* CPU is entering sleep 0 mode */
- #define TIF_NOTIFY_RESUME	9	/* callback before returning to user */
-@@ -82,7 +81,6 @@ static inline struct thread_info *current_thread_info(void)
- #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
- #define _TIF_BREAKPOINT		(1 << TIF_BREAKPOINT)
- #define _TIF_SINGLE_STEP	(1 << TIF_SINGLE_STEP)
--#define _TIF_MEMDIE		(1 << TIF_MEMDIE)
- #define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP)
- #define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
- 
-diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
-index 2966b93850a1..a45ff075ab6a 100644
---- a/arch/blackfin/include/asm/thread_info.h
-+++ b/arch/blackfin/include/asm/thread_info.h
-@@ -79,7 +79,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_SYSCALL_TRACE	0	/* syscall trace active */
- #define TIF_SIGPENDING		1	/* signal pending */
- #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
--#define TIF_MEMDIE		4	/* is terminating due to OOM killer */
- #define TIF_RESTORE_SIGMASK	5	/* restore signal mask in do_signal() */
- #define TIF_IRQ_SYNC		7	/* sync pipeline stage */
- #define TIF_NOTIFY_RESUME	8	/* callback before returning to user */
-diff --git a/arch/c6x/include/asm/thread_info.h b/arch/c6x/include/asm/thread_info.h
-index acc70c135ab8..22ff7b03641d 100644
---- a/arch/c6x/include/asm/thread_info.h
-+++ b/arch/c6x/include/asm/thread_info.h
-@@ -89,7 +89,6 @@ struct thread_info *current_thread_info(void)
- #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
- #define TIF_RESTORE_SIGMASK	4	/* restore signal mask in do_signal() */
- 
--#define TIF_MEMDIE		17	/* OOM killer killed process */
- 
- #define TIF_WORK_MASK		0x00007FFE /* work on irq/exception return */
- #define TIF_ALLWORK_MASK	0x00007FFF /* work on any return to u-space */
-diff --git a/arch/cris/include/asm/thread_info.h b/arch/cris/include/asm/thread_info.h
-index 4ead1b40d2d7..79ebddc22aa3 100644
---- a/arch/cris/include/asm/thread_info.h
-+++ b/arch/cris/include/asm/thread_info.h
-@@ -70,7 +70,6 @@ struct thread_info {
- #define TIF_SIGPENDING		2	/* signal pending */
- #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
- #define TIF_RESTORE_SIGMASK	9	/* restore signal mask in do_signal() */
--#define TIF_MEMDIE		17	/* is terminating due to OOM killer */
- 
- #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
- #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME)
-diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
-index ccba3b6ce918..993930f59d8e 100644
---- a/arch/frv/include/asm/thread_info.h
-+++ b/arch/frv/include/asm/thread_info.h
-@@ -86,7 +86,6 @@ register struct thread_info *__current_thread_info asm("gr15");
- #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
- #define TIF_SINGLESTEP		4	/* restore singlestep on return to user mode */
- #define TIF_RESTORE_SIGMASK	5	/* restore signal mask in do_signal() */
--#define TIF_MEMDIE		7	/* is terminating due to OOM killer */
- 
- #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
- #define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
-diff --git a/arch/h8300/include/asm/thread_info.h b/arch/h8300/include/asm/thread_info.h
-index b408fe660cf8..68c10bce921e 100644
---- a/arch/h8300/include/asm/thread_info.h
-+++ b/arch/h8300/include/asm/thread_info.h
-@@ -73,7 +73,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_SIGPENDING		1	/* signal pending */
- #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
- #define TIF_SINGLESTEP		3	/* singlestepping active */
--#define TIF_MEMDIE		4	/* is terminating due to OOM killer */
- #define TIF_RESTORE_SIGMASK	5	/* restore signal mask in do_signal() */
- #define TIF_NOTIFY_RESUME	6	/* callback before returning to user */
- #define TIF_SYSCALL_AUDIT	7	/* syscall auditing active */
-diff --git a/arch/hexagon/include/asm/thread_info.h b/arch/hexagon/include/asm/thread_info.h
-index b80fe1db7b64..e55c7d0a1755 100644
---- a/arch/hexagon/include/asm/thread_info.h
-+++ b/arch/hexagon/include/asm/thread_info.h
-@@ -112,7 +112,6 @@ register struct thread_info *__current_thread_info asm(QUOTED_THREADINFO_REG);
- #define TIF_SINGLESTEP          4       /* restore ss @ return to usr mode */
- #define TIF_RESTORE_SIGMASK     6       /* restore sig mask in do_signal() */
- /* true if poll_idle() is polling TIF_NEED_RESCHED */
--#define TIF_MEMDIE              17      /* OOM killer killed process */
- 
- #define _TIF_SYSCALL_TRACE      (1 << TIF_SYSCALL_TRACE)
- #define _TIF_NOTIFY_RESUME      (1 << TIF_NOTIFY_RESUME)
-diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
-index aa995b67c3f5..77064b1d188a 100644
---- a/arch/ia64/include/asm/thread_info.h
-+++ b/arch/ia64/include/asm/thread_info.h
-@@ -97,7 +97,6 @@ struct thread_info {
- #define TIF_SYSCALL_AUDIT	3	/* syscall auditing active */
- #define TIF_SINGLESTEP		4	/* restore singlestep on return to user mode */
- #define TIF_NOTIFY_RESUME	6	/* resumption notification requested */
--#define TIF_MEMDIE		17	/* is terminating due to OOM killer */
- #define TIF_MCA_INIT		18	/* this task is processing MCA or INIT */
- #define TIF_DB_DISABLED		19	/* debug trap disabled for fsyscall */
- #define TIF_RESTORE_RSE		21	/* user RBS is newer than kernel RBS */
-diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h
-index f630d9c30b28..bc54a574fad0 100644
---- a/arch/m32r/include/asm/thread_info.h
-+++ b/arch/m32r/include/asm/thread_info.h
-@@ -102,7 +102,6 @@ static inline unsigned int get_thread_fault_code(void)
- #define TIF_NOTIFY_RESUME	5	/* callback before returning to user */
- #define TIF_RESTORE_SIGMASK	8	/* restore signal mask in do_signal() */
- #define TIF_USEDFPU		16	/* FPU was used by this task this quantum (SMP) */
--#define TIF_MEMDIE		18	/* is terminating due to OOM killer */
- 
- #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
- #define _TIF_SIGPENDING		(1<<TIF_SIGPENDING)
-diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h
-index cee13c2e5161..ed497d31ea5d 100644
---- a/arch/m68k/include/asm/thread_info.h
-+++ b/arch/m68k/include/asm/thread_info.h
-@@ -68,7 +68,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_NEED_RESCHED	7	/* rescheduling necessary */
- #define TIF_DELAYED_TRACE	14	/* single step a syscall */
- #define TIF_SYSCALL_TRACE	15	/* syscall trace active */
--#define TIF_MEMDIE		16	/* is terminating due to OOM killer */
- #define TIF_RESTORE_SIGMASK	18	/* restore signal mask in do_signal */
- 
- #endif	/* _ASM_M68K_THREAD_INFO_H */
-diff --git a/arch/metag/include/asm/thread_info.h b/arch/metag/include/asm/thread_info.h
-index 32677cc278aa..c506e5a61714 100644
---- a/arch/metag/include/asm/thread_info.h
-+++ b/arch/metag/include/asm/thread_info.h
-@@ -111,7 +111,6 @@ static inline int kstack_end(void *addr)
- #define TIF_SECCOMP		5	/* secure computing */
- #define TIF_RESTORE_SIGMASK	6	/* restore signal mask in do_signal() */
- #define TIF_NOTIFY_RESUME	7	/* callback before returning to user */
--#define TIF_MEMDIE		8	/* is terminating due to OOM killer */
- #define TIF_SYSCALL_TRACEPOINT	9	/* syscall tracepoint instrumentation */
- 
- 
-diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
-index 383f387b4eee..281a365bec48 100644
---- a/arch/microblaze/include/asm/thread_info.h
-+++ b/arch/microblaze/include/asm/thread_info.h
-@@ -113,7 +113,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_NEED_RESCHED	3 /* rescheduling necessary */
- /* restore singlestep on return to user mode */
- #define TIF_SINGLESTEP		4
--#define TIF_MEMDIE		6	/* is terminating due to OOM killer */
- #define TIF_SYSCALL_AUDIT	9       /* syscall auditing active */
- #define TIF_SECCOMP		10      /* secure computing */
- 
-diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
-index e309d8fcb516..3dd906330867 100644
---- a/arch/mips/include/asm/thread_info.h
-+++ b/arch/mips/include/asm/thread_info.h
-@@ -102,7 +102,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_UPROBE		6	/* breakpointed or singlestepping */
- #define TIF_RESTORE_SIGMASK	9	/* restore signal mask in do_signal() */
- #define TIF_USEDFPU		16	/* FPU was used by this task this quantum (SMP) */
--#define TIF_MEMDIE		18	/* is terminating due to OOM killer */
- #define TIF_NOHZ		19	/* in adaptive nohz mode */
- #define TIF_FIXADE		20	/* Fix address errors in software */
- #define TIF_LOGADE		21	/* Log address errors to syslog */
-diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
-index 4861a78c7160..1dd24f251a98 100644
---- a/arch/mn10300/include/asm/thread_info.h
-+++ b/arch/mn10300/include/asm/thread_info.h
-@@ -145,7 +145,6 @@ void arch_release_thread_info(struct thread_info *ti);
- #define TIF_SINGLESTEP		4	/* restore singlestep on return to user mode */
- #define TIF_RESTORE_SIGMASK	5	/* restore signal mask in do_signal() */
- #define TIF_POLLING_NRFLAG	16	/* true if poll_idle() is polling TIF_NEED_RESCHED */
--#define TIF_MEMDIE		17	/* is terminating due to OOM killer */
- 
- #define _TIF_SYSCALL_TRACE	+(1 << TIF_SYSCALL_TRACE)
- #define _TIF_NOTIFY_RESUME	+(1 << TIF_NOTIFY_RESUME)
-diff --git a/arch/nios2/include/asm/thread_info.h b/arch/nios2/include/asm/thread_info.h
-index d69c338bd19c..bf7d38c1c6e2 100644
---- a/arch/nios2/include/asm/thread_info.h
-+++ b/arch/nios2/include/asm/thread_info.h
-@@ -86,7 +86,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_NOTIFY_RESUME	1	/* resumption notification requested */
- #define TIF_SIGPENDING		2	/* signal pending */
- #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
--#define TIF_MEMDIE		4	/* is terminating due to OOM killer */
- #define TIF_SECCOMP		5	/* secure computing */
- #define TIF_SYSCALL_AUDIT	6	/* syscall auditing active */
- #define TIF_RESTORE_SIGMASK	9	/* restore signal mask in do_signal() */
-diff --git a/arch/openrisc/include/asm/thread_info.h b/arch/openrisc/include/asm/thread_info.h
-index 6e619a79a401..7678a1b2dc64 100644
---- a/arch/openrisc/include/asm/thread_info.h
-+++ b/arch/openrisc/include/asm/thread_info.h
-@@ -108,7 +108,6 @@ register struct thread_info *current_thread_info_reg asm("r10");
- #define TIF_RESTORE_SIGMASK     9
- #define TIF_POLLING_NRFLAG	16	/* true if poll_idle() is polling						 * TIF_NEED_RESCHED
- 					 */
--#define TIF_MEMDIE              17
- 
- #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
- #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME)
-diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h
-index e96e693fd58c..bcebec0b9418 100644
---- a/arch/parisc/include/asm/thread_info.h
-+++ b/arch/parisc/include/asm/thread_info.h
-@@ -48,7 +48,6 @@ struct thread_info {
- #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
- #define TIF_POLLING_NRFLAG	3	/* true if poll_idle() is polling TIF_NEED_RESCHED */
- #define TIF_32BIT               4       /* 32 bit binary */
--#define TIF_MEMDIE		5	/* is terminating due to OOM killer */
- #define TIF_RESTORE_SIGMASK	6	/* restore saved signal mask */
- #define TIF_SYSCALL_AUDIT	7	/* syscall auditing active */
- #define TIF_NOTIFY_RESUME	8	/* callback before returning to user */
-diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
-index 7efee4a3240b..d744fa455dd2 100644
---- a/arch/powerpc/include/asm/thread_info.h
-+++ b/arch/powerpc/include/asm/thread_info.h
-@@ -97,7 +97,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_SYSCALL_TRACEPOINT	15	/* syscall tracepoint instrumentation */
- #define TIF_EMULATE_STACK_STORE	16	/* Is an instruction emulation
- 						for stack store? */
--#define TIF_MEMDIE		17	/* is terminating due to OOM killer */
- #if defined(CONFIG_PPC64)
- #define TIF_ELF2ABI		18	/* function descriptors must die! */
- #endif
-diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
-index 2fffc2c27581..8fc2704dd263 100644
---- a/arch/s390/include/asm/thread_info.h
-+++ b/arch/s390/include/asm/thread_info.h
-@@ -79,7 +79,6 @@ void arch_release_task_struct(struct task_struct *tsk);
- #define TIF_SYSCALL_TRACEPOINT	6	/* syscall tracepoint instrumentation */
- #define TIF_UPROBE		7	/* breakpointed or single-stepping */
- #define TIF_31BIT		16	/* 32bit process */
--#define TIF_MEMDIE		17	/* is terminating due to OOM killer */
- #define TIF_RESTORE_SIGMASK	18	/* restore signal mask in do_signal() */
- #define TIF_SINGLE_STEP		19	/* This task is single stepped */
- #define TIF_BLOCK_STEP		20	/* This task is block stepped */
-diff --git a/arch/score/include/asm/thread_info.h b/arch/score/include/asm/thread_info.h
-index 7d9ffb15c477..f6e1cc89cef9 100644
---- a/arch/score/include/asm/thread_info.h
-+++ b/arch/score/include/asm/thread_info.h
-@@ -78,7 +78,6 @@ register struct thread_info *__current_thread_info __asm__("r28");
- #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
- #define TIF_NOTIFY_RESUME	5	/* callback before returning to user */
- #define TIF_RESTORE_SIGMASK	9	/* restore signal mask in do_signal() */
--#define TIF_MEMDIE		18	/* is terminating due to OOM killer */
- 
- #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
- #define _TIF_SIGPENDING		(1<<TIF_SIGPENDING)
-diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
-index 2afa321157be..017f3993f384 100644
---- a/arch/sh/include/asm/thread_info.h
-+++ b/arch/sh/include/asm/thread_info.h
-@@ -117,7 +117,6 @@ extern void init_thread_xstate(void);
- #define TIF_NOTIFY_RESUME	7	/* callback before returning to user */
- #define TIF_SYSCALL_TRACEPOINT	8	/* for ftrace syscall instrumentation */
- #define TIF_POLLING_NRFLAG	17	/* true if poll_idle() is polling TIF_NEED_RESCHED */
--#define TIF_MEMDIE		18	/* is terminating due to OOM killer */
- 
- #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
- #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
-diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
-index 229475f0d7ce..bcf81999db0b 100644
---- a/arch/sparc/include/asm/thread_info_32.h
-+++ b/arch/sparc/include/asm/thread_info_32.h
-@@ -110,7 +110,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
- 					 * this quantum (SMP) */
- #define TIF_POLLING_NRFLAG	9	/* true if poll_idle() is polling
- 					 * TIF_NEED_RESCHED */
--#define TIF_MEMDIE		10	/* is terminating due to OOM killer */
- 
- /* as above, but as bit values */
- #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
-diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
-index bde59825d06c..63b3285b7d46 100644
---- a/arch/sparc/include/asm/thread_info_64.h
-+++ b/arch/sparc/include/asm/thread_info_64.h
-@@ -191,7 +191,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
-  *       an immediate value in instructions such as andcc.
-  */
- /* flag bit 12 is available */
--#define TIF_MEMDIE		13	/* is terminating due to OOM killer */
- #define TIF_POLLING_NRFLAG	14
- 
- #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
-diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h
-index 4b7cef9e94e0..734d53f4b435 100644
---- a/arch/tile/include/asm/thread_info.h
-+++ b/arch/tile/include/asm/thread_info.h
-@@ -121,7 +121,6 @@ extern void _cpu_idle(void);
- #define TIF_SYSCALL_TRACE	4	/* syscall trace active */
- #define TIF_SYSCALL_AUDIT	5	/* syscall auditing active */
- #define TIF_SECCOMP		6	/* secure computing */
--#define TIF_MEMDIE		7	/* OOM killer at work */
- #define TIF_NOTIFY_RESUME	8	/* callback before returning to user */
- #define TIF_SYSCALL_TRACEPOINT	9	/* syscall tracepoint instrumentation */
- #define TIF_POLLING_NRFLAG	10	/* idle is polling for TIF_NEED_RESCHED */
-@@ -134,7 +133,6 @@ extern void _cpu_idle(void);
- #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
- #define _TIF_SYSCALL_AUDIT	(1<<TIF_SYSCALL_AUDIT)
- #define _TIF_SECCOMP		(1<<TIF_SECCOMP)
--#define _TIF_MEMDIE		(1<<TIF_MEMDIE)
- #define _TIF_NOTIFY_RESUME	(1<<TIF_NOTIFY_RESUME)
- #define _TIF_SYSCALL_TRACEPOINT	(1<<TIF_SYSCALL_TRACEPOINT)
- #define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)
-diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
-index 053baff03674..b13047eeaede 100644
---- a/arch/um/include/asm/thread_info.h
-+++ b/arch/um/include/asm/thread_info.h
-@@ -58,7 +58,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_SIGPENDING		1	/* signal pending */
- #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
- #define TIF_RESTART_BLOCK	4
--#define TIF_MEMDIE		5	/* is terminating due to OOM killer */
- #define TIF_SYSCALL_AUDIT	6
- #define TIF_RESTORE_SIGMASK	7
- #define TIF_NOTIFY_RESUME	8
-@@ -67,7 +66,6 @@ static inline struct thread_info *current_thread_info(void)
- #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
- #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
- #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
--#define _TIF_MEMDIE		(1 << TIF_MEMDIE)
- #define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
- #define _TIF_SECCOMP		(1 << TIF_SECCOMP)
- 
-diff --git a/arch/unicore32/include/asm/thread_info.h b/arch/unicore32/include/asm/thread_info.h
-index e79ad6d5b5b2..2487cf9dd41e 100644
---- a/arch/unicore32/include/asm/thread_info.h
-+++ b/arch/unicore32/include/asm/thread_info.h
-@@ -121,7 +121,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_NEED_RESCHED	1
- #define TIF_NOTIFY_RESUME	2	/* callback before returning to user */
- #define TIF_SYSCALL_TRACE	8
--#define TIF_MEMDIE		18
- #define TIF_RESTORE_SIGMASK	20
- 
- #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
-diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
-index ffae84df8a93..79a4b75e814c 100644
---- a/arch/x86/include/asm/thread_info.h
-+++ b/arch/x86/include/asm/thread_info.h
-@@ -101,7 +101,6 @@ struct thread_info {
- #define TIF_IA32		17	/* IA32 compatibility process */
- #define TIF_FORK		18	/* ret_from_fork */
- #define TIF_NOHZ		19	/* in adaptive nohz mode */
--#define TIF_MEMDIE		20	/* is terminating due to OOM killer */
- #define TIF_POLLING_NRFLAG	21	/* idle is polling for TIF_NEED_RESCHED */
- #define TIF_IO_BITMAP		22	/* uses I/O bitmap */
- #define TIF_FORCED_TF		24	/* true if TF in eflags artificially */
-diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h
-index 7be2400f745a..791a0a0b5827 100644
---- a/arch/xtensa/include/asm/thread_info.h
-+++ b/arch/xtensa/include/asm/thread_info.h
-@@ -108,7 +108,6 @@ static inline struct thread_info *current_thread_info(void)
- #define TIF_SIGPENDING		1	/* signal pending */
- #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
- #define TIF_SINGLESTEP		3	/* restore singlestep on return to user mode */
--#define TIF_MEMDIE		5	/* is terminating due to OOM killer */
- #define TIF_RESTORE_SIGMASK	6	/* restore signal mask in do_signal() */
- #define TIF_NOTIFY_RESUME	7	/* callback before returning to user */
- #define TIF_DB_DISABLED		8	/* debug trap disabled for syscall */
-diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
-index 2509e5df7244..55d02f2376ab 100644
---- a/drivers/staging/android/lowmemorykiller.c
-+++ b/drivers/staging/android/lowmemorykiller.c
-@@ -131,7 +131,7 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
- 		if (!p)
- 			continue;
- 
--		if (test_tsk_thread_flag(p, TIF_MEMDIE) &&
-+		if (atomic_read(&p->memdie) &&
- 		    time_before_eq(jiffies, lowmem_deathpending_timeout)) {
- 			task_unlock(p);
- 			rcu_read_unlock();
-diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
-index c1ab3ec30423..ddc12f571c50 100644
---- a/fs/ext4/mballoc.c
-+++ b/fs/ext4/mballoc.c
-@@ -4815,7 +4815,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
- #endif
- 	trace_ext4_mballoc_free(sb, inode, block_group, bit, count_clusters);
- 
--	/* __GFP_NOFAIL: retry infinitely, ignore TIF_MEMDIE and memcg limit. */
-+	/* __GFP_NOFAIL: retry infinitely, ignore memdie tasks and memcg limit. */
- 	err = ext4_mb_load_buddy_gfp(sb, block_group, &e4b,
- 				     GFP_NOFS|__GFP_NOFAIL);
- 	if (err)
-diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 6d81a1eb974a..4c91fc0c2e8e 100644
---- a/include/linux/sched.h
-+++ b/include/linux/sched.h
-@@ -1856,6 +1856,8 @@ struct task_struct {
- 	unsigned long	task_state_change;
- #endif
- 	int pagefault_disabled;
-+	/* oom victim - give it access to memory reserves */
-+	atomic_t	memdie;
- #ifdef CONFIG_MMU
- 	struct task_struct *oom_reaper_list;
- #endif
-diff --git a/kernel/cpuset.c b/kernel/cpuset.c
-index 73e93e53884d..857fac0b973d 100644
---- a/kernel/cpuset.c
-+++ b/kernel/cpuset.c
-@@ -1038,9 +1038,9 @@ static void cpuset_change_task_nodemask(struct task_struct *tsk,
- 	 * Allow tasks that have access to memory reserves because they have
- 	 * been OOM killed to get memory anywhere.
- 	 */
--	if (unlikely(test_thread_flag(TIF_MEMDIE)))
-+	if (unlikely(atomic_read(&tsk->memdie)))
- 		return;
--	if (current->flags & PF_EXITING) /* Let dying task have memory */
-+	if (tsk->flags & PF_EXITING) /* Let dying task have memory */
- 		return;
- 
- 	task_lock(tsk);
-@@ -2496,12 +2496,12 @@ static struct cpuset *nearest_hardwall_ancestor(struct cpuset *cs)
-  * If we're in interrupt, yes, we can always allocate.  If @node is set in
-  * current's mems_allowed, yes.  If it's not a __GFP_HARDWALL request and this
-  * node is set in the nearest hardwalled cpuset ancestor to current's cpuset,
-- * yes.  If current has access to memory reserves due to TIF_MEMDIE, yes.
-+ * yes.  If current has access to memory reserves due to memdie, yes.
-  * Otherwise, no.
-  *
-  * GFP_USER allocations are marked with the __GFP_HARDWALL bit,
-  * and do not allow allocations outside the current tasks cpuset
-- * unless the task has been OOM killed as is marked TIF_MEMDIE.
-+ * unless the task has been OOM killed as is marked memdie.
-  * GFP_KERNEL allocations are not so marked, so can escape to the
-  * nearest enclosing hardwalled ancestor cpuset.
-  *
-@@ -2524,7 +2524,7 @@ static struct cpuset *nearest_hardwall_ancestor(struct cpuset *cs)
-  * affect that:
-  *	in_interrupt - any node ok (current task context irrelevant)
-  *	GFP_ATOMIC   - any node ok
-- *	TIF_MEMDIE   - any node ok
-+ *	memdie       - any node ok
-  *	GFP_KERNEL   - any node in enclosing hardwalled cpuset ok
-  *	GFP_USER     - only nodes in current tasks mems allowed ok.
-  */
-@@ -2542,7 +2542,7 @@ bool __cpuset_node_allowed(int node, gfp_t gfp_mask)
- 	 * Allow tasks that have access to memory reserves because they have
- 	 * been OOM killed to get memory anywhere.
- 	 */
--	if (unlikely(test_thread_flag(TIF_MEMDIE)))
-+	if (unlikely(atomic_read(&current->memdie)))
- 		return true;
- 	if (gfp_mask & __GFP_HARDWALL)	/* If hardwall request, stop here */
- 		return false;
-diff --git a/kernel/exit.c b/kernel/exit.c
-index 9e6e1356e6bb..8bfdda9bc99a 100644
---- a/kernel/exit.c
-+++ b/kernel/exit.c
-@@ -434,7 +434,7 @@ static void exit_mm(struct task_struct *tsk)
- 	task_unlock(tsk);
- 	mm_update_next_owner(mm);
- 	mmput(mm);
--	if (test_thread_flag(TIF_MEMDIE))
-+	if (atomic_read(&current->memdie))
- 		exit_oom_victim(tsk);
- }
- 
-diff --git a/kernel/freezer.c b/kernel/freezer.c
-index a8900a3bc27a..e1bd9f2780fe 100644
---- a/kernel/freezer.c
-+++ b/kernel/freezer.c
-@@ -42,7 +42,7 @@ bool freezing_slow_path(struct task_struct *p)
- 	if (p->flags & (PF_NOFREEZE | PF_SUSPEND_TASK))
- 		return false;
- 
--	if (test_thread_flag(TIF_MEMDIE))
-+	if (atomic_read(&p->memdie))
- 		return false;
- 
- 	if (pm_nosig_freezing || cgroup_freezing(p))
-diff --git a/mm/ksm.c b/mm/ksm.c
-index 73d43bafd9fb..8d5a295fb955 100644
---- a/mm/ksm.c
-+++ b/mm/ksm.c
-@@ -396,11 +396,11 @@ static int break_ksm(struct vm_area_struct *vma, unsigned long addr)
- 	 *
- 	 * VM_FAULT_OOM: at the time of writing (late July 2009), setting
- 	 * aside mem_cgroup limits, VM_FAULT_OOM would only be set if the
--	 * current task has TIF_MEMDIE set, and will be OOM killed on return
-+	 * current task has memdie set, and will be OOM killed on return
- 	 * to user; and ksmd, having no mm, would never be chosen for that.
- 	 *
- 	 * But if the mm is in a limited mem_cgroup, then the fault may fail
--	 * with VM_FAULT_OOM even if the current task is not TIF_MEMDIE; and
-+	 * with VM_FAULT_OOM even if the current task is not memdie; and
- 	 * even ksmd can fail in this way - though it's usually breaking ksm
- 	 * just to undo a merge it made a moment before, so unlikely to oom.
- 	 *
-diff --git a/mm/memcontrol.c b/mm/memcontrol.c
-index 3e8f9e5e9291..df411de17a75 100644
---- a/mm/memcontrol.c
-+++ b/mm/memcontrol.c
-@@ -1987,7 +1987,7 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,
- 	 * bypass the last charges so that they can exit quickly and
- 	 * free their memory.
- 	 */
--	if (unlikely(test_thread_flag(TIF_MEMDIE) ||
-+	if (unlikely(atomic_read(&current->memdie) ||
- 		     fatal_signal_pending(current) ||
- 		     current->flags & PF_EXITING))
- 		goto force;
-diff --git a/mm/oom_kill.c b/mm/oom_kill.c
-index 4c21f744daa6..9d24007cdb82 100644
---- a/mm/oom_kill.c
-+++ b/mm/oom_kill.c
-@@ -473,7 +473,7 @@ static bool __oom_reap_task(struct task_struct *tsk)
- 	 *				[...]
- 	 *				out_of_memory
- 	 *				  select_bad_process
--	 *				    # no TIF_MEMDIE task selects new victim
-+	 *				    # no memdie task selects new victim
- 	 *  unmap_page_range # frees some memory
- 	 */
- 	mutex_lock(&oom_lock);
-@@ -593,7 +593,7 @@ static void oom_reap_task(struct task_struct *tsk)
- 	}
- 
- 	/*
--	 * Clear TIF_MEMDIE because the task shouldn't be sitting on a
-+	 * Clear memdie because the task shouldn't be sitting on a
- 	 * reasonably reclaimable memory anymore or it is not a good candidate
- 	 * for the oom victim right now because it cannot release its memory
- 	 * itself nor by the oom reaper.
-@@ -669,14 +669,14 @@ void mark_oom_victim(struct task_struct *tsk)
- {
- 	WARN_ON(oom_killer_disabled);
- 	/* OOM killer might race with memcg OOM */
--	if (test_and_set_tsk_thread_flag(tsk, TIF_MEMDIE))
-+	if (!atomic_add_unless(&tsk->memdie, 1, 1))
- 		return;
- 	atomic_inc(&tsk->signal->oom_victims);
- 	/*
- 	 * Make sure that the task is woken up from uninterruptible sleep
- 	 * if it is frozen because OOM killer wouldn't be able to free
- 	 * any memory and livelock. freezing_slow_path will tell the freezer
--	 * that TIF_MEMDIE tasks should be ignored.
-+	 * that memdie tasks should be ignored.
- 	 */
- 	__thaw_task(tsk);
- 	atomic_inc(&oom_victims);
-@@ -687,7 +687,7 @@ void mark_oom_victim(struct task_struct *tsk)
-  */
- void exit_oom_victim(struct task_struct *tsk)
- {
--	if (!test_and_clear_tsk_thread_flag(tsk, TIF_MEMDIE))
-+	if (!atomic_add_unless(&tsk->memdie, -1, 0))
- 		return;
- 	atomic_dec(&tsk->signal->oom_victims);
- 
-@@ -771,7 +771,7 @@ bool task_will_free_mem(struct task_struct *task)
- 	 * If the process has passed exit_mm we have to skip it because
- 	 * we have lost a link to other tasks sharing this mm, we do not
- 	 * have anything to reap and the task might then get stuck waiting
--	 * for parent as zombie and we do not want it to hold TIF_MEMDIE
-+	 * for parent as zombie and we do not want it to hold memdie
- 	 */
- 	p = find_lock_task_mm(task);
- 	if (!p)
-@@ -836,7 +836,7 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,
- 
- 	/*
- 	 * If the task is already exiting, don't alarm the sysadmin or kill
--	 * its children or threads, just set TIF_MEMDIE so it can die quickly
-+	 * its children or threads, just set memdie so it can die quickly
- 	 */
- 	if (task_will_free_mem(p)) {
- 		mark_oom_victim(p);
-@@ -893,7 +893,7 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,
- 	mm = victim->mm;
- 	atomic_inc(&mm->mm_count);
- 	/*
--	 * We should send SIGKILL before setting TIF_MEMDIE in order to prevent
-+	 * We should send SIGKILL before setting memdie in order to prevent
- 	 * the OOM victim from depleting the memory reserves from the user
- 	 * space under its control.
- 	 */
-@@ -1016,7 +1016,7 @@ bool out_of_memory(struct oom_control *oc)
- 	 * quickly exit and free its memory.
- 	 *
- 	 * But don't select if current has already released its mm and cleared
--	 * TIF_MEMDIE flag at exit_mm(), otherwise an OOM livelock may occur.
-+	 * memdie flag at exit_mm(), otherwise an OOM livelock may occur.
- 	 */
- 	if (current->mm && task_will_free_mem(current)) {
- 		mark_oom_victim(current);
-@@ -1096,7 +1096,7 @@ void pagefault_out_of_memory(void)
- 		 * be a racing OOM victim for which oom_killer_disable()
- 		 * is waiting for.
- 		 */
--		WARN_ON(test_thread_flag(TIF_MEMDIE));
-+		WARN_ON(atomic_read(&current->memdie));
- 	}
- 
- 	mutex_unlock(&oom_lock);
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 89128d64d662..6c550afde6a4 100644
---- a/mm/page_alloc.c
-+++ b/mm/page_alloc.c
-@@ -3050,7 +3050,7 @@ void warn_alloc_failed(gfp_t gfp_mask, unsigned int order, const char *fmt, ...)
- 	 * of allowed nodes.
- 	 */
- 	if (!(gfp_mask & __GFP_NOMEMALLOC))
--		if (test_thread_flag(TIF_MEMDIE) ||
-+		if (atomic_read(&current->memdie) ||
- 		    (current->flags & (PF_MEMALLOC | PF_EXITING)))
- 			filter &= ~SHOW_MEM_FILTER_NODES;
- 	if (in_interrupt() || !(gfp_mask & __GFP_DIRECT_RECLAIM))
-@@ -3428,7 +3428,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask)
- 			alloc_flags |= ALLOC_NO_WATERMARKS;
- 		else if (!in_interrupt() &&
- 				((current->flags & PF_MEMALLOC) ||
--				 unlikely(test_thread_flag(TIF_MEMDIE))))
-+				 unlikely(atomic_read(&current->memdie))))
- 			alloc_flags |= ALLOC_NO_WATERMARKS;
- 	}
- #ifdef CONFIG_CMA
-@@ -3637,7 +3637,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
- 	}
- 
- 	/* Avoid allocations with no watermarks from looping endlessly */
--	if (test_thread_flag(TIF_MEMDIE) && !(gfp_mask & __GFP_NOFAIL))
-+	if (atomic_read(&current->memdie) && !(gfp_mask & __GFP_NOFAIL))
- 		goto nopage;
- 
- 	/*
--- 
-2.8.1
-
--- 
-Michal Hocko
-SUSE Labs
\ No newline at end of file
+---
\ No newline at end of file
diff --git a/a/content_digest b/N2/content_digest
index 484d839..15425c1 100644
--- a/a/content_digest
+++ b/N2/content_digest
@@ -95,755 +95,7 @@
   "on current rather than the given task. I will separate them into their\n",
   "own patches (was just too lazy for it now). If the approach looks\n",
   "reasonable then I will repost next week.\n",
-  "---\n",
-  ">From 1baaa1f8f9568f95d8feccb28cf1994f8ca0df9f Mon Sep 17 00:00:00 2001\n",
-  "From: Michal Hocko <mhocko\@suse.com>\n",
-  "Date: Fri, 24 Jun 2016 16:46:18 +0200\n",
-  "Subject: [PATCH] mm, oom: move TIF_MEMDIE to the task_struct\n",
-  "\n",
-  "There is an interest to drop thread_info->flags usage for further clean\n",
-  "ups. TIF_MEMDIE stands in the way so let's move it out of the\n",
-  "thread_info into the task_struct. We cannot use flags because the oom\n",
-  "killer will set it for !current task without any locking so let's add\n",
-  "task_struct::memdie. It has to be atomic because we need it to be\n",
-  "updated atomically.\n",
-  "\n",
-  "Signed-off-by: Michal Hocko <mhocko\@suse.com>\n",
-  "---\n",
-  " arch/alpha/include/asm/thread_info.h      |  1 -\n",
-  " arch/arc/include/asm/thread_info.h        |  2 --\n",
-  " arch/arm/include/asm/thread_info.h        |  1 -\n",
-  " arch/arm64/include/asm/thread_info.h      |  1 -\n",
-  " arch/avr32/include/asm/thread_info.h      |  2 --\n",
-  " arch/blackfin/include/asm/thread_info.h   |  1 -\n",
-  " arch/c6x/include/asm/thread_info.h        |  1 -\n",
-  " arch/cris/include/asm/thread_info.h       |  1 -\n",
-  " arch/frv/include/asm/thread_info.h        |  1 -\n",
-  " arch/h8300/include/asm/thread_info.h      |  1 -\n",
-  " arch/hexagon/include/asm/thread_info.h    |  1 -\n",
-  " arch/ia64/include/asm/thread_info.h       |  1 -\n",
-  " arch/m32r/include/asm/thread_info.h       |  1 -\n",
-  " arch/m68k/include/asm/thread_info.h       |  1 -\n",
-  " arch/metag/include/asm/thread_info.h      |  1 -\n",
-  " arch/microblaze/include/asm/thread_info.h |  1 -\n",
-  " arch/mips/include/asm/thread_info.h       |  1 -\n",
-  " arch/mn10300/include/asm/thread_info.h    |  1 -\n",
-  " arch/nios2/include/asm/thread_info.h      |  1 -\n",
-  " arch/openrisc/include/asm/thread_info.h   |  1 -\n",
-  " arch/parisc/include/asm/thread_info.h     |  1 -\n",
-  " arch/powerpc/include/asm/thread_info.h    |  1 -\n",
-  " arch/s390/include/asm/thread_info.h       |  1 -\n",
-  " arch/score/include/asm/thread_info.h      |  1 -\n",
-  " arch/sh/include/asm/thread_info.h         |  1 -\n",
-  " arch/sparc/include/asm/thread_info_32.h   |  1 -\n",
-  " arch/sparc/include/asm/thread_info_64.h   |  1 -\n",
-  " arch/tile/include/asm/thread_info.h       |  2 --\n",
-  " arch/um/include/asm/thread_info.h         |  2 --\n",
-  " arch/unicore32/include/asm/thread_info.h  |  1 -\n",
-  " arch/x86/include/asm/thread_info.h        |  1 -\n",
-  " arch/xtensa/include/asm/thread_info.h     |  1 -\n",
-  " drivers/staging/android/lowmemorykiller.c |  2 +-\n",
-  " fs/ext4/mballoc.c                         |  2 +-\n",
-  " include/linux/sched.h                     |  2 ++\n",
-  " kernel/cpuset.c                           | 12 ++++++------\n",
-  " kernel/exit.c                             |  2 +-\n",
-  " kernel/freezer.c                          |  2 +-\n",
-  " mm/ksm.c                                  |  4 ++--\n",
-  " mm/memcontrol.c                           |  2 +-\n",
-  " mm/oom_kill.c                             | 20 ++++++++++----------\n",
-  " mm/page_alloc.c                           |  6 +++---\n",
-  " 42 files changed, 28 insertions(+), 62 deletions(-)\n",
-  "\n",
-  "diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h\n",
-  "index 32e920a83ae5..126eaaf6559d 100644\n",
-  "--- a/arch/alpha/include/asm/thread_info.h\n",
-  "+++ b/arch/alpha/include/asm/thread_info.h\n",
-  "\@\@ -65,7 +65,6 \@\@ register struct thread_info *__current_thread_info __asm__(\"\$8\");\n",
-  " #define TIF_NEED_RESCHED\t3\t/* rescheduling necessary */\n",
-  " #define TIF_SYSCALL_AUDIT\t4\t/* syscall audit active */\n",
-  " #define TIF_DIE_IF_KERNEL\t9\t/* dik recursion lock */\n",
-  "-#define TIF_MEMDIE\t\t13\t/* is terminating due to OOM killer */\n",
-  " #define TIF_POLLING_NRFLAG\t14\t/* idle is polling for TIF_NEED_RESCHED */\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t(1<<TIF_SYSCALL_TRACE)\n",
-  "diff --git a/arch/arc/include/asm/thread_info.h b/arch/arc/include/asm/thread_info.h\n",
-  "index 3af67455659a..46d1fc1a073d 100644\n",
-  "--- a/arch/arc/include/asm/thread_info.h\n",
-  "+++ b/arch/arc/include/asm/thread_info.h\n",
-  "\@\@ -88,14 +88,12 \@\@ static inline __attribute_const__ struct thread_info *current_thread_info(void)\n",
-  " #define TIF_SYSCALL_TRACE\t15\t/* syscall trace active */\n",
-  " \n",
-  " /* true if poll_idle() is polling TIF_NEED_RESCHED */\n",
-  "-#define TIF_MEMDIE\t\t16\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t(1<<TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_NOTIFY_RESUME\t(1<<TIF_NOTIFY_RESUME)\n",
-  " #define _TIF_SIGPENDING\t\t(1<<TIF_SIGPENDING)\n",
-  " #define _TIF_NEED_RESCHED\t(1<<TIF_NEED_RESCHED)\n",
-  " #define _TIF_SYSCALL_AUDIT\t(1<<TIF_SYSCALL_AUDIT)\n",
-  "-#define _TIF_MEMDIE\t\t(1<<TIF_MEMDIE)\n",
-  " \n",
-  " /* work to do on interrupt/exception return */\n",
-  " #define _TIF_WORK_MASK\t\t(_TIF_NEED_RESCHED | _TIF_SIGPENDING | \\\n",
-  "diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h\n",
-  "index 776757d1604a..6277e56f15fd 100644\n",
-  "--- a/arch/arm/include/asm/thread_info.h\n",
-  "+++ b/arch/arm/include/asm/thread_info.h\n",
-  "\@\@ -146,7 +146,6 \@\@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,\n",
-  " \n",
-  " #define TIF_NOHZ\t\t12\t/* in adaptive nohz mode */\n",
-  " #define TIF_USING_IWMMXT\t17\n",
-  "-#define TIF_MEMDIE\t\t18\t/* is terminating due to OOM killer */\n",
-  " #define TIF_RESTORE_SIGMASK\t20\n",
-  " \n",
-  " #define _TIF_SIGPENDING\t\t(1 << TIF_SIGPENDING)\n",
-  "diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h\n",
-  "index abd64bd1f6d9..d78b3b2945a9 100644\n",
-  "--- a/arch/arm64/include/asm/thread_info.h\n",
-  "+++ b/arch/arm64/include/asm/thread_info.h\n",
-  "\@\@ -114,7 +114,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_SYSCALL_AUDIT\t9\n",
-  " #define TIF_SYSCALL_TRACEPOINT\t10\n",
-  " #define TIF_SECCOMP\t\t11\n",
-  "-#define TIF_MEMDIE\t\t18\t/* is terminating due to OOM killer */\n",
-  " #define TIF_FREEZE\t\t19\n",
-  " #define TIF_RESTORE_SIGMASK\t20\n",
-  " #define TIF_SINGLESTEP\t\t21\n",
-  "diff --git a/arch/avr32/include/asm/thread_info.h b/arch/avr32/include/asm/thread_info.h\n",
-  "index d4d3079541ea..680be13234ab 100644\n",
-  "--- a/arch/avr32/include/asm/thread_info.h\n",
-  "+++ b/arch/avr32/include/asm/thread_info.h\n",
-  "\@\@ -70,7 +70,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_NEED_RESCHED        2       /* rescheduling necessary */\n",
-  " #define TIF_BREAKPOINT\t\t4\t/* enter monitor mode on return */\n",
-  " #define TIF_SINGLE_STEP\t\t5\t/* single step in progress */\n",
-  "-#define TIF_MEMDIE\t\t6\t/* is terminating due to OOM killer */\n",
-  " #define TIF_RESTORE_SIGMASK\t7\t/* restore signal mask in do_signal */\n",
-  " #define TIF_CPU_GOING_TO_SLEEP\t8\t/* CPU is entering sleep 0 mode */\n",
-  " #define TIF_NOTIFY_RESUME\t9\t/* callback before returning to user */\n",
-  "\@\@ -82,7 +81,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define _TIF_NEED_RESCHED\t(1 << TIF_NEED_RESCHED)\n",
-  " #define _TIF_BREAKPOINT\t\t(1 << TIF_BREAKPOINT)\n",
-  " #define _TIF_SINGLE_STEP\t(1 << TIF_SINGLE_STEP)\n",
-  "-#define _TIF_MEMDIE\t\t(1 << TIF_MEMDIE)\n",
-  " #define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP)\n",
-  " #define _TIF_NOTIFY_RESUME\t(1 << TIF_NOTIFY_RESUME)\n",
-  " \n",
-  "diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h\n",
-  "index 2966b93850a1..a45ff075ab6a 100644\n",
-  "--- a/arch/blackfin/include/asm/thread_info.h\n",
-  "+++ b/arch/blackfin/include/asm/thread_info.h\n",
-  "\@\@ -79,7 +79,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_SYSCALL_TRACE\t0\t/* syscall trace active */\n",
-  " #define TIF_SIGPENDING\t\t1\t/* signal pending */\n",
-  " #define TIF_NEED_RESCHED\t2\t/* rescheduling necessary */\n",
-  "-#define TIF_MEMDIE\t\t4\t/* is terminating due to OOM killer */\n",
-  " #define TIF_RESTORE_SIGMASK\t5\t/* restore signal mask in do_signal() */\n",
-  " #define TIF_IRQ_SYNC\t\t7\t/* sync pipeline stage */\n",
-  " #define TIF_NOTIFY_RESUME\t8\t/* callback before returning to user */\n",
-  "diff --git a/arch/c6x/include/asm/thread_info.h b/arch/c6x/include/asm/thread_info.h\n",
-  "index acc70c135ab8..22ff7b03641d 100644\n",
-  "--- a/arch/c6x/include/asm/thread_info.h\n",
-  "+++ b/arch/c6x/include/asm/thread_info.h\n",
-  "\@\@ -89,7 +89,6 \@\@ struct thread_info *current_thread_info(void)\n",
-  " #define TIF_NEED_RESCHED\t3\t/* rescheduling necessary */\n",
-  " #define TIF_RESTORE_SIGMASK\t4\t/* restore signal mask in do_signal() */\n",
-  " \n",
-  "-#define TIF_MEMDIE\t\t17\t/* OOM killer killed process */\n",
-  " \n",
-  " #define TIF_WORK_MASK\t\t0x00007FFE /* work on irq/exception return */\n",
-  " #define TIF_ALLWORK_MASK\t0x00007FFF /* work on any return to u-space */\n",
-  "diff --git a/arch/cris/include/asm/thread_info.h b/arch/cris/include/asm/thread_info.h\n",
-  "index 4ead1b40d2d7..79ebddc22aa3 100644\n",
-  "--- a/arch/cris/include/asm/thread_info.h\n",
-  "+++ b/arch/cris/include/asm/thread_info.h\n",
-  "\@\@ -70,7 +70,6 \@\@ struct thread_info {\n",
-  " #define TIF_SIGPENDING\t\t2\t/* signal pending */\n",
-  " #define TIF_NEED_RESCHED\t3\t/* rescheduling necessary */\n",
-  " #define TIF_RESTORE_SIGMASK\t9\t/* restore signal mask in do_signal() */\n",
-  "-#define TIF_MEMDIE\t\t17\t/* is terminating due to OOM killer */\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t(1<<TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_NOTIFY_RESUME\t(1<<TIF_NOTIFY_RESUME)\n",
-  "diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h\n",
-  "index ccba3b6ce918..993930f59d8e 100644\n",
-  "--- a/arch/frv/include/asm/thread_info.h\n",
-  "+++ b/arch/frv/include/asm/thread_info.h\n",
-  "\@\@ -86,7 +86,6 \@\@ register struct thread_info *__current_thread_info asm(\"gr15\");\n",
-  " #define TIF_NEED_RESCHED\t3\t/* rescheduling necessary */\n",
-  " #define TIF_SINGLESTEP\t\t4\t/* restore singlestep on return to user mode */\n",
-  " #define TIF_RESTORE_SIGMASK\t5\t/* restore signal mask in do_signal() */\n",
-  "-#define TIF_MEMDIE\t\t7\t/* is terminating due to OOM killer */\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t(1 << TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_NOTIFY_RESUME\t(1 << TIF_NOTIFY_RESUME)\n",
-  "diff --git a/arch/h8300/include/asm/thread_info.h b/arch/h8300/include/asm/thread_info.h\n",
-  "index b408fe660cf8..68c10bce921e 100644\n",
-  "--- a/arch/h8300/include/asm/thread_info.h\n",
-  "+++ b/arch/h8300/include/asm/thread_info.h\n",
-  "\@\@ -73,7 +73,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_SIGPENDING\t\t1\t/* signal pending */\n",
-  " #define TIF_NEED_RESCHED\t2\t/* rescheduling necessary */\n",
-  " #define TIF_SINGLESTEP\t\t3\t/* singlestepping active */\n",
-  "-#define TIF_MEMDIE\t\t4\t/* is terminating due to OOM killer */\n",
-  " #define TIF_RESTORE_SIGMASK\t5\t/* restore signal mask in do_signal() */\n",
-  " #define TIF_NOTIFY_RESUME\t6\t/* callback before returning to user */\n",
-  " #define TIF_SYSCALL_AUDIT\t7\t/* syscall auditing active */\n",
-  "diff --git a/arch/hexagon/include/asm/thread_info.h b/arch/hexagon/include/asm/thread_info.h\n",
-  "index b80fe1db7b64..e55c7d0a1755 100644\n",
-  "--- a/arch/hexagon/include/asm/thread_info.h\n",
-  "+++ b/arch/hexagon/include/asm/thread_info.h\n",
-  "\@\@ -112,7 +112,6 \@\@ register struct thread_info *__current_thread_info asm(QUOTED_THREADINFO_REG);\n",
-  " #define TIF_SINGLESTEP          4       /* restore ss \@ return to usr mode */\n",
-  " #define TIF_RESTORE_SIGMASK     6       /* restore sig mask in do_signal() */\n",
-  " /* true if poll_idle() is polling TIF_NEED_RESCHED */\n",
-  "-#define TIF_MEMDIE              17      /* OOM killer killed process */\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE      (1 << TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_NOTIFY_RESUME      (1 << TIF_NOTIFY_RESUME)\n",
-  "diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h\n",
-  "index aa995b67c3f5..77064b1d188a 100644\n",
-  "--- a/arch/ia64/include/asm/thread_info.h\n",
-  "+++ b/arch/ia64/include/asm/thread_info.h\n",
-  "\@\@ -97,7 +97,6 \@\@ struct thread_info {\n",
-  " #define TIF_SYSCALL_AUDIT\t3\t/* syscall auditing active */\n",
-  " #define TIF_SINGLESTEP\t\t4\t/* restore singlestep on return to user mode */\n",
-  " #define TIF_NOTIFY_RESUME\t6\t/* resumption notification requested */\n",
-  "-#define TIF_MEMDIE\t\t17\t/* is terminating due to OOM killer */\n",
-  " #define TIF_MCA_INIT\t\t18\t/* this task is processing MCA or INIT */\n",
-  " #define TIF_DB_DISABLED\t\t19\t/* debug trap disabled for fsyscall */\n",
-  " #define TIF_RESTORE_RSE\t\t21\t/* user RBS is newer than kernel RBS */\n",
-  "diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h\n",
-  "index f630d9c30b28..bc54a574fad0 100644\n",
-  "--- a/arch/m32r/include/asm/thread_info.h\n",
-  "+++ b/arch/m32r/include/asm/thread_info.h\n",
-  "\@\@ -102,7 +102,6 \@\@ static inline unsigned int get_thread_fault_code(void)\n",
-  " #define TIF_NOTIFY_RESUME\t5\t/* callback before returning to user */\n",
-  " #define TIF_RESTORE_SIGMASK\t8\t/* restore signal mask in do_signal() */\n",
-  " #define TIF_USEDFPU\t\t16\t/* FPU was used by this task this quantum (SMP) */\n",
-  "-#define TIF_MEMDIE\t\t18\t/* is terminating due to OOM killer */\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t(1<<TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_SIGPENDING\t\t(1<<TIF_SIGPENDING)\n",
-  "diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h\n",
-  "index cee13c2e5161..ed497d31ea5d 100644\n",
-  "--- a/arch/m68k/include/asm/thread_info.h\n",
-  "+++ b/arch/m68k/include/asm/thread_info.h\n",
-  "\@\@ -68,7 +68,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_NEED_RESCHED\t7\t/* rescheduling necessary */\n",
-  " #define TIF_DELAYED_TRACE\t14\t/* single step a syscall */\n",
-  " #define TIF_SYSCALL_TRACE\t15\t/* syscall trace active */\n",
-  "-#define TIF_MEMDIE\t\t16\t/* is terminating due to OOM killer */\n",
-  " #define TIF_RESTORE_SIGMASK\t18\t/* restore signal mask in do_signal */\n",
-  " \n",
-  " #endif\t/* _ASM_M68K_THREAD_INFO_H */\n",
-  "diff --git a/arch/metag/include/asm/thread_info.h b/arch/metag/include/asm/thread_info.h\n",
-  "index 32677cc278aa..c506e5a61714 100644\n",
-  "--- a/arch/metag/include/asm/thread_info.h\n",
-  "+++ b/arch/metag/include/asm/thread_info.h\n",
-  "\@\@ -111,7 +111,6 \@\@ static inline int kstack_end(void *addr)\n",
-  " #define TIF_SECCOMP\t\t5\t/* secure computing */\n",
-  " #define TIF_RESTORE_SIGMASK\t6\t/* restore signal mask in do_signal() */\n",
-  " #define TIF_NOTIFY_RESUME\t7\t/* callback before returning to user */\n",
-  "-#define TIF_MEMDIE\t\t8\t/* is terminating due to OOM killer */\n",
-  " #define TIF_SYSCALL_TRACEPOINT\t9\t/* syscall tracepoint instrumentation */\n",
-  " \n",
-  " \n",
-  "diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h\n",
-  "index 383f387b4eee..281a365bec48 100644\n",
-  "--- a/arch/microblaze/include/asm/thread_info.h\n",
-  "+++ b/arch/microblaze/include/asm/thread_info.h\n",
-  "\@\@ -113,7 +113,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_NEED_RESCHED\t3 /* rescheduling necessary */\n",
-  " /* restore singlestep on return to user mode */\n",
-  " #define TIF_SINGLESTEP\t\t4\n",
-  "-#define TIF_MEMDIE\t\t6\t/* is terminating due to OOM killer */\n",
-  " #define TIF_SYSCALL_AUDIT\t9       /* syscall auditing active */\n",
-  " #define TIF_SECCOMP\t\t10      /* secure computing */\n",
-  " \n",
-  "diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h\n",
-  "index e309d8fcb516..3dd906330867 100644\n",
-  "--- a/arch/mips/include/asm/thread_info.h\n",
-  "+++ b/arch/mips/include/asm/thread_info.h\n",
-  "\@\@ -102,7 +102,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_UPROBE\t\t6\t/* breakpointed or singlestepping */\n",
-  " #define TIF_RESTORE_SIGMASK\t9\t/* restore signal mask in do_signal() */\n",
-  " #define TIF_USEDFPU\t\t16\t/* FPU was used by this task this quantum (SMP) */\n",
-  "-#define TIF_MEMDIE\t\t18\t/* is terminating due to OOM killer */\n",
-  " #define TIF_NOHZ\t\t19\t/* in adaptive nohz mode */\n",
-  " #define TIF_FIXADE\t\t20\t/* Fix address errors in software */\n",
-  " #define TIF_LOGADE\t\t21\t/* Log address errors to syslog */\n",
-  "diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h\n",
-  "index 4861a78c7160..1dd24f251a98 100644\n",
-  "--- a/arch/mn10300/include/asm/thread_info.h\n",
-  "+++ b/arch/mn10300/include/asm/thread_info.h\n",
-  "\@\@ -145,7 +145,6 \@\@ void arch_release_thread_info(struct thread_info *ti);\n",
-  " #define TIF_SINGLESTEP\t\t4\t/* restore singlestep on return to user mode */\n",
-  " #define TIF_RESTORE_SIGMASK\t5\t/* restore signal mask in do_signal() */\n",
-  " #define TIF_POLLING_NRFLAG\t16\t/* true if poll_idle() is polling TIF_NEED_RESCHED */\n",
-  "-#define TIF_MEMDIE\t\t17\t/* is terminating due to OOM killer */\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t+(1 << TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_NOTIFY_RESUME\t+(1 << TIF_NOTIFY_RESUME)\n",
-  "diff --git a/arch/nios2/include/asm/thread_info.h b/arch/nios2/include/asm/thread_info.h\n",
-  "index d69c338bd19c..bf7d38c1c6e2 100644\n",
-  "--- a/arch/nios2/include/asm/thread_info.h\n",
-  "+++ b/arch/nios2/include/asm/thread_info.h\n",
-  "\@\@ -86,7 +86,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_NOTIFY_RESUME\t1\t/* resumption notification requested */\n",
-  " #define TIF_SIGPENDING\t\t2\t/* signal pending */\n",
-  " #define TIF_NEED_RESCHED\t3\t/* rescheduling necessary */\n",
-  "-#define TIF_MEMDIE\t\t4\t/* is terminating due to OOM killer */\n",
-  " #define TIF_SECCOMP\t\t5\t/* secure computing */\n",
-  " #define TIF_SYSCALL_AUDIT\t6\t/* syscall auditing active */\n",
-  " #define TIF_RESTORE_SIGMASK\t9\t/* restore signal mask in do_signal() */\n",
-  "diff --git a/arch/openrisc/include/asm/thread_info.h b/arch/openrisc/include/asm/thread_info.h\n",
-  "index 6e619a79a401..7678a1b2dc64 100644\n",
-  "--- a/arch/openrisc/include/asm/thread_info.h\n",
-  "+++ b/arch/openrisc/include/asm/thread_info.h\n",
-  "\@\@ -108,7 +108,6 \@\@ register struct thread_info *current_thread_info_reg asm(\"r10\");\n",
-  " #define TIF_RESTORE_SIGMASK     9\n",
-  " #define TIF_POLLING_NRFLAG\t16\t/* true if poll_idle() is polling\t\t\t\t\t\t * TIF_NEED_RESCHED\n",
-  " \t\t\t\t\t */\n",
-  "-#define TIF_MEMDIE              17\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t(1<<TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_NOTIFY_RESUME\t(1<<TIF_NOTIFY_RESUME)\n",
-  "diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h\n",
-  "index e96e693fd58c..bcebec0b9418 100644\n",
-  "--- a/arch/parisc/include/asm/thread_info.h\n",
-  "+++ b/arch/parisc/include/asm/thread_info.h\n",
-  "\@\@ -48,7 +48,6 \@\@ struct thread_info {\n",
-  " #define TIF_NEED_RESCHED\t2\t/* rescheduling necessary */\n",
-  " #define TIF_POLLING_NRFLAG\t3\t/* true if poll_idle() is polling TIF_NEED_RESCHED */\n",
-  " #define TIF_32BIT               4       /* 32 bit binary */\n",
-  "-#define TIF_MEMDIE\t\t5\t/* is terminating due to OOM killer */\n",
-  " #define TIF_RESTORE_SIGMASK\t6\t/* restore saved signal mask */\n",
-  " #define TIF_SYSCALL_AUDIT\t7\t/* syscall auditing active */\n",
-  " #define TIF_NOTIFY_RESUME\t8\t/* callback before returning to user */\n",
-  "diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h\n",
-  "index 7efee4a3240b..d744fa455dd2 100644\n",
-  "--- a/arch/powerpc/include/asm/thread_info.h\n",
-  "+++ b/arch/powerpc/include/asm/thread_info.h\n",
-  "\@\@ -97,7 +97,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_SYSCALL_TRACEPOINT\t15\t/* syscall tracepoint instrumentation */\n",
-  " #define TIF_EMULATE_STACK_STORE\t16\t/* Is an instruction emulation\n",
-  " \t\t\t\t\t\tfor stack store? */\n",
-  "-#define TIF_MEMDIE\t\t17\t/* is terminating due to OOM killer */\n",
-  " #if defined(CONFIG_PPC64)\n",
-  " #define TIF_ELF2ABI\t\t18\t/* function descriptors must die! */\n",
-  " #endif\n",
-  "diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h\n",
-  "index 2fffc2c27581..8fc2704dd263 100644\n",
-  "--- a/arch/s390/include/asm/thread_info.h\n",
-  "+++ b/arch/s390/include/asm/thread_info.h\n",
-  "\@\@ -79,7 +79,6 \@\@ void arch_release_task_struct(struct task_struct *tsk);\n",
-  " #define TIF_SYSCALL_TRACEPOINT\t6\t/* syscall tracepoint instrumentation */\n",
-  " #define TIF_UPROBE\t\t7\t/* breakpointed or single-stepping */\n",
-  " #define TIF_31BIT\t\t16\t/* 32bit process */\n",
-  "-#define TIF_MEMDIE\t\t17\t/* is terminating due to OOM killer */\n",
-  " #define TIF_RESTORE_SIGMASK\t18\t/* restore signal mask in do_signal() */\n",
-  " #define TIF_SINGLE_STEP\t\t19\t/* This task is single stepped */\n",
-  " #define TIF_BLOCK_STEP\t\t20\t/* This task is block stepped */\n",
-  "diff --git a/arch/score/include/asm/thread_info.h b/arch/score/include/asm/thread_info.h\n",
-  "index 7d9ffb15c477..f6e1cc89cef9 100644\n",
-  "--- a/arch/score/include/asm/thread_info.h\n",
-  "+++ b/arch/score/include/asm/thread_info.h\n",
-  "\@\@ -78,7 +78,6 \@\@ register struct thread_info *__current_thread_info __asm__(\"r28\");\n",
-  " #define TIF_NEED_RESCHED\t2\t/* rescheduling necessary */\n",
-  " #define TIF_NOTIFY_RESUME\t5\t/* callback before returning to user */\n",
-  " #define TIF_RESTORE_SIGMASK\t9\t/* restore signal mask in do_signal() */\n",
-  "-#define TIF_MEMDIE\t\t18\t/* is terminating due to OOM killer */\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t(1<<TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_SIGPENDING\t\t(1<<TIF_SIGPENDING)\n",
-  "diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h\n",
-  "index 2afa321157be..017f3993f384 100644\n",
-  "--- a/arch/sh/include/asm/thread_info.h\n",
-  "+++ b/arch/sh/include/asm/thread_info.h\n",
-  "\@\@ -117,7 +117,6 \@\@ extern void init_thread_xstate(void);\n",
-  " #define TIF_NOTIFY_RESUME\t7\t/* callback before returning to user */\n",
-  " #define TIF_SYSCALL_TRACEPOINT\t8\t/* for ftrace syscall instrumentation */\n",
-  " #define TIF_POLLING_NRFLAG\t17\t/* true if poll_idle() is polling TIF_NEED_RESCHED */\n",
-  "-#define TIF_MEMDIE\t\t18\t/* is terminating due to OOM killer */\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t(1 << TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_SIGPENDING\t\t(1 << TIF_SIGPENDING)\n",
-  "diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h\n",
-  "index 229475f0d7ce..bcf81999db0b 100644\n",
-  "--- a/arch/sparc/include/asm/thread_info_32.h\n",
-  "+++ b/arch/sparc/include/asm/thread_info_32.h\n",
-  "\@\@ -110,7 +110,6 \@\@ register struct thread_info *current_thread_info_reg asm(\"g6\");\n",
-  " \t\t\t\t\t * this quantum (SMP) */\n",
-  " #define TIF_POLLING_NRFLAG\t9\t/* true if poll_idle() is polling\n",
-  " \t\t\t\t\t * TIF_NEED_RESCHED */\n",
-  "-#define TIF_MEMDIE\t\t10\t/* is terminating due to OOM killer */\n",
-  " \n",
-  " /* as above, but as bit values */\n",
-  " #define _TIF_SYSCALL_TRACE\t(1<<TIF_SYSCALL_TRACE)\n",
-  "diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h\n",
-  "index bde59825d06c..63b3285b7d46 100644\n",
-  "--- a/arch/sparc/include/asm/thread_info_64.h\n",
-  "+++ b/arch/sparc/include/asm/thread_info_64.h\n",
-  "\@\@ -191,7 +191,6 \@\@ register struct thread_info *current_thread_info_reg asm(\"g6\");\n",
-  "  *       an immediate value in instructions such as andcc.\n",
-  "  */\n",
-  " /* flag bit 12 is available */\n",
-  "-#define TIF_MEMDIE\t\t13\t/* is terminating due to OOM killer */\n",
-  " #define TIF_POLLING_NRFLAG\t14\n",
-  " \n",
-  " #define _TIF_SYSCALL_TRACE\t(1<<TIF_SYSCALL_TRACE)\n",
-  "diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h\n",
-  "index 4b7cef9e94e0..734d53f4b435 100644\n",
-  "--- a/arch/tile/include/asm/thread_info.h\n",
-  "+++ b/arch/tile/include/asm/thread_info.h\n",
-  "\@\@ -121,7 +121,6 \@\@ extern void _cpu_idle(void);\n",
-  " #define TIF_SYSCALL_TRACE\t4\t/* syscall trace active */\n",
-  " #define TIF_SYSCALL_AUDIT\t5\t/* syscall auditing active */\n",
-  " #define TIF_SECCOMP\t\t6\t/* secure computing */\n",
-  "-#define TIF_MEMDIE\t\t7\t/* OOM killer at work */\n",
-  " #define TIF_NOTIFY_RESUME\t8\t/* callback before returning to user */\n",
-  " #define TIF_SYSCALL_TRACEPOINT\t9\t/* syscall tracepoint instrumentation */\n",
-  " #define TIF_POLLING_NRFLAG\t10\t/* idle is polling for TIF_NEED_RESCHED */\n",
-  "\@\@ -134,7 +133,6 \@\@ extern void _cpu_idle(void);\n",
-  " #define _TIF_SYSCALL_TRACE\t(1<<TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_SYSCALL_AUDIT\t(1<<TIF_SYSCALL_AUDIT)\n",
-  " #define _TIF_SECCOMP\t\t(1<<TIF_SECCOMP)\n",
-  "-#define _TIF_MEMDIE\t\t(1<<TIF_MEMDIE)\n",
-  " #define _TIF_NOTIFY_RESUME\t(1<<TIF_NOTIFY_RESUME)\n",
-  " #define _TIF_SYSCALL_TRACEPOINT\t(1<<TIF_SYSCALL_TRACEPOINT)\n",
-  " #define _TIF_POLLING_NRFLAG\t(1<<TIF_POLLING_NRFLAG)\n",
-  "diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h\n",
-  "index 053baff03674..b13047eeaede 100644\n",
-  "--- a/arch/um/include/asm/thread_info.h\n",
-  "+++ b/arch/um/include/asm/thread_info.h\n",
-  "\@\@ -58,7 +58,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_SIGPENDING\t\t1\t/* signal pending */\n",
-  " #define TIF_NEED_RESCHED\t2\t/* rescheduling necessary */\n",
-  " #define TIF_RESTART_BLOCK\t4\n",
-  "-#define TIF_MEMDIE\t\t5\t/* is terminating due to OOM killer */\n",
-  " #define TIF_SYSCALL_AUDIT\t6\n",
-  " #define TIF_RESTORE_SIGMASK\t7\n",
-  " #define TIF_NOTIFY_RESUME\t8\n",
-  "\@\@ -67,7 +66,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define _TIF_SYSCALL_TRACE\t(1 << TIF_SYSCALL_TRACE)\n",
-  " #define _TIF_SIGPENDING\t\t(1 << TIF_SIGPENDING)\n",
-  " #define _TIF_NEED_RESCHED\t(1 << TIF_NEED_RESCHED)\n",
-  "-#define _TIF_MEMDIE\t\t(1 << TIF_MEMDIE)\n",
-  " #define _TIF_SYSCALL_AUDIT\t(1 << TIF_SYSCALL_AUDIT)\n",
-  " #define _TIF_SECCOMP\t\t(1 << TIF_SECCOMP)\n",
-  " \n",
-  "diff --git a/arch/unicore32/include/asm/thread_info.h b/arch/unicore32/include/asm/thread_info.h\n",
-  "index e79ad6d5b5b2..2487cf9dd41e 100644\n",
-  "--- a/arch/unicore32/include/asm/thread_info.h\n",
-  "+++ b/arch/unicore32/include/asm/thread_info.h\n",
-  "\@\@ -121,7 +121,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_NEED_RESCHED\t1\n",
-  " #define TIF_NOTIFY_RESUME\t2\t/* callback before returning to user */\n",
-  " #define TIF_SYSCALL_TRACE\t8\n",
-  "-#define TIF_MEMDIE\t\t18\n",
-  " #define TIF_RESTORE_SIGMASK\t20\n",
-  " \n",
-  " #define _TIF_SIGPENDING\t\t(1 << TIF_SIGPENDING)\n",
-  "diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h\n",
-  "index ffae84df8a93..79a4b75e814c 100644\n",
-  "--- a/arch/x86/include/asm/thread_info.h\n",
-  "+++ b/arch/x86/include/asm/thread_info.h\n",
-  "\@\@ -101,7 +101,6 \@\@ struct thread_info {\n",
-  " #define TIF_IA32\t\t17\t/* IA32 compatibility process */\n",
-  " #define TIF_FORK\t\t18\t/* ret_from_fork */\n",
-  " #define TIF_NOHZ\t\t19\t/* in adaptive nohz mode */\n",
-  "-#define TIF_MEMDIE\t\t20\t/* is terminating due to OOM killer */\n",
-  " #define TIF_POLLING_NRFLAG\t21\t/* idle is polling for TIF_NEED_RESCHED */\n",
-  " #define TIF_IO_BITMAP\t\t22\t/* uses I/O bitmap */\n",
-  " #define TIF_FORCED_TF\t\t24\t/* true if TF in eflags artificially */\n",
-  "diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h\n",
-  "index 7be2400f745a..791a0a0b5827 100644\n",
-  "--- a/arch/xtensa/include/asm/thread_info.h\n",
-  "+++ b/arch/xtensa/include/asm/thread_info.h\n",
-  "\@\@ -108,7 +108,6 \@\@ static inline struct thread_info *current_thread_info(void)\n",
-  " #define TIF_SIGPENDING\t\t1\t/* signal pending */\n",
-  " #define TIF_NEED_RESCHED\t2\t/* rescheduling necessary */\n",
-  " #define TIF_SINGLESTEP\t\t3\t/* restore singlestep on return to user mode */\n",
-  "-#define TIF_MEMDIE\t\t5\t/* is terminating due to OOM killer */\n",
-  " #define TIF_RESTORE_SIGMASK\t6\t/* restore signal mask in do_signal() */\n",
-  " #define TIF_NOTIFY_RESUME\t7\t/* callback before returning to user */\n",
-  " #define TIF_DB_DISABLED\t\t8\t/* debug trap disabled for syscall */\n",
-  "diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c\n",
-  "index 2509e5df7244..55d02f2376ab 100644\n",
-  "--- a/drivers/staging/android/lowmemorykiller.c\n",
-  "+++ b/drivers/staging/android/lowmemorykiller.c\n",
-  "\@\@ -131,7 +131,7 \@\@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)\n",
-  " \t\tif (!p)\n",
-  " \t\t\tcontinue;\n",
-  " \n",
-  "-\t\tif (test_tsk_thread_flag(p, TIF_MEMDIE) &&\n",
-  "+\t\tif (atomic_read(&p->memdie) &&\n",
-  " \t\t    time_before_eq(jiffies, lowmem_deathpending_timeout)) {\n",
-  " \t\t\ttask_unlock(p);\n",
-  " \t\t\trcu_read_unlock();\n",
-  "diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c\n",
-  "index c1ab3ec30423..ddc12f571c50 100644\n",
-  "--- a/fs/ext4/mballoc.c\n",
-  "+++ b/fs/ext4/mballoc.c\n",
-  "\@\@ -4815,7 +4815,7 \@\@ void ext4_free_blocks(handle_t *handle, struct inode *inode,\n",
-  " #endif\n",
-  " \ttrace_ext4_mballoc_free(sb, inode, block_group, bit, count_clusters);\n",
-  " \n",
-  "-\t/* __GFP_NOFAIL: retry infinitely, ignore TIF_MEMDIE and memcg limit. */\n",
-  "+\t/* __GFP_NOFAIL: retry infinitely, ignore memdie tasks and memcg limit. */\n",
-  " \terr = ext4_mb_load_buddy_gfp(sb, block_group, &e4b,\n",
-  " \t\t\t\t     GFP_NOFS|__GFP_NOFAIL);\n",
-  " \tif (err)\n",
-  "diff --git a/include/linux/sched.h b/include/linux/sched.h\n",
-  "index 6d81a1eb974a..4c91fc0c2e8e 100644\n",
-  "--- a/include/linux/sched.h\n",
-  "+++ b/include/linux/sched.h\n",
-  "\@\@ -1856,6 +1856,8 \@\@ struct task_struct {\n",
-  " \tunsigned long\ttask_state_change;\n",
-  " #endif\n",
-  " \tint pagefault_disabled;\n",
-  "+\t/* oom victim - give it access to memory reserves */\n",
-  "+\tatomic_t\tmemdie;\n",
-  " #ifdef CONFIG_MMU\n",
-  " \tstruct task_struct *oom_reaper_list;\n",
-  " #endif\n",
-  "diff --git a/kernel/cpuset.c b/kernel/cpuset.c\n",
-  "index 73e93e53884d..857fac0b973d 100644\n",
-  "--- a/kernel/cpuset.c\n",
-  "+++ b/kernel/cpuset.c\n",
-  "\@\@ -1038,9 +1038,9 \@\@ static void cpuset_change_task_nodemask(struct task_struct *tsk,\n",
-  " \t * Allow tasks that have access to memory reserves because they have\n",
-  " \t * been OOM killed to get memory anywhere.\n",
-  " \t */\n",
-  "-\tif (unlikely(test_thread_flag(TIF_MEMDIE)))\n",
-  "+\tif (unlikely(atomic_read(&tsk->memdie)))\n",
-  " \t\treturn;\n",
-  "-\tif (current->flags & PF_EXITING) /* Let dying task have memory */\n",
-  "+\tif (tsk->flags & PF_EXITING) /* Let dying task have memory */\n",
-  " \t\treturn;\n",
-  " \n",
-  " \ttask_lock(tsk);\n",
-  "\@\@ -2496,12 +2496,12 \@\@ static struct cpuset *nearest_hardwall_ancestor(struct cpuset *cs)\n",
-  "  * If we're in interrupt, yes, we can always allocate.  If \@node is set in\n",
-  "  * current's mems_allowed, yes.  If it's not a __GFP_HARDWALL request and this\n",
-  "  * node is set in the nearest hardwalled cpuset ancestor to current's cpuset,\n",
-  "- * yes.  If current has access to memory reserves due to TIF_MEMDIE, yes.\n",
-  "+ * yes.  If current has access to memory reserves due to memdie, yes.\n",
-  "  * Otherwise, no.\n",
-  "  *\n",
-  "  * GFP_USER allocations are marked with the __GFP_HARDWALL bit,\n",
-  "  * and do not allow allocations outside the current tasks cpuset\n",
-  "- * unless the task has been OOM killed as is marked TIF_MEMDIE.\n",
-  "+ * unless the task has been OOM killed as is marked memdie.\n",
-  "  * GFP_KERNEL allocations are not so marked, so can escape to the\n",
-  "  * nearest enclosing hardwalled ancestor cpuset.\n",
-  "  *\n",
-  "\@\@ -2524,7 +2524,7 \@\@ static struct cpuset *nearest_hardwall_ancestor(struct cpuset *cs)\n",
-  "  * affect that:\n",
-  "  *\tin_interrupt - any node ok (current task context irrelevant)\n",
-  "  *\tGFP_ATOMIC   - any node ok\n",
-  "- *\tTIF_MEMDIE   - any node ok\n",
-  "+ *\tmemdie       - any node ok\n",
-  "  *\tGFP_KERNEL   - any node in enclosing hardwalled cpuset ok\n",
-  "  *\tGFP_USER     - only nodes in current tasks mems allowed ok.\n",
-  "  */\n",
-  "\@\@ -2542,7 +2542,7 \@\@ bool __cpuset_node_allowed(int node, gfp_t gfp_mask)\n",
-  " \t * Allow tasks that have access to memory reserves because they have\n",
-  " \t * been OOM killed to get memory anywhere.\n",
-  " \t */\n",
-  "-\tif (unlikely(test_thread_flag(TIF_MEMDIE)))\n",
-  "+\tif (unlikely(atomic_read(&current->memdie)))\n",
-  " \t\treturn true;\n",
-  " \tif (gfp_mask & __GFP_HARDWALL)\t/* If hardwall request, stop here */\n",
-  " \t\treturn false;\n",
-  "diff --git a/kernel/exit.c b/kernel/exit.c\n",
-  "index 9e6e1356e6bb..8bfdda9bc99a 100644\n",
-  "--- a/kernel/exit.c\n",
-  "+++ b/kernel/exit.c\n",
-  "\@\@ -434,7 +434,7 \@\@ static void exit_mm(struct task_struct *tsk)\n",
-  " \ttask_unlock(tsk);\n",
-  " \tmm_update_next_owner(mm);\n",
-  " \tmmput(mm);\n",
-  "-\tif (test_thread_flag(TIF_MEMDIE))\n",
-  "+\tif (atomic_read(&current->memdie))\n",
-  " \t\texit_oom_victim(tsk);\n",
-  " }\n",
-  " \n",
-  "diff --git a/kernel/freezer.c b/kernel/freezer.c\n",
-  "index a8900a3bc27a..e1bd9f2780fe 100644\n",
-  "--- a/kernel/freezer.c\n",
-  "+++ b/kernel/freezer.c\n",
-  "\@\@ -42,7 +42,7 \@\@ bool freezing_slow_path(struct task_struct *p)\n",
-  " \tif (p->flags & (PF_NOFREEZE | PF_SUSPEND_TASK))\n",
-  " \t\treturn false;\n",
-  " \n",
-  "-\tif (test_thread_flag(TIF_MEMDIE))\n",
-  "+\tif (atomic_read(&p->memdie))\n",
-  " \t\treturn false;\n",
-  " \n",
-  " \tif (pm_nosig_freezing || cgroup_freezing(p))\n",
-  "diff --git a/mm/ksm.c b/mm/ksm.c\n",
-  "index 73d43bafd9fb..8d5a295fb955 100644\n",
-  "--- a/mm/ksm.c\n",
-  "+++ b/mm/ksm.c\n",
-  "\@\@ -396,11 +396,11 \@\@ static int break_ksm(struct vm_area_struct *vma, unsigned long addr)\n",
-  " \t *\n",
-  " \t * VM_FAULT_OOM: at the time of writing (late July 2009), setting\n",
-  " \t * aside mem_cgroup limits, VM_FAULT_OOM would only be set if the\n",
-  "-\t * current task has TIF_MEMDIE set, and will be OOM killed on return\n",
-  "+\t * current task has memdie set, and will be OOM killed on return\n",
-  " \t * to user; and ksmd, having no mm, would never be chosen for that.\n",
-  " \t *\n",
-  " \t * But if the mm is in a limited mem_cgroup, then the fault may fail\n",
-  "-\t * with VM_FAULT_OOM even if the current task is not TIF_MEMDIE; and\n",
-  "+\t * with VM_FAULT_OOM even if the current task is not memdie; and\n",
-  " \t * even ksmd can fail in this way - though it's usually breaking ksm\n",
-  " \t * just to undo a merge it made a moment before, so unlikely to oom.\n",
-  " \t *\n",
-  "diff --git a/mm/memcontrol.c b/mm/memcontrol.c\n",
-  "index 3e8f9e5e9291..df411de17a75 100644\n",
-  "--- a/mm/memcontrol.c\n",
-  "+++ b/mm/memcontrol.c\n",
-  "\@\@ -1987,7 +1987,7 \@\@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask,\n",
-  " \t * bypass the last charges so that they can exit quickly and\n",
-  " \t * free their memory.\n",
-  " \t */\n",
-  "-\tif (unlikely(test_thread_flag(TIF_MEMDIE) ||\n",
-  "+\tif (unlikely(atomic_read(&current->memdie) ||\n",
-  " \t\t     fatal_signal_pending(current) ||\n",
-  " \t\t     current->flags & PF_EXITING))\n",
-  " \t\tgoto force;\n",
-  "diff --git a/mm/oom_kill.c b/mm/oom_kill.c\n",
-  "index 4c21f744daa6..9d24007cdb82 100644\n",
-  "--- a/mm/oom_kill.c\n",
-  "+++ b/mm/oom_kill.c\n",
-  "\@\@ -473,7 +473,7 \@\@ static bool __oom_reap_task(struct task_struct *tsk)\n",
-  " \t *\t\t\t\t[...]\n",
-  " \t *\t\t\t\tout_of_memory\n",
-  " \t *\t\t\t\t  select_bad_process\n",
-  "-\t *\t\t\t\t    # no TIF_MEMDIE task selects new victim\n",
-  "+\t *\t\t\t\t    # no memdie task selects new victim\n",
-  " \t *  unmap_page_range # frees some memory\n",
-  " \t */\n",
-  " \tmutex_lock(&oom_lock);\n",
-  "\@\@ -593,7 +593,7 \@\@ static void oom_reap_task(struct task_struct *tsk)\n",
-  " \t}\n",
-  " \n",
-  " \t/*\n",
-  "-\t * Clear TIF_MEMDIE because the task shouldn't be sitting on a\n",
-  "+\t * Clear memdie because the task shouldn't be sitting on a\n",
-  " \t * reasonably reclaimable memory anymore or it is not a good candidate\n",
-  " \t * for the oom victim right now because it cannot release its memory\n",
-  " \t * itself nor by the oom reaper.\n",
-  "\@\@ -669,14 +669,14 \@\@ void mark_oom_victim(struct task_struct *tsk)\n",
-  " {\n",
-  " \tWARN_ON(oom_killer_disabled);\n",
-  " \t/* OOM killer might race with memcg OOM */\n",
-  "-\tif (test_and_set_tsk_thread_flag(tsk, TIF_MEMDIE))\n",
-  "+\tif (!atomic_add_unless(&tsk->memdie, 1, 1))\n",
-  " \t\treturn;\n",
-  " \tatomic_inc(&tsk->signal->oom_victims);\n",
-  " \t/*\n",
-  " \t * Make sure that the task is woken up from uninterruptible sleep\n",
-  " \t * if it is frozen because OOM killer wouldn't be able to free\n",
-  " \t * any memory and livelock. freezing_slow_path will tell the freezer\n",
-  "-\t * that TIF_MEMDIE tasks should be ignored.\n",
-  "+\t * that memdie tasks should be ignored.\n",
-  " \t */\n",
-  " \t__thaw_task(tsk);\n",
-  " \tatomic_inc(&oom_victims);\n",
-  "\@\@ -687,7 +687,7 \@\@ void mark_oom_victim(struct task_struct *tsk)\n",
-  "  */\n",
-  " void exit_oom_victim(struct task_struct *tsk)\n",
-  " {\n",
-  "-\tif (!test_and_clear_tsk_thread_flag(tsk, TIF_MEMDIE))\n",
-  "+\tif (!atomic_add_unless(&tsk->memdie, -1, 0))\n",
-  " \t\treturn;\n",
-  " \tatomic_dec(&tsk->signal->oom_victims);\n",
-  " \n",
-  "\@\@ -771,7 +771,7 \@\@ bool task_will_free_mem(struct task_struct *task)\n",
-  " \t * If the process has passed exit_mm we have to skip it because\n",
-  " \t * we have lost a link to other tasks sharing this mm, we do not\n",
-  " \t * have anything to reap and the task might then get stuck waiting\n",
-  "-\t * for parent as zombie and we do not want it to hold TIF_MEMDIE\n",
-  "+\t * for parent as zombie and we do not want it to hold memdie\n",
-  " \t */\n",
-  " \tp = find_lock_task_mm(task);\n",
-  " \tif (!p)\n",
-  "\@\@ -836,7 +836,7 \@\@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,\n",
-  " \n",
-  " \t/*\n",
-  " \t * If the task is already exiting, don't alarm the sysadmin or kill\n",
-  "-\t * its children or threads, just set TIF_MEMDIE so it can die quickly\n",
-  "+\t * its children or threads, just set memdie so it can die quickly\n",
-  " \t */\n",
-  " \tif (task_will_free_mem(p)) {\n",
-  " \t\tmark_oom_victim(p);\n",
-  "\@\@ -893,7 +893,7 \@\@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,\n",
-  " \tmm = victim->mm;\n",
-  " \tatomic_inc(&mm->mm_count);\n",
-  " \t/*\n",
-  "-\t * We should send SIGKILL before setting TIF_MEMDIE in order to prevent\n",
-  "+\t * We should send SIGKILL before setting memdie in order to prevent\n",
-  " \t * the OOM victim from depleting the memory reserves from the user\n",
-  " \t * space under its control.\n",
-  " \t */\n",
-  "\@\@ -1016,7 +1016,7 \@\@ bool out_of_memory(struct oom_control *oc)\n",
-  " \t * quickly exit and free its memory.\n",
-  " \t *\n",
-  " \t * But don't select if current has already released its mm and cleared\n",
-  "-\t * TIF_MEMDIE flag at exit_mm(), otherwise an OOM livelock may occur.\n",
-  "+\t * memdie flag at exit_mm(), otherwise an OOM livelock may occur.\n",
-  " \t */\n",
-  " \tif (current->mm && task_will_free_mem(current)) {\n",
-  " \t\tmark_oom_victim(current);\n",
-  "\@\@ -1096,7 +1096,7 \@\@ void pagefault_out_of_memory(void)\n",
-  " \t\t * be a racing OOM victim for which oom_killer_disable()\n",
-  " \t\t * is waiting for.\n",
-  " \t\t */\n",
-  "-\t\tWARN_ON(test_thread_flag(TIF_MEMDIE));\n",
-  "+\t\tWARN_ON(atomic_read(&current->memdie));\n",
-  " \t}\n",
-  " \n",
-  " \tmutex_unlock(&oom_lock);\n",
-  "diff --git a/mm/page_alloc.c b/mm/page_alloc.c\n",
-  "index 89128d64d662..6c550afde6a4 100644\n",
-  "--- a/mm/page_alloc.c\n",
-  "+++ b/mm/page_alloc.c\n",
-  "\@\@ -3050,7 +3050,7 \@\@ void warn_alloc_failed(gfp_t gfp_mask, unsigned int order, const char *fmt, ...)\n",
-  " \t * of allowed nodes.\n",
-  " \t */\n",
-  " \tif (!(gfp_mask & __GFP_NOMEMALLOC))\n",
-  "-\t\tif (test_thread_flag(TIF_MEMDIE) ||\n",
-  "+\t\tif (atomic_read(&current->memdie) ||\n",
-  " \t\t    (current->flags & (PF_MEMALLOC | PF_EXITING)))\n",
-  " \t\t\tfilter &= ~SHOW_MEM_FILTER_NODES;\n",
-  " \tif (in_interrupt() || !(gfp_mask & __GFP_DIRECT_RECLAIM))\n",
-  "\@\@ -3428,7 +3428,7 \@\@ gfp_to_alloc_flags(gfp_t gfp_mask)\n",
-  " \t\t\talloc_flags |= ALLOC_NO_WATERMARKS;\n",
-  " \t\telse if (!in_interrupt() &&\n",
-  " \t\t\t\t((current->flags & PF_MEMALLOC) ||\n",
-  "-\t\t\t\t unlikely(test_thread_flag(TIF_MEMDIE))))\n",
-  "+\t\t\t\t unlikely(atomic_read(&current->memdie))))\n",
-  " \t\t\talloc_flags |= ALLOC_NO_WATERMARKS;\n",
-  " \t}\n",
-  " #ifdef CONFIG_CMA\n",
-  "\@\@ -3637,7 +3637,7 \@\@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,\n",
-  " \t}\n",
-  " \n",
-  " \t/* Avoid allocations with no watermarks from looping endlessly */\n",
-  "-\tif (test_thread_flag(TIF_MEMDIE) && !(gfp_mask & __GFP_NOFAIL))\n",
-  "+\tif (atomic_read(&current->memdie) && !(gfp_mask & __GFP_NOFAIL))\n",
-  " \t\tgoto nopage;\n",
-  " \n",
-  " \t/*\n",
-  "-- \n",
-  "2.8.1\n",
-  "\n",
-  "-- \n",
-  "Michal Hocko\n",
-  "SUSE Labs"
+  "---"
 ]
 
-39abdaed444f4e9c9f5d49c7b0b2c43ef3e9cc265e668540ee44d2f98515cab9
+206c7648ea46499b3426db3f6a3fb96cfe90b95c6e20ce305e4935370818759c

diff --git a/a/content_digest b/N3/content_digest
index 484d839..43e737e 100644
--- a/a/content_digest
+++ b/N3/content_digest
@@ -32,7 +32,7 @@
   "From\0Michal Hocko <mhocko\@kernel.org>\0"
 ]
 [
-  "Subject\0Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core)\0"
+  "Subject\0[kernel-hardening] Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core)\0"
 ]
 [
   "Date\0Fri, 24 Jun 2016 17:06:37 +0200\0"
@@ -846,4 +846,4 @@
   "SUSE Labs"
 ]
 
-39abdaed444f4e9c9f5d49c7b0b2c43ef3e9cc265e668540ee44d2f98515cab9
+6cd34b0e1dd6cda7c88fa8da649a666b10d535786a8de2c793fc7b11778d4a43

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.