On 12/17/20 12: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);
I think once should be enough. There is no counter for page dirtiness,
and this kind of accounting is always tracked in the head page, so there
is no reason to repeatedly call set_page_dirty() from the same
spot.
thanks,
--
John Hubbard
NVIDIA