OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 5/5] Use task_pgrp() task_session() in copy_process()
[PATCH 5/5] Use task_pgrp() task_session() in copy_process() [message #17543] Thu, 01 March 2007 03:59
Sukadev Bhattiprolu is currently offline  Sukadev Bhattiprolu
Messages: 413
Registered: August 2006
Senior Member
From: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Subject: [PATCH 5/5] Use task_pgrp() task_session() in copy_process().

Use task_pgrp() and task_session() in copy_process(), and
avoid find_pid() call when attaching the task to its process
group and session.

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
---
 kernel/fork.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Index: lx26-20-mm2c/kernel/fork.c
===================================================================
--- lx26-20-mm2c.orig/kernel/fork.c	2007-02-28 17:29:18.000000000 -0800
+++ lx26-20-mm2c/kernel/fork.c	2007-02-28 19:23:33.000000000 -0800
@@ -1253,14 +1253,11 @@ static struct task_struct *copy_process(
 	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;
+		p->signal->pgrp = process_group(current);
 		set_signal_session(p->signal, process_session(current));
-		attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
-		attach_pid(p, PIDTYPE_SID, find_pid(sid));
+		attach_pid(p, PIDTYPE_PGID, task_pgrp(current));
+		attach_pid(p, PIDTYPE_SID, task_session(current));
 
 		list_add_tail_rcu(&p->tasks, &init_task.tasks);
 		__get_cpu_var(process_counts)++;
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
 
Read Message
Previous Topic: [PATCH 4/5] Remove the likely(pid) check in copy_process
Next Topic: [PATCH] pidspace rocket driver
Goto Forum:
  


Current Time: Wed Aug 13 20:32:25 GMT 2025

Total time taken to generate the page: 0.27413 seconds