From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933254Ab2AKUAH (ORCPT ); Wed, 11 Jan 2012 15:00:07 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:8859 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757999Ab2AKUAD (ORCPT ); Wed, 11 Jan 2012 15:00:03 -0500 Message-ID: <4F0DE99B.3050803@parallels.com> Date: Wed, 11 Jan 2012 23:57:15 +0400 From: Pavel Emelyanov User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10 MIME-Version: 1.0 To: KOSAKI Motohiro CC: Cyrill Gorcunov , LKML , Andrew Morton , Kyle Moffett , Tejun Heo , Glauber Costa , Andi Kleen , Matt Helsley , Pekka Enberg , Eric Dumazet , Vasiliy Kulikov , Alexey Dobriyan , Herbert Xu , "David S. Miller" , "Eric W. Biederman" , Andrey Vagin Subject: Re: [RFC] on general object IDs again References: <20120111161939.GI8752@moon> <20120111175952.GI466@moon> <4F0DD365.6070200@parallels.com> <20120111183115.GA28196@moon> <4F0DE4B0.4070800@parallels.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/11/2012 11:50 PM, KOSAKI Motohiro wrote: >> This might work for mm_structs, although quite a lot apps now do have threads and >> this mm->users check will be negative. But how about open files? Once we entered the >> get-the-youngest-file-owner routine we need to take locks and with 1000 tasks the >> overhead is not 1000 syscalls, but 1000 (syscalls + locks). > > Unfortunately, I have no knowledge your program have what assumption > of file modify. When I reviewed mincore patch from you, you said you > assume any file are preserved. And If nobody change the files, why do > we need to care file locks? I have no knowledge a grand picture of > your design at all. By locking I mean the internal kernel locks that preserve kernel objects integrity. E.g. to check for a task's file (the struct file) being the one you're interested in you need to lock the task lock (call the task_lock(p)) in order to get the fdtable pointer. By the way, if you have a file and want to have its ID the complexity is not just O(N^2) for N tasks. For each task you should walk the whole fdtable which just makes things worse. That said, I'd stick to the IDs that are calculated out of the object pointer. Thanks, Pavel