On Thu, Mar 10, 2022 at 12:17 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote: > > On Thu, Mar 10, 2022 at 11:26:15AM -0800, David Rientjes wrote: > > One concern might be the queueing of read locks needed for page faults > > behind a collapser of a long range of memory that is otherwise looping > > and repeatedly taking the write lock. > > I would have thought that _not_ batching would improve this situation. > Unless our implementation of rwsems has changed since the last time I > looked, dropping-and-reacquiring a rwsem while there are pending readers > means you go to the end of the line and they all get to handle their > page faults. > Hey Matthew, thanks for the review / feedback. I don't have great intuition here, so I'll try to put together a simple synthetic test to get some data. Though the code would be different, I can functionally approximate a non-batched approach with a batch size of 1, and compare that against N. My file-backed patches likewise weren't able to take advantage of batching outside mmap lock contention, so the data should equally apply there.