Re: Freeing page tables through RCU

2021-02-26 Thread Jason Gunthorpe
On Fri, Feb 26, 2021 at 04:03:54PM +, Matthew Wilcox wrote: > On Fri, Feb 26, 2021 at 10:42:00AM -0400, Jason Gunthorpe wrote: > > On Thu, Feb 25, 2021 at 08:58:20PM +, Matthew Wilcox wrote: > > > > > I'd like to hear better ideas than this. > > > > You didn't like my suggestion to put a

Re: Freeing page tables through RCU

2021-02-26 Thread Gerald Schaefer
On Thu, 25 Feb 2021 20:58:20 + Matthew Wilcox wrote: > In order to walk the page tables without the mmap semaphore, it must > be possible to prevent them from being freed and reused (eg if munmap() > races with viewing /proc/$pid/smaps). > > There is various commentary within the mm on how t

Re: Freeing page tables through RCU

2021-02-26 Thread Matthew Wilcox
On Fri, Feb 26, 2021 at 10:42:00AM -0400, Jason Gunthorpe wrote: > On Thu, Feb 25, 2021 at 08:58:20PM +, Matthew Wilcox wrote: > > > I'd like to hear better ideas than this. > > You didn't like my suggestion to put a sleepable lock around the > freeing of page tables during flushing? > > I s

Re: Freeing page tables through RCU

2021-02-26 Thread Jason Gunthorpe
On Thu, Feb 25, 2021 at 08:58:20PM +, Matthew Wilcox wrote: > I'd like to hear better ideas than this. You didn't like my suggestion to put a sleepable lock around the freeing of page tables during flushing? I still don't see how you convert the sleepable page walkers to use rcu?? Jason

Freeing page tables through RCU

2021-02-25 Thread Matthew Wilcox
In order to walk the page tables without the mmap semaphore, it must be possible to prevent them from being freed and reused (eg if munmap() races with viewing /proc/$pid/smaps). There is various commentary within the mm on how to prevent this. One way is to disable interrupts, relying on that to