Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751767AbWA0NR1 (ORCPT ); Fri, 27 Jan 2006 08:17:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750907AbWA0NQ6 (ORCPT ); Fri, 27 Jan 2006 08:16:58 -0500 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:1222 "EHLO ebiederm.dsl.xmission.com") by vger.kernel.org with ESMTP id S1750883AbWA0NQ5 (ORCPT ); Fri, 27 Jan 2006 08:16:57 -0500 To: Kyle Moffett Cc: Herbert Poetzl , Arjan van de Ven , Hubertus Franke , Dave Hansen , Greg KH , Alan Cox , "Serge E. Hallyn" , linux-kernel@vger.kernel.org, Cedric Le Goater Subject: Re: RFC [patch 13/34] PID Virtualization Define new task_pid api References: <1137518714.5526.8.camel@localhost.localdomain> <20060118045518.GB7292@kroah.com> <1137601395.7850.9.camel@localhost.localdomain> <43D14578.6060801@watson.ibm.com> <1137945325.3328.17.camel@laptopd505.fenrus.org> <20060126200142.GB20473@MAIL.13thfloor.at> <64FD72B7-91BF-4FEF-A595-0978F361A581@mac.com> From: ebiederm@xmission.com (Eric W. Biederman) Date: Fri, 27 Jan 2006 06:15:50 -0700 In-Reply-To: <64FD72B7-91BF-4FEF-A595-0978F361A581@mac.com> (Kyle Moffett's message of "Fri, 27 Jan 2006 07:27:43 -0500") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) 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 Content-Length: 1666 Lines: 39 Kyle Moffett writes: > On Jan 27, 2006, at 04:04, Eric W. Biederman wrote: >> Basically my concern is that by using task structs internally the kernel will >> start collecting invisible zombies. > > So come up with a task_struct weakref system. Maintain an (RCU?) linked list > of struct task_weakref in the struct task_struct, and when the task struct is > about to go away, run around all of the weakrefs and change their pointers to > NULL. The user of the weakref should check if the pointer is NULL and handle > accordingly. Sure, it would be tricky to get the locking right, but a couple > extra bytes for a struct task_weakref would be a lot better than a whole pinned > struct task_struct. Right. I'm working on it. Somehow it was lodged in my mind that a task_struct cannot represent a process group, but it can obviously be the first in a link list. Because of that I so far I have been approaching the weak reference problem from the pid hash table side. While using pid hash tables can come out fairly clean, my best solution so far doubled the size of the pid hash table. I have two things that still concern me. - The size of the linked list in pathological cases. - Consistently picking a leader for a process group. But I don't know if either one of them will actually be a problem, so I think I will walk down that implementation path and see where it takes me. Eric - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/