From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751663AbXCSSye (ORCPT ); Mon, 19 Mar 2007 14:54:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751659AbXCSSye (ORCPT ); Mon, 19 Mar 2007 14:54:34 -0400 Received: from x35.xmailserver.org ([64.71.152.41]:50837 "EHLO x35.xmailserver.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751638AbXCSSyd (ORCPT ); Mon, 19 Mar 2007 14:54:33 -0400 X-AuthUser: davidel@xmailserver.org Date: Mon, 19 Mar 2007 11:53:02 -0700 (PDT) From: Davide Libenzi X-X-Sender: davide@alien.or.mcafeemobile.com To: "Eric W. Biederman" cc: Linux Kernel Mailing List , Andrew Morton , Linus Torvalds , Oleg Nesterov Subject: Re: [patch 2/13] signal/timer/event fds v6 - signalfd core ... In-Reply-To: Message-ID: References: X-GPG-FINGRPRINT: CFAE 5BEE FD36 F65E E640 56FE 0974 BF23 270F 474E X-GPG-PUBLIC_KEY: http://www.xmailserver.org/davidel.asc MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Mar 2007, Eric W. Biederman wrote: > Davide Libenzi writes: > > > struct signalfd_siginfo { > > __u32 signo; /* si_signo */ > > __s32 err; /* si_errno */ > > __s32 code; /* si_code */ > > __u32 pid; /* si_pid */ > > __u32 uid; /* si_uid */ > > __s32 fd; /* si_fd */ > > __u32 tid; /* si_fd */ > > __u32 band; /* si_band */ > > __u32 overrun; /* si_overrun */ > > __u32 trapno; /* si_trapno */ > > __s32 status; /* si_status */ > > __s32 svint; /* si_int */ > > __u64 svptr; /* si_ptr */ > > __u64 utime; /* si_utime */ > > __u64 stime; /* si_stime */ > > __u64 addr; /* si_addr */ > > }; > > Shouldn't we pad this to 128 bytes like we do siginfo in case there are > more fields we need to include, or we need to extend the size of some > field? Yes, I guess we can. > I'm tempted to suggest we have a per arch function that tests current > to see if we are in a compat process or not so we can just use > siginfo. But that is probably overkill. > > > + > > + > > +struct signalfd_ctx { > > + struct list_head lnk; > > + wait_queue_head_t wqh; > > + sigset_t sigmask; > > + struct task_struct *tsk; > > +}; > > I think you want to use a struct pid *pid instead of a pointer to the > task struct here. It is slightly less efficient (one more > dereference) but it means that we won't pin the task struct in memory > indefinitely. Pinning the task_struct like this makes for a very > interesting way to get around the limits on the number of processes a > user can have. Hmm, when the task is detached from the sighand, we get a notify, so I could do a put from there. This would avoid the extra de-reference. I need to verify locking though ... - Davide