block: add check when merging zone device pages
authorLogan Gunthorpe <logang@deltatee.com>
Fri, 21 Oct 2022 17:41:11 +0000 (11:41 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 9 Nov 2022 18:29:21 +0000 (11:29 -0700)
commit49580e690755d0e51ed7aa2c33225dd884fa738a
treea09c9ec77246bf13bf097bf31695bca11571435a
parentd82076403cef7fcd1e7617c9db48bf21ebdc1f9c
block: add check when merging zone device pages

Consecutive zone device pages should not be merged into the same sgl
or bvec segment with other types of pages or if they belong to different
pgmaps. Otherwise getting the pgmap of a given segment is not possible
without scanning the entire segment. This helper returns true either if
both pages are not zone device pages or both pages are zone device
pages with the same pgmap.

Add a helper to determine if zone device pages are mergeable and use
this helper in page_is_mergeable().

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20221021174116.7200-5-logang@deltatee.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
include/linux/mmzone.h