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 > If you have workloads that have page_mapping != NULL then look at > another series to optimze that. Looks a bit large though given the > number of places implementing set_page_dirty > Yes. I don't have a particular workload, was just wondering what you had in mind, as at a glance, changing all the places without messing filesystems looks like the subject of a separate series. > I think the current reality is calling set_page_dirty on an actual > file system is busted anyhow, so I think mapping is generally going to > be NULL here? Perhaps -- I'll have to check. Joao