Re: [PATCH 04/12] mm: add support for async page locking
From: Johannes Weiner
Date: Tue May 26 2020 - 17:59:53 EST
On Tue, May 26, 2020 at 01:51:15PM -0600, Jens Axboe wrote:
> Normally waiting for a page to become unlocked, or locking the page,
> requires waiting for IO to complete. Add support for lock_page_async()
> and wait_on_page_locked_async(), which are callback based instead. This
wait_on_page_locked_async() is actually in the next patch, requiring
some back and forth to review. I wonder if this and the next patch
could be merged to have the new API and callers introduced together?
> allows a caller to get notified when a page becomes unlocked, rather
> than wait for it.
> We add a new iocb field, ki_waitq, to pass in the necessary data for this
> to happen. We can unionize this with ki_cookie, since that is only used
> for polled IO. Polled IO can never co-exist with async callbacks, as it is
> (by definition) polled completions. struct wait_page_key is made public,
> and we define struct wait_page_async as the interface between the caller
> and the core.
> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>