[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1495662147-18277-15-git-send-email-logang@deltatee.com>
Date: Wed, 24 May 2017 15:42:25 -0600
From: Logan Gunthorpe <logang@...tatee.com>
To: linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
linux-nvdimm@...ts.01.org, linux-nvme@...ts.infradead.org,
linux-rdma@...r.kernel.org
Cc: Christoph Hellwig <hch@....de>,
Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
Jens Axboe <axboe@...nel.dk>,
Dan Williams <dan.j.williams@...el.com>,
Ross Zwisler <ross.zwisler@...ux.intel.com>,
Matthew Wilcox <mawilcox@...rosoft.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Ming Lei <ming.lei@...onical.com>,
Johannes Berg <johannes.berg@...el.com>,
Stephen Bates <sbates@...thlin.com>,
Sagi Grimberg <sagi@...mberg.me>,
Keith Busch <keith.busch@...el.com>,
Christian König <christian.koenig@....com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Jerome Glisse <jglisse@...hat.com>,
Logan Gunthorpe <logang@...tatee.com>
Subject: [RFC PATCH 14/16] block: bio: go straight from pfn_t to phys instead of through page
Going straight from pfn_t to physical address is cheaper and
avoids the potential BUG_ON in bvec_page for unmappable memory.
Signed-off-by: Logan Gunthorpe <logang@...tatee.com>
Signed-off-by: Stephen Bates <sbates@...thlin.com>
---
include/linux/bio.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index bc5f5d3..890c94d 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -46,6 +46,8 @@
#define bio_iter_iovec(bio, iter) \
bvec_iter_bvec((bio)->bi_io_vec, (iter))
+#define bio_iter_pfn_t(bio, iter) \
+ bvec_iter_pfn_t((bio)->bi_io_vec, (iter))
#define bio_iter_page(bio, iter) \
bvec_iter_page((bio)->bi_io_vec, (iter))
#define bio_iter_len(bio, iter) \
@@ -53,6 +55,7 @@
#define bio_iter_offset(bio, iter) \
bvec_iter_offset((bio)->bi_io_vec, (iter))
+#define bio_pfn_t(bio) bio_iter_pfn_t((bio), (bio)->bi_iter)
#define bio_page(bio) bio_iter_page((bio), (bio)->bi_iter)
#define bio_offset(bio) bio_iter_offset((bio), (bio)->bi_iter)
#define bio_iovec(bio) bio_iter_iovec((bio), (bio)->bi_iter)
@@ -118,8 +121,8 @@ static inline void *bio_data(struct bio *bio)
/*
* will die
*/
-#define bio_to_phys(bio) (page_to_phys(bio_page((bio))) + (unsigned long) bio_offset((bio)))
-#define bvec_to_phys(bv) (page_to_phys(bvec_page((bv))) + (unsigned long) (bv)->bv_offset)
+#define bio_to_phys(bio) (pfn_t_to_phys(bio_pfn_t((bio))) + (unsigned long) bio_offset((bio)))
+#define bvec_to_phys(bv) (pfn_t_to_phys((bv)->bv_pfn) + (unsigned long) (bv)->bv_offset)
/*
* queues that have highmem support enabled may still need to revert to
--
2.1.4
Powered by blists - more mailing lists