OpenVZ Forum


Home » Mailing lists » Devel » + remove-the-likelypid-check-in-copy_process.patch added to -mm tree
+ remove-the-likelypid-check-in-copy_process.patch added to -mm tree [message #17837] Thu, 15 March 2007 19:54 Go to previous message
akpm is currently offline  akpm
Messages: 224
Registered: March 2007
Senior Member
The patch titled
     Remove the likely(pid) check in copy_process
has been added to the -mm tree.  Its filename is
     remove-the-likelypid-check-in-copy_process.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: Remove the likely(pid) check in copy_process
From: Sukadev Bhattiprolu <sukadev@us.ibm.com>

Now that we pass in a struct pid parameter to copy_process() and even the
swapper (pid_t == 0) has a valid struct pid, we no longer need this check.

Changelog:
	Per Eric Biederman's comments, moved this out to a separate
	patch for easier review.

Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: <containers@lists.osdl.org>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/fork.c |   34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff -puN kernel/fork.c~remove-the-likelypid-check-in-copy_process kernel/fork.c
--- a/kernel/fork.c~remove-the-likelypid-check-in-copy_process
+++ a/kernel/fork.c
@@ -1237,26 +1237,24 @@ static struct task_struct *copy_process(
 		}
 	}
 
-	if (likely(p->pid)) {
-		add_parent(p);
-		tracehook_init_task(p);
-
-		if (thread_group_leader(p)) {
-			pid_t pgid = process_group(current);
-			pid_t sid = process_session(current);
-
-			p->signal->tty = current->signal->tty;
-			p->signal->pgrp = pgid;
-			set_signal_session(p->signal, process_session(current));
-			attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
-			attach_pid(p, PIDTYPE_SID, find_pid(sid));
+	add_parent(p);
+	tracehook_init_task(p);
 
-			list_add_tail_rcu(&p->tasks, &init_task.tasks);
-			__get_cpu_var(process_counts)++;
-		}
-		attach_pid(p, PIDTYPE_PID, pid);
-		nr_threads++;
+	if (thread_group_leader(p)) {
+		pid_t pgid = process_group(current);
+		pid_t sid = process_session(current);
+
+		p->signal->tty = current->signal->tty;
+		p->signal->pgrp = pgid;
+		set_signal_session(p->signal, process_session(current));
+		attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
+		attach_pid(p, PIDTYPE_SID, find_pid(sid));
+
+		list_add_tail_rcu(&p->tasks, &init_task.tasks);
+		__get_cpu_var(process_counts)++;
 	}
+	attach_pid(p, PIDTYPE_PID, pid);
+	nr_threads++;
 
 	total_forks++;
 	spin_unlock(&current->sighand->siglock);
_

Patches currently in -mm which might be from sukadev@us.ibm.com are

attach_pid-with-struct-pid-parameter.patch
statically-initialize-struct-pid-for-swapper.patch
explicitly-set-pgid-and-sid-of-init-process.patch
use-struct-pid-parameter-in-copy_process.patch
remove-the-likelypid-check-in-copy_process.patch
use-task_pgrp-task_session-in-copy_process.patch
kill-unused-sesssion-and-group-values-in-rocket-driver.patch
fix-some-coding-style-errors-in-autofs.patch
replace-pid_t-in-autofs-with-struct-pid-reference.patch

_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: [ckrm-tech] [PATCH 0/2] resource control file system - aka containers on top of nsproxy!
Next Topic: [PATCH 2/2] fs: incorrect direct io error handling v8
Goto Forum:
  


Current Time: Tue Oct 15 01:25:27 GMT 2024

Total time taken to generate the page: 0.05168 seconds