Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261151AbUKVWjp (ORCPT ); Mon, 22 Nov 2004 17:39:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261155AbUKVWgR (ORCPT ); Mon, 22 Nov 2004 17:36:17 -0500 Received: from smtp205.mail.sc5.yahoo.com ([216.136.129.95]:24977 "HELO smtp205.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261151AbUKVWcx (ORCPT ); Mon, 22 Nov 2004 17:32:53 -0500 Message-ID: <41A26910.7090401@yahoo.com.au> Date: Tue, 23 Nov 2004 09:32:48 +1100 From: Nick Piggin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Linus Torvalds CC: Christoph Lameter , Hugh Dickins , akpm@osdl.org, Benjamin Herrenschmidt , linux-mm@kvack.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: deferred rss update instead of sloppy rss References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1273 Lines: 34 Linus Torvalds wrote: > > On Mon, 22 Nov 2004, Christoph Lameter wrote: > >>The problem is then that the proc filesystem must do an extensive scan >>over all threads to find users of a certain mm_struct. > > > The alternative is to just add a simple list into the task_struct and the > head of it into mm_struct. Then, at fork, you just finish the fork() with > > list_add(p->mm_list, p->mm->thread_list); > > and do the proper list_del() in exit_mm() or wherever. > > You'll still loop in /proc, but you'll do the minimal loop necessary. > Yes, that was what I was thinking we'd have to resort to. Not a bad idea. It would be nice if you could have it integrated with the locking that is already there - for example mmap_sem, although that might mean you'd have to take mmap_sem for writing which may limit scalability of thread creation / destruction... maybe a seperate lock / semaphore for that list itself would be OK. Deferred rss might be a practical solution, but I'd prefer this if it can be made workable. - 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/