From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295AbXCTLHZ (ORCPT ); Tue, 20 Mar 2007 07:07:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751299AbXCTLHZ (ORCPT ); Tue, 20 Mar 2007 07:07:25 -0400 Received: from mx1.redhat.com ([66.187.233.31]:55296 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295AbXCTLHY (ORCPT ); Tue, 20 Mar 2007 07:07:24 -0400 From: David Howells In-Reply-To: References: <3378.1173204813@redhat.com> <20070216165042.GB409@lnx-holt.americas.sgi.com> <45D5B483.3020502@hitachi.com> <45D5B2E3.3030607@hitachi.com> <20368.1171638335@redhat.com> <18817.1171656543@redhat.com> <29317.1172931029@redhat.com> <12852.1173449522@redhat.com> <12838.1173998825@redhat.com> To: ebiederm@xmission.com (Eric W. Biederman) Cc: Hugh Dickins , bryan.wu@analog.com, Robin Holt , "Kawai, Hidehiro" , Andrew Morton , kernel list , Pavel Machek , Alan Cox , Masami Hiramatsu , sugita , Satoshi OSHIMA , haoki@redhat.com, Robin Getz Subject: Re: Move to unshared VMAs in NOMMU mode? X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.0.50 Date: Tue, 20 Mar 2007 11:06:32 +0000 Message-ID: <11772.1174388792@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Eric W. Biederman wrote: > As I understand your description for non-shared mappings the VMAs are > per process. Are you talking about the current state of play? If so, not precisely. In the current scheme of things, *all* VMAs are kept in a global tree and are globally available; it's just that any VMA that's not shareable will not be shared, and so, in effect, is per-process. In my suggested revamp, VMAs revert to being per-process objects only, and sharing is effected by indirection. > For shared mappings you share in some sense the page cache. Currently, no - not unless the driver does something clever as ramfs does. Sharing through the page cache is a nice idea, but it has some limitations, mainly that non-sharing then operates differently. > My gut feel says just keep a vma per process of the regions the > process has and do the appropriate book keeping and all will be fine. I'm sure it will be, but at the cost of consuming extra memory. I'm not sure that the amount of extra memory is, however, all that significant. Now that I think about it, I don't imagine that a lot of processes are going to be running at once on a NOMMU system, and so the scope for sharing isn't all that wide. > For shm_nattach it looks like you simply are not calling the > open/close methods on fork (because you have a shared pool of vmas). There is no fork. No, the problem is that sys_shmat() relies on do_mmap_pgoff() to call the VMA open() method. However, this assumes that a new VMA will be made per process. David