Re: [PATCH/RFC G-U-P experts] IB/umem: Modernize our get_user_pages() parameters

2012-01-26 Thread Hugh Dickins
On Wed, 25 Jan 2012, Roland Dreier wrote: > From: Roland Dreier > > Right now, we always pass write==1 to get_user_pages(), even when we > only intend to read the memory. We pass force==1 if we're going for > read-only and force==0 if we want writable. The reasoning behind this > seems to be co

Re: [PATCH/RFC G-U-P experts] IB/umem: Modernize our get_user_pages() parameters

2012-01-27 Thread Hugh Dickins
On Thu, 26 Jan 2012, Roland Dreier wrote: > > Thanks for the thoughtful answer... But I should have paid more attention to reading what you had written. In particular to: > > > This patch comes from me trying to do userspace RDMA on a memory > > > region exported from a character driver and mapp

Re: [PATCH/RFC G-U-P experts] IB/umem: Modernize our get_user_pages() parameters

2012-01-27 Thread Hugh Dickins
On Fri, 27 Jan 2012, Roland Dreier wrote: > > Sigh, what a mess ... it seems what we really want to do is know > > if userspace might trigger a COW because or not, and only do a > > preemptive COW in that case.  (We're not really concerned with > > userspace fork()ing and setting up a COW in the f

Re: [PATCH/RFC G-U-P experts] IB/umem: Modernize our get_user_pages() parameters

2012-01-30 Thread Hugh Dickins
On Mon, 30 Jan 2012, Roland Dreier wrote: > On Fri, Jan 27, 2012 at 6:19 PM, Hugh Dickins wrote: > >> > > This patch comes from me trying to do userspace RDMA on a memory > >> > > region exported from a character driver and mapped with > >> > &

Re: [PATCH/RFC G-U-P experts] IB/umem: Modernize our get_user_pages() parameters

2012-02-07 Thread Hugh Dickins
On Mon, 6 Feb 2012, Roland Dreier wrote: > Sorry for the slow reply, I got caught in other business... Negative problem! > > On Mon, Jan 30, 2012 at 12:34 PM, Hugh Dickins wrote: > > The hardest part about implementing that is deciding what snappy > > name to give the

Re: [PATCH/RFC G-U-P experts] IB/umem: Modernize our get_user_pages() parameters

2012-02-08 Thread Hugh Dickins
On Tue, 7 Feb 2012, Hugh Dickins wrote: > On Mon, 6 Feb 2012, Roland Dreier wrote: > > Which I think explains why the code is the way it is. But clearly > > we could do better if we had a better way of telling GUP our real > > intentions -- ie the FOLL_READONLY_COW flag. >

Re: [PATCH/RFC G-U-P experts] IB/umem: Modernize our get_user_pages() parameters

2012-02-09 Thread Hugh Dickins
On Thu, 9 Feb 2012, Roland Dreier wrote: > On Wed, Feb 8, 2012 at 3:10 PM, Hugh Dickins wrote: > > A doubt assaulted me overnight: sorry, I'm back to not understanding. > > > > What are these access flags passed into ibv_reg_mr() that are enforced? > > What relati

[PATCH] mm: get_user_pages(write,force) refuse to COW in shared areas

2014-04-04 Thread Hugh Dickins
he same: I'd be more likely to screw up NOMMU than make an improvement there. Suggested-by: Linus Torvalds Signed-off-by: Hugh Dickins --- You suggested something like this in the LKML discussion of 887843961c4b and "bad rss-counter message in 3.14rc5" on March 18th, and I agre

Re: [PATCH] mm: get_user_pages(write,force) refuse to COW in shared areas

2014-04-04 Thread Hugh Dickins
On Fri, 4 Apr 2014, Kirill A. Shutemov wrote: > > There's comment in do_wp_page() which is not true anymore with patch > applied. It should be fixed. The * Only catch write-faults on shared writable pages, * read-only shared pages can get COWed by * get_user_pages(.write=1, .force=1). Ye

Re: [PATCH] mm: get_user_pages(write,force) refuse to COW in shared areas

2014-04-24 Thread Hugh Dickins
hat should I write in the > changelog. Thanks a lot for considering similar issues in uprobes, Oleg: I merely checked that its uses of get_user_pages() would not be problematic, and didn't look around to rediscover the worrying mm business that goes on down there in kernel/events. >

Re: [PATCH] mm: get_user_pages(write,force) refuse to COW in shared areas

2014-04-25 Thread Hugh Dickins
On Fri, 25 Apr 2014, Oleg Nesterov wrote: > > And I forgot to mention, there is another reason why I would like to > change uprobes to follow the same convention. I still think it would > be better to kill __replace_page() and use gup(FOLL_WRITE | FORCE) > in uprobe_write_opcode(). Oh, please ple