linux/include
Oleg Nesterov 246bb0b1de kill PF_BORROWED_MM in favour of PF_KTHREAD
Kill PF_BORROWED_MM.  Change use_mm/unuse_mm to not play with ->flags, and
do s/PF_BORROWED_MM/PF_KTHREAD/ for a couple of other users.

No functional changes yet.  But this allows us to do further
fixes/cleanups.

oom_kill/ptrace/etc often check "p->mm != NULL" to filter out the
kthreads, this is wrong because of use_mm().  The problem with
PF_BORROWED_MM is that we need task_lock() to avoid races.  With this
patch we can check PF_KTHREAD directly, or use a simple lockless helper:

	/* The result must not be dereferenced !!! */
	struct mm_struct *__get_task_mm(struct task_struct *tsk)
	{
		if (tsk->flags & PF_KTHREAD)
			return NULL;
		return tsk->mm;
	}

Note also ecard_task().  It runs with ->mm != NULL, but it's the kernel
thread without PF_BORROWED_MM.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-25 10:53:39 -07:00
..
acpi
asm-alpha clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-arm include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-avr32 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-blackfin include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-cris include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-frv include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-generic gpiolib: allow user-selection 2008-07-25 10:53:30 -07:00
asm-h8300 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-ia64 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-m32r clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-m68k clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-m68knommu include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-mips gpiolib: allow user-selection 2008-07-25 10:53:30 -07:00
asm-mn10300 include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-parisc include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-powerpc include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-s390 clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-sh include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-sparc clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-sparc64
asm-um clean up duplicated alloc/free_thread_info 2008-07-25 10:53:28 -07:00
asm-v850
asm-x86 include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
asm-xtensa include/asm/ptrace.h userspace headers cleanup 2008-07-25 10:53:39 -07:00
crypto
drm
keys
linux kill PF_BORROWED_MM in favour of PF_KTHREAD 2008-07-25 10:53:39 -07:00
math-emu
media
mtd
net
pcmcia
rdma
rxrpc
scsi
sound
video
xen
Kbuild