From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: [PATCH 4/5] pid: use namespaced iteration on processes while sending signal to all Date: Thu, 18 Dec 2008 11:04:59 -0600 Message-ID: <20081218170459.GB13188@us.ibm.com> References: <1229618553-6348-1-git-send-email-gowrishankar.m@linux.vnet.ibm.com> <1229618553-6348-5-git-send-email-gowrishankar.m@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1229618553-6348-5-git-send-email-gowrishankar.m-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Gowrishankar M Cc: Containers , Dave , Eric , Sukadev , Balbir List-Id: containers.vger.kernel.org Quoting Gowrishankar M (gowrishankar.m-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org): > From: Gowrishankar M > > At present we scan all processes in init namespace, whether in new namespace > or not, to send signal to all processes for container. Also we filter out > processes belonging to same namespace using task_pid_vnr(). > > Below patch proposes to use new macro controller to save time using pidmap. > In init namespace, this saving can be more or less achieved, as we check to > take every process with task_pid_vnr() otherwise. > > Signed-off-by: Gowrishankar M Acked-by: Serge Hallyn > --- > kernel/signal.c | 5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/kernel/signal.c b/kernel/signal.c > index 4530fc6..a2651bc 100644 > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@ -1143,9 +1143,8 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid) > int retval = 0, count = 0; > struct task_struct * p; > > - for_each_process(p) { > - if (task_pid_vnr(p) > 1 && > - !same_thread_group(p, current)) { > + for_each_process_in_ns(p, current->nsproxy->pid_ns) { > + if (!same_thread_group(p, current)) { > int err = group_send_sig_info(sig, info, p); > ++count; > if (err != -EPERM) > -- > 1.5.5.1