Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-31 Thread Andrew Morton
On Wed, 31 Mar 2021 16:49:27 +0200 Michal Hocko wrote: > > Thanks for the clarification! I have suspected this to be the case but > > I am not really familiar with the interface to have any strong statement > > here. Maybe we want to document this explicitly. > > Btw. Andrew the patch still

Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-31 Thread Michal Hocko
On Mon 22-03-21 14:49:35, Michal Hocko wrote: > On Mon 22-03-21 15:00:37, Mike Rapoport wrote: > > On Mon, Mar 22, 2021 at 11:14:37AM +0100, Michal Hocko wrote: > > > Le'ts Andrea and Mike > > > > > > On Fri 19-03-21 22:24:28, Bui Quang Minh wrote: > > > > userfaultfd_writeprotect() use

Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-23 Thread Peter Xu
On Tue, Mar 23, 2021 at 09:48:03AM +0700, Bui Quang Minh wrote: > On Mon, Mar 22, 2021 at 03:00:37PM +0200, Mike Rapoport wrote: > > On Mon, Mar 22, 2021 at 11:14:37AM +0100, Michal Hocko wrote: > > > Le'ts Andrea and Mike > > > > > > On Fri 19-03-21 22:24:28, Bui Quang Minh wrote: > > > >

Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-22 Thread Bui Quang Minh
On Mon, Mar 22, 2021 at 03:00:37PM +0200, Mike Rapoport wrote: > On Mon, Mar 22, 2021 at 11:14:37AM +0100, Michal Hocko wrote: > > Le'ts Andrea and Mike > > > > On Fri 19-03-21 22:24:28, Bui Quang Minh wrote: > > > userfaultfd_writeprotect() use change_protection() to clear write bit in > > >

Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-22 Thread Michal Hocko
On Mon 22-03-21 15:00:37, Mike Rapoport wrote: > On Mon, Mar 22, 2021 at 11:14:37AM +0100, Michal Hocko wrote: > > Le'ts Andrea and Mike > > > > On Fri 19-03-21 22:24:28, Bui Quang Minh wrote: > > > userfaultfd_writeprotect() use change_protection() to clear write bit in > > > page table entries

Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-22 Thread Peter Xu
On Mon, Mar 22, 2021 at 03:00:37PM +0200, Mike Rapoport wrote: > On Mon, Mar 22, 2021 at 11:14:37AM +0100, Michal Hocko wrote: > > Le'ts Andrea and Mike > > > > On Fri 19-03-21 22:24:28, Bui Quang Minh wrote: > > > userfaultfd_writeprotect() use change_protection() to clear write bit in > > >

Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-22 Thread Mike Rapoport
On Mon, Mar 22, 2021 at 11:14:37AM +0100, Michal Hocko wrote: > Le'ts Andrea and Mike > > On Fri 19-03-21 22:24:28, Bui Quang Minh wrote: > > userfaultfd_writeprotect() use change_protection() to clear write bit in > > page table entries (pte/pmd). So, later write to this virtual address > >

Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-22 Thread Mike Rapoport
+Peter On Mon, Mar 22, 2021 at 11:14:37AM +0100, Michal Hocko wrote: > Le'ts Andrea and Mike > > On Fri 19-03-21 22:24:28, Bui Quang Minh wrote: > > userfaultfd_writeprotect() use change_protection() to clear write bit in > > page table entries (pte/pmd). So, later write to this virtual address

Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-22 Thread Michal Hocko
Le'ts Andrea and Mike On Fri 19-03-21 22:24:28, Bui Quang Minh wrote: > userfaultfd_writeprotect() use change_protection() to clear write bit in > page table entries (pte/pmd). So, later write to this virtual address > range causes a page fault, which is then handled by userspace program. >

Re: [PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-20 Thread Andrew Morton
On Fri, 19 Mar 2021 22:24:28 +0700 Bui Quang Minh wrote: > userfaultfd_writeprotect() use change_protection() to clear write bit in > page table entries (pte/pmd). So, later write to this virtual address > range causes a page fault, which is then handled by userspace program. > However,

[PATCH] userfaultfd: Write protect when virtual memory range has no page table entry

2021-03-19 Thread Bui Quang Minh
userfaultfd_writeprotect() use change_protection() to clear write bit in page table entries (pte/pmd). So, later write to this virtual address range causes a page fault, which is then handled by userspace program. However, change_protection() has no effect when there is no page table entries