On Sat, Nov 02, 2024 at 08:39:35AM +0100, Zhu Yanjun wrote: > 在 2024/10/27 15:21, Leon Romanovsky 写道: > > From: Christoph Hellwig <hch@xxxxxx> > > > > To get out of the dma mapping helpers having to check every segment for > > it's P2P status, ensure that bios either contain P2P transfers or non-P2P > > transfers, and that a P2P bio only contains ranges from a single device. > > > > This means we do the page zone access in the bio add path where it should > > be still page hot, and will only have do the fairly expensive P2P topology > > lookup once per bio down in the dma mapping path, and only for already > > marked bios. > > > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx> > > --- > > block/bio.c | 36 +++++++++++++++++++++++++++++------- > > block/blk-map.c | 32 ++++++++++++++++++++++++-------- > > include/linux/blk_types.h | 2 ++ > > 3 files changed, 55 insertions(+), 15 deletions(-) <...> > > @@ -410,6 +411,7 @@ enum req_flag_bits { > > #define REQ_DRV (__force blk_opf_t)(1ULL << __REQ_DRV) > > #define REQ_FS_PRIVATE (__force blk_opf_t)(1ULL << __REQ_FS_PRIVATE) > > #define REQ_ATOMIC (__force blk_opf_t)(1ULL << __REQ_ATOMIC) > > +#define REQ_P2PDMA (__force blk_opf_t)(1ULL << __REQ_P2PDMA) > > #define REQ_P2PDMA (__force blk_opf_t)BIT_ULL(__REQ_P2PDMA) > > Use BIT_ULL instead of direct left shit. We keep coding style consistent and all defines above aren't implemented with BIT_ULL(). Thanks > > Zhu Yanjun > > > #define REQ_NOUNMAP (__force blk_opf_t)(1ULL << __REQ_NOUNMAP) >