On Thu, Dec 17, 2020 at 10:34:54PM +0000, Joao Martins wrote: > On 12/17/20 8:05 PM, Jason Gunthorpe wrote: > > On Thu, Dec 17, 2020 at 07:05:37PM +0000, Joao Martins wrote: > >>> No reason not to fix set_page_dirty_lock() too while you are here. > >> > >> The wack of atomics you mentioned earlier you referred to, I suppose it > >> ends being account_page_dirtied(). See partial diff at the end. > > > > Well, even just eliminating the lock_page, page_mapping, PageDirty, > > etc is already a big win. > > > > If mapping->a_ops->set_page_dirty() needs to be called multiple times > > on the head page I'd probably just suggest: > > > > while (ntails--) > > rc |= (*spd)(head); > > > > At least as a start. > > > /me nods You might just be able to call it once as well, doesn't the page fault handler dirties an entire compound in one call? Someone from the FS world probably knows :) Good example of Matt's Folio concept lending clarity, if this accepted a folio we'd be certain it only need to be called once. Jason