- task-make-task-list-manipulations-rcu-safe.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     task: Make task list manipulations RCU safe

has been removed from the -mm tree.  Its filename is

     task-make-task-list-manipulations-rcu-safe.patch

This patch was probably dropped from -mm because
it has now been merged into a subsystem tree or
into Linus's tree, or because it was folded into
its parent patch in the -mm tree.


From: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>

While we can currently walk through thread groups, process groups, and
sessions with just the rcu_read_lock, this opens the door to walking the
entire task list.

We already have all of the other RCU guarantees so there is no cost in
doing this, this should be enough so that proc can stop taking the tasklist
lock during readdir.

prev_task was killed because it has no users, and using it will miss new
tasks when doing an rcu traversal.

Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/exec.c             |    2 +-
 include/linux/sched.h |    3 +--
 kernel/exit.c         |    2 +-
 kernel/fork.c         |    2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff -puN fs/exec.c~task-make-task-list-manipulations-rcu-safe fs/exec.c
--- devel/fs/exec.c~task-make-task-list-manipulations-rcu-safe	2006-04-18 22:19:57.000000000 -0700
+++ devel-akpm/fs/exec.c	2006-04-18 22:19:57.000000000 -0700
@@ -712,7 +712,7 @@ static int de_thread(struct task_struct 
 		attach_pid(current, PIDTYPE_PID,  current->pid);
 		attach_pid(current, PIDTYPE_PGID, current->signal->pgrp);
 		attach_pid(current, PIDTYPE_SID,  current->signal->session);
-		list_add_tail(&current->tasks, &init_task.tasks);
+		list_add_tail_rcu(&current->tasks, &init_task.tasks);
 
 		current->group_leader = current;
 		leader->group_leader = current;
diff -puN include/linux/sched.h~task-make-task-list-manipulations-rcu-safe include/linux/sched.h
--- devel/include/linux/sched.h~task-make-task-list-manipulations-rcu-safe	2006-04-18 22:19:57.000000000 -0700
+++ devel-akpm/include/linux/sched.h	2006-04-18 22:19:57.000000000 -0700
@@ -1192,8 +1192,7 @@ extern void wait_task_inactive(task_t * 
 #define remove_parent(p)	list_del_init(&(p)->sibling)
 #define add_parent(p)		list_add_tail(&(p)->sibling,&(p)->parent->children)
 
-#define next_task(p)	list_entry((p)->tasks.next, struct task_struct, tasks)
-#define prev_task(p)	list_entry((p)->tasks.prev, struct task_struct, tasks)
+#define next_task(p)	list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)
 
 #define for_each_process(p) \
 	for (p = &init_task ; (p = next_task(p)) != &init_task ; )
diff -puN kernel/exit.c~task-make-task-list-manipulations-rcu-safe kernel/exit.c
--- devel/kernel/exit.c~task-make-task-list-manipulations-rcu-safe	2006-04-18 22:19:57.000000000 -0700
+++ devel-akpm/kernel/exit.c	2006-04-18 22:19:57.000000000 -0700
@@ -56,7 +56,7 @@ static void __unhash_process(struct task
 		detach_pid(p, PIDTYPE_PGID);
 		detach_pid(p, PIDTYPE_SID);
 
-		list_del_init(&p->tasks);
+		list_del_rcu(&p->tasks);
 		__get_cpu_var(process_counts)--;
 	}
 	list_del_rcu(&p->thread_group);
diff -puN kernel/fork.c~task-make-task-list-manipulations-rcu-safe kernel/fork.c
--- devel/kernel/fork.c~task-make-task-list-manipulations-rcu-safe	2006-04-18 22:19:57.000000000 -0700
+++ devel-akpm/kernel/fork.c	2006-04-18 22:19:57.000000000 -0700
@@ -1204,7 +1204,7 @@ static task_t *copy_process(unsigned lon
 			attach_pid(p, PIDTYPE_PGID, process_group(p));
 			attach_pid(p, PIDTYPE_SID, p->signal->session);
 
-			list_add_tail(&p->tasks, &init_task.tasks);
+			list_add_tail_rcu(&p->tasks, &init_task.tasks);
 			__get_cpu_var(process_counts)++;
 		}
 		attach_pid(p, PIDTYPE_PID, p->pid);
_

Patches currently in -mm which might be from ebiederm@xxxxxxxxxxxx are

origin.patch
avoid-tasklist_lock-at-getrusage-for-multithreaded-case-too.patch
ptrace-document-the-locking-rules.patch
proc-fix-the-inode-number-on-proc-pid-fd.patch
proc-remove-useless-bkl-in-proc_pid_readlink.patch
proc-remove-unnecessary-and-misleading-assignments.patch
proc-simplify-the-ownership-rules-for-proc.patch
proc-replace-proc_inodetype-with-proc_inodefd.patch
proc-remove-bogus-proc_task_permission.patch
proc-kill-proc_mem_inode_operations.patch
proc-properly-filter-out-files-that-are-not-visible.patch
proc-fix-the-link-count-for-proc-pid-task.patch
proc-move-proc_maps_operations-into-task_mmuc.patch
proc-rewrite-the-proc-dentry-flush-on-exit.patch
proc-close-the-race-of-a-process-dying-durning.patch
proc-refactor-reading-directories-of-tasks.patch
proc-remove-tasklist_lock-from-proc_pid_readdir.patch
proc-remove-tasklist_lock-from-proc_pid_lookup-and.patch
proc-remove-tasklist_lock-from-proc_pid_readdir-simply-fix-first_tgid.patch
proc-make-proc_numbuf-the-buffer-size-for-holding-a.patch
proc-dont-lock-task_structs-indefinitely.patch
proc-use-struct-pid-not-struct-task_ref.patch
proc-optimize-proc_check_dentry_visible.patch
proc-use-sane-permission-checks-on-the-proc-pid-fd.patch
proc-cleanup-proc_fd_access_allowed.patch
proc-remove-tasklist_lock-from-proc_task_readdir.patch
simplify-fix-first_tid.patch
cleanup-next_tid.patch
coredump-optimize-mm-users-traversal.patch
coredump-speedup-sigkill-sending.patch
coredump-kill-ptrace-related-stuff.patch
coredump-dont-take-tasklist_lock.patch
pidhash-temporary-debug-checks.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux