Bleh, I'd forgotten about that problem. We really do need to keep
track of which pages are under I/O for this case, because we need to
tell the filesystem that they are now available for writeback.
That said, I don't know that we need to keep track of it in the
pages themselves. Can't we have something similar to rmap which
keeps track of a range of pinned pages, and have it taken care of
at a higher level (ie unpin the pages in the dio_iodone_t rather
than in the BIO completion handler)?
I'm not even sure why pinned pagecache pages remain on the LRU.
They should probably go onto the unevictable list with the mlocked
pages, then on unpin get marked dirty and placed on the active list.
There's no point in writing back a pinned page since it can be
written to at any instant without any part of the kernel knowing.