[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080211101530.GA162@tv-sign.ru>
Date: Mon, 11 Feb 2008 13:15:30 +0300
From: Oleg Nesterov <oleg@...sign.ru>
To: Hugh Dickins <hugh@...itas.com>
Cc: Miklos Szeredi <mszeredi@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
William Lee Irwin III <wli@...omorphy.com>,
Nick Piggin <nickpiggin@...oo.com.au>,
Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
Matt Helsley <matthltc@...ibm.com>
Subject: Re: [PATCH] sys_remap_file_pages: fix ->vm_file accounting
Sorry for delay,
On 02/06, Hugh Dickins wrote:
>
> On Sun, 3 Feb 2008, Oleg Nesterov wrote:
> > Off-topic question to all. sys_remap_file_pages() doesn't work with
> > shared readonly mappings, why?
>
> Slight correction: it works with shared readonly mappings, doesn't
> it, so long as the mmap'ed file was opened for reading and writing?
Yes sure. I meant, if the file was opened without FMODE_WRITE, then
mmap(PROT_READ, MAP_SHARED) doesn't actually set VM_SHARED, it only
sets VM_MAYSHARE.
(this looks understandable, but means that !VM_SHARED doesn't necessary
imply the possible cow).
> > IOW, why it checks VM_SHARED but not VM_MAYSHARE?
>
> My guess has always been that it was just a misunderstanding of how
> those VM_ flags end up working: assume so unless Ingo corrects me.
>
> By the time I realized that oddity, we'd been driven into several
> tiresome corners by the very existence of sys_remap_file_pages.
> So whereas my usual instinct would have been to relax the restriction
> and generalize, in its case I wanted to hold on to every restriction
> we had.
OK, thanks a lot. I was afraid I missed some "obvious" reason why we
can't do this.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists