Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-24 Thread Sagi Grimberg
Well, when it will failover, it will probably be directed to the poll queues. Maybe I'm missing something... In this patchset, because it isn't submitted directly from FS, there isn't one polling context associated with this bio, so its HIPRI flag will be cleared, then fallback to irq mode.

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-23 Thread Ming Lei
On Tue, Mar 23, 2021 at 09:54:36AM -0700, Sagi Grimberg wrote: > > > > > +static void blk_bio_poll_post_submit(struct bio *bio, blk_qc_t cookie) > > > > +{ > > > > + bio->bi_iter.bi_private_data = cookie; > > > > +} > > > > + > > > > > > Hey Ming, thinking about nvme-mpath, I'm thinking

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-23 Thread Sagi Grimberg
+static void blk_bio_poll_post_submit(struct bio *bio, blk_qc_t cookie) +{ + bio->bi_iter.bi_private_data = cookie; +} + Hey Ming, thinking about nvme-mpath, I'm thinking that this should be an exported function for failover. nvme-mpath updates bio.bi_dev when re-submitting I/Os to an

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-23 Thread Ming Lei
On Mon, Mar 22, 2021 at 08:46:04PM -0700, Sagi Grimberg wrote: > > > +static void blk_bio_poll_post_submit(struct bio *bio, blk_qc_t cookie) > > +{ > > + bio->bi_iter.bi_private_data = cookie; > > +} > > + > > Hey Ming, thinking about nvme-mpath, I'm thinking that this should be > an exported

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-23 Thread Ming Lei
On Fri, Mar 19, 2021 at 02:38:11PM -0400, Mike Snitzer wrote: > On Thu, Mar 18 2021 at 12:48pm -0400, > Ming Lei wrote: > > > Currently bio based IO poll needs to poll all hw queue blindly, this way > > is very inefficient, and the big reason is that we can't pass bio > > submission result to io

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-23 Thread Ming Lei
On Sat, Mar 20, 2021 at 01:56:13PM +0800, JeffleXu wrote: > > > On 3/19/21 9:46 PM, Ming Lei wrote: > > On Fri, Mar 19, 2021 at 05:38:38PM +0800, JeffleXu wrote: > >> I'm thinking how this mechanism could work with *original* bio-based > >> devices that don't ne built upon mq devices, such as

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-22 Thread Sagi Grimberg
+static void blk_bio_poll_post_submit(struct bio *bio, blk_qc_t cookie) +{ + bio->bi_iter.bi_private_data = cookie; +} + Hey Ming, thinking about nvme-mpath, I'm thinking that this should be an exported function for failover. nvme-mpath updates bio.bi_dev when re-submitting I/Os to an

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-22 Thread JeffleXu
I'm thinking how this mechanism could work with *original* bio-based devices that don't ne built upon mq devices, such as nvdimm. This mechanism (also including my original design) mainly focuses on virtual devices that built upon mq devices, i.e., md/dm. As the original bio-based devices wants

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-22 Thread JeffleXu
On 3/19/21 9:46 PM, Ming Lei wrote: > On Fri, Mar 19, 2021 at 05:38:38PM +0800, JeffleXu wrote: >> I'm thinking how this mechanism could work with *original* bio-based >> devices that don't ne built upon mq devices, such as nvdimm. This > > non-mq device needs driver to implement io polling by

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-19 Thread Mike Snitzer
On Thu, Mar 18 2021 at 12:48pm -0400, Ming Lei wrote: > Currently bio based IO poll needs to poll all hw queue blindly, this way > is very inefficient, and the big reason is that we can't pass bio > submission result to io poll task. This is awkward because bio-based IO polling doesn't exist

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-19 Thread Ming Lei
On Fri, Mar 19, 2021 at 05:38:38PM +0800, JeffleXu wrote: > I'm thinking how this mechanism could work with *original* bio-based > devices that don't ne built upon mq devices, such as nvdimm. This non-mq device needs driver to implement io polling by itself, block layer can't help it, and that

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread Ming Lei
On Thu, Mar 18, 2021 at 01:26:22PM -0400, Mike Snitzer wrote: > On Thu, Mar 18 2021 at 12:48pm -0400, > Ming Lei wrote: > > > Currently bio based IO poll needs to poll all hw queue blindly, this way > > is very inefficient, and the big reason is that we can't pass bio > > submission result to io

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread Mike Snitzer
On Thu, Mar 18, 2021 at 1:26 PM Mike Snitzer wrote: > > On Thu, Mar 18 2021 at 12:48pm -0400, > Ming Lei wrote: > > > Currently bio based IO poll needs to poll all hw queue blindly, this way > > is very inefficient, and the big reason is that we can't pass bio > > submission result to io poll

Re: [dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread Mike Snitzer
On Thu, Mar 18 2021 at 12:48pm -0400, Ming Lei wrote: > Currently bio based IO poll needs to poll all hw queue blindly, this way > is very inefficient, and the big reason is that we can't pass bio > submission result to io poll task. > > In IO submission context, track associated underlying

[dm-devel] [RFC PATCH V2 09/13] block: use per-task poll context to implement bio based io poll

2021-03-18 Thread Ming Lei
Currently bio based IO poll needs to poll all hw queue blindly, this way is very inefficient, and the big reason is that we can't pass bio submission result to io poll task. In IO submission context, track associated underlying bios by per-task submission queue and save 'cookie' poll data in