Message ID | 20210212130843.13865-1-joao.m.martins@oracle.com (mailing list archive) |
---|---|
Headers | show |
Series | mm/gup: page unpining improvements | expand |
On Fri, Feb 12, 2021 at 01:08:39PM +0000, Joao Martins wrote: > Hey, > > This series improves page unpinning, with an eye on improving MR > deregistration for big swaths of memory (which is bound by the page > unpining), particularly: Can you also take a look at the (bdev and iomap) direct I/O code to make use of this? It should really help there, with a much wieder use than RDMA.
On 2/18/21 7:24 AM, Christoph Hellwig wrote: > On Fri, Feb 12, 2021 at 01:08:39PM +0000, Joao Martins wrote: >> Hey, >> >> This series improves page unpinning, with an eye on improving MR >> deregistration for big swaths of memory (which is bound by the page >> unpining), particularly: > > Can you also take a look at the (bdev and iomap) direct I/O code to > make use of this? It should really help there, with a much wieder use > than RDMA. > Perhaps by bdev and iomap direct I/O using this, you were thinking to replace bio_release_pages() which operates on bvecs and hence releasing contiguous pages in a bvec at once? e.g. something like from this: bio_for_each_segment_all(bvec, bio, iter_all) { if (mark_dirty && !PageCompound(bvec->bv_page)) set_page_dirty_lock(bvec->bv_page); put_page(bvec->bv_page); } (...) to this instead: bio_for_each_bvec_all(bvec, bio, i) unpin_user_page_range_dirty_lock(bvec->bv_page, DIV_ROUND_UP(bvec->bv_len, PAGE_SIZE), mark_dirty && !PageCompound(bvec->bv_page));
On 2/18/21 3:33 PM, Joao Martins wrote: > On 2/18/21 7:24 AM, Christoph Hellwig wrote: >> On Fri, Feb 12, 2021 at 01:08:39PM +0000, Joao Martins wrote: >>> Hey, >>> >>> This series improves page unpinning, with an eye on improving MR >>> deregistration for big swaths of memory (which is bound by the page >>> unpining), particularly: >> >> Can you also take a look at the (bdev and iomap) direct I/O code to >> make use of this? It should really help there, with a much wieder use >> than RDMA. >> > Perhaps by bdev and iomap direct I/O using this, you were thinking to replace > bio_release_pages() which operates on bvecs and hence releasing contiguous pages > in a bvec at once? e.g. something like from this: > > bio_for_each_segment_all(bvec, bio, iter_all) { > if (mark_dirty && !PageCompound(bvec->bv_page)) > set_page_dirty_lock(bvec->bv_page); > put_page(bvec->bv_page); > } > > (...) to this instead: > > bio_for_each_bvec_all(bvec, bio, i) > unpin_user_page_range_dirty_lock(bvec->bv_page, > DIV_ROUND_UP(bvec->bv_len, PAGE_SIZE), > mark_dirty && !PageCompound(bvec->bv_page)); > Quick correction: It should be put_user_page_range_dirty_lock() given that unpin is specific to FOLL_PIN users.
On Thu, Feb 18, 2021 at 03:33:39PM +0000, Joao Martins wrote: > in a bvec at once? e.g. something like from this: > > bio_for_each_segment_all(bvec, bio, iter_all) { > if (mark_dirty && !PageCompound(bvec->bv_page)) > set_page_dirty_lock(bvec->bv_page); > put_page(bvec->bv_page); > } > > (...) to this instead: > > bio_for_each_bvec_all(bvec, bio, i) > unpin_user_page_range_dirty_lock(bvec->bv_page, > DIV_ROUND_UP(bvec->bv_len, PAGE_SIZE), > mark_dirty && !PageCompound(bvec->bv_page)); Yes, like that modulo the fix in your reply and any other fixes.