blkback global resources
All the resources allocated based on xen_blkif_reqs are global in blkback. While (without having measured anything) I think that this is bad from a QoS perspective (not the least implied from a warning issued by Citrix'es multi-page-ring patches:
if (blkif_reqs < BLK_RING_SIZE(order))
printk(KERN_WARNING "WARNING: "
"I/O request space (%d reqs) < ring order %ld, " "consider increasing %s.reqs to >= %ld.", blkif_reqs, order, KBUILD_MODNAME, roundup_pow_of_two(BLK_RING_SIZE(order)));
indicating that this _is_ a bottleneck), I'm otoh hesitant to convert this to per-instance allocations, as the amount of memory taken away from Dom0 for this may be not insignificant when there are many devices.
Does anyone have an opinion here, in particular regarding the original authors' decision to make this global vs. the apparently made observation (by Daniel Stodden, the author of said patch, who I don't have any current email of to ask directly), but also in the context of multi-page rings, the purpose of which is to allow for larger amounts of in-flight I/O?
Thanks, Jan
Quoted 17 lines · Jan Beulich
All the resources allocated based on
xen_blkif_reqsare global in blkback. While (without having measured anything) I think that this is bad from a QoS perspective (not the least implied from a warning issued by Citrix'es multi-page-ring patches:if (
blkif_reqs<BLK_RING_SIZE(order))
printk(KERN_WARNING "WARNING: "
"I/O request space (%d reqs) < ring order %ld, " "consider increasing %s.reqs to >= %ld.",blkif_reqs, order,KBUILD_MODNAME, roundup_pow_of_two(BLK_RING_SIZE(order)));indicating that this _is_ a bottleneck), I'm otoh hesitant to convert this to per-instance allocations, as the amount of memory taken away from Dom0 for this may be not insignificant when there are many devices.
Quoted 6 lines
Does anyone have an opinion here, in particular regarding the original authors' decision to make this global vs. the apparently made observation (by Daniel Stodden, the author of said patch, who I don't have any current email of to ask directly), but also in the context of multi-page rings, the purpose of which is to allow for larger amounts of in-flight I/O?
Not really much to say other than we (well, mostly Wei Liu) have a similar issue with netback too. That used to have a global pool, then a pool-per-worker thread. When Wei added thread-per-vif support he solved this by adding a "page pool" which handles allocations. Possibly this could grow some sort of fairness etc nobs and be shared with blkback?
Ian.
Quoted 25 lines · Ian Campbell
Quoted 17 lines · Jan Beulich
All the resources allocated based on
xen_blkif_reqsare global in blkback. While (without having measured anything) I think that this is bad from a QoS perspective (not the least implied from a warning issued by Citrix'es multi-page-ring patches:if (
blkif_reqs<BLK_RING_SIZE(order))
printk(KERN_WARNING "WARNING: "
"I/O request space (%d reqs) < ring order %ld, " "consider increasing %s.reqs to >= %ld.",blkif_reqs, order,KBUILD_MODNAME, roundup_pow_of_two(BLK_RING_SIZE(order)));indicating that this _is_ a bottleneck), I'm otoh hesitant to convert this to per-instance allocations, as the amount of memory taken away from Dom0 for this may be not insignificant when there are many devices.
Quoted 6 lines
Does anyone have an opinion here, in particular regarding the original authors' decision to make this global vs. the apparently made observation (by Daniel Stodden, the author of said patch, who I don't have any current email of to ask directly), but also in the context of multi-page rings, the purpose of which is to allow for larger amounts of in-flight I/O?
Quoted 5 lines
Not really much to say other than we (well, mostly Wei Liu) have a similar issue with netback too. That used to have a global pool, then a pool-per-worker thread. When Wei added thread-per-vif support he solved this by adding a "page pool" which handles allocations. Possibly this could grow some sort of fairness etc nobs and be shared with blkback?
Yes! That is what I was hoping for - as it would hopefully also have the shrinker API hooked up to combat excessive memory consumption.
Quoted 8 lines
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 9 lines · Ian Campbell
Quoted 7 lines · Jan Beulich
Does anyone have an opinion here, in particular regarding the original authors' decision to make this global vs. the apparently made observation (by Daniel Stodden, the author of said patch, who I don't have any current email of to ask directly), but also in the context of multi-page rings, the purpose of which is to allow for larger amounts of in-flight I/O?
Quoted 5 lines
Not really much to say other than we (well, mostly Wei Liu) have a similar issue with netback too. That used to have a global pool, then a pool-per-worker thread. When Wei added thread-per-vif support he solved this by adding a "page pool" which handles allocations. Possibly this could grow some sort of fairness etc nobs and be shared with blkback?
I'd definitely welcome an approach in blkback similar to the page pool changes to netback. Steve Noonan's change to use a spinlock per blkfront device [1] should show increased contention on the global request list on the blkback side when multiple devices are attached.
Does netback not also need to handle questions of fairness and resource starvation?
Matt
Quoted 16 lines · Matt Wilson
Quoted 9 lines · Ian Campbell
Quoted 7 lines · Jan Beulich
Does anyone have an opinion here, in particular regarding the original authors' decision to make this global vs. the apparently made observation (by Daniel Stodden, the author of said patch, who I don't have any current email of to ask directly), but also in the context of multi-page rings, the purpose of which is to allow for larger amounts of in-flight I/O?
Quoted 5 lines
Not really much to say other than we (well, mostly Wei Liu) have a similar issue with netback too. That used to have a global pool, then a pool-per-worker thread. When Wei added thread-per-vif support he solved this by adding a "page pool" which handles allocations. Possibly this could grow some sort of fairness etc nobs and be shared with blkback?
Quoted 7 lines
I'd definitely welcome an approach in blkback similar to the page pool changes to netback. Steve Noonan's change to use a spinlock per blkfront device [1] should show increased contention on the global request list on the blkback side when multiple devices are attached.
Does netback not also need to handle questions of fairness and resource starvation?
It does, what I was meaning to say was that the page pool could grow some fairness nobs for netback use (if it is not already fair) and separately that it could be shared with blkback (rather than fairness nobs being related to the sharing with blkback which looking back is how my original statement could have been read).
Ian.
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Jan Beulich
All the resources allocated based on
xen_blkif_reqsare global in blkback. While (without having measured anything) I think that this is bad from a QoS perspective (not the least implied from a warning issued by Citrix'es multi-page-ring patches:if (
blkif_reqs<BLK_RING_SIZE(order))
printk(KERN_WAfdfdRNING "WARNING: "
"I/O request space (%d reqs) < ring order %ld, " "consider increasing %s.reqs to >= %ld.",blkif_reqs, order,KBUILD_MODNAME, roundup_pow_of_two(BLK_RING_SIZE(order)));
Quoted 5 lines
Quoted 5 lines
indicating that this _is_ a bottleneck), I'm otoh hesitant to convert this to per-instance allocations, as the amount of memory taken away from Dom0 for this may be not insignificant when there are many devices.
What's your main concern on QoS? Lock contention? Starvation? Or any other things?
You are right here, we should be careful on how much memory blkback may consume.
Quoted 7 lines
Quoted 6 lines
Does anyone have an opinion here, in particular regarding the original authors' decision to make this global vs. the apparently made observation (by Daniel Stodden, the author of said patch, who I don't have any current email of to ask directly), but also in the context of multi-page rings, the purpose of which is to allow for larger amounts of in-flight I/O?
I don't know the actual bottleneck for blkback because I never play with it. But for multi-page ring netback / netfront, global pool (in the sense of starvation) may not become bottleneck if there are very limited VIFs running. What I observe is that to achieve 3.8Gb/s throughput between two VIFs connected throughput internal bridge, it only consumes ~80 pages in the pool.
Wei.
Quoted 8 lines
Not really much to say other than we (well, mostly Wei Liu) have a similar issue with netback too. That used to have a global pool, then a pool-per-worker thread. When Wei added thread-per-vif support he solved this by adding a "page pool" which handles allocations. Possibly this could grow some sort of fairness etc nobs and be shared with blkback?
Ian.
Quoted 15 lines
Quoted 1 line
Quoted 1 line · Wei Liu
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Jan Beulich
All the resources allocated based on
xen_blkif_reqsare global in blkback. While (without having measured anything) I think that this is bad from a QoS perspective (not the least implied from a warning issued by Citrix'es multi-page-ring patches:if (
blkif_reqs<BLK_RING_SIZE(order))
printk(KERN_WAfdfdRNING "WARNING: "
"I/O request space (%d reqs) < ring order %ld, " "consider increasing %s.reqs to >= %ld.",blkif_reqs, order,KBUILD_MODNAME, roundup_pow_of_two(BLK_RING_SIZE(order)));
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
indicating that this _is_ a bottleneck), I'm otoh hesitant to convert this to per-instance allocations, as the amount of memory taken away from Dom0 for this may be not insignificant when there are many devices.
What's your main concern on QoS? Lock contention? Starvation? Or any other things?
However you want to put it. Prior to the multi-page ring patches, we have 64 pending requests (global) and 32 ring entries. Obviously, bumping the ring size just to order 1 will already bring the number of possible in-flight entries per device on par with those in-flight across all devices. So _if_ someone really determined that a multi-page ring helps performance, I wonder whether that was with manually adjusted global pending request values (not said anywhere) or with just a single frontend (not very close to real world scenarios).
In any case, two guests with heavy I/O clearly have the potential to hinder each other, even if both get backed by different physical devices.
Jan
Quoted 24 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line
Quoted 1 line · Wei Liu
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Jan Beulich
All the resources allocated based on
xen_blkif_reqsare global in blkback. While (without having measured anything) I think that this is bad from a QoS perspective (not the least implied from a warning issued by Citrix'es multi-page-ring patches:if (
blkif_reqs<BLK_RING_SIZE(order))
printk(KERN_WARNING "WARNING: "
"I/O request space (%d reqs) < ring order %ld, " "consider increasing %s.reqs to >= %ld.",blkif_reqs, order,KBUILD_MODNAME, roundup_pow_of_two(BLK_RING_SIZE(order)));Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
indicating that this _is_ a bottleneck), I'm otoh hesitant to convert this to per-instance allocations, as the amount of memory taken away from Dom0 for this may be not insignificant when there are many devices.
What's your main concern on QoS? Lock contention? Starvation? Or any other things?
Quoted 9 lines
However you want to put it. Prior to the multi-page ring patches, we have 64 pending requests (global) and 32 ring entries. Obviously, bumping the ring size just to order 1 will already bring the number of possible in-flight entries per device on par with those in-flight across all devices. So _if_ someone really determined that a multi-page ring helps performance, I wonder whether that was with manually adjusted global pending request values (not said anywhere) or with just a single frontend (not very close to real world scenarios).
Just to be precise, bumping order to 1 makes ring entries more than 64.
Quoted 4 lines
In any case, two guests with heavy I/O clearly have the potential to hinder each other, even if both get backed by different physical devices.
Right. One solution I can think of is that each blk thread holds a small number of private entries (threshold to be determined), while blkback maintains a pool for any allocation goes beyond that threshold. But this just makes things more and more complex -- let's not overkill ourselves before we identify the real bottleneck.
Wei.
Quoted 2 lines
Jan
Quoted 36 lines
Quoted 1 line
Quoted 1 line · Wei Liu
Quoted 24 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line
Quoted 1 line · Wei Liu
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Jan Beulich
All the resources allocated based on
xen_blkif_reqsare global in blkback. While (without having measured anything) I think that this is bad from a QoS perspective (not the least implied from a warning issued by Citrix'es multi-page-ring patches:if (
blkif_reqs<BLK_RING_SIZE(order))
printk(KERN_WARNING "WARNING: "
"I/O request space (%d reqs) < ring order %ld, " "consider increasing %s.reqs to >= %ld.",blkif_reqs, order,KBUILD_MODNAME, roundup_pow_of_two(BLK_RING_SIZE(order)));Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
indicating that this _is_ a bottleneck), I'm otoh hesitant to convert this to per-instance allocations, as the amount of memory taken away from Dom0 for this may be not insignificant when there are many devices.
What's your main concern on QoS? Lock contention? Starvation? Or any other things?
Quoted 9 lines
However you want to put it. Prior to the multi-page ring patches, we have 64 pending requests (global) and 32 ring entries. Obviously, bumping the ring size just to order 1 will already bring the number of possible in-flight entries per device on par with those in-flight across all devices. So _if_ someone really determined that a multi-page ring helps performance, I wonder whether that was with manually adjusted global pending request values (not said anywhere) or with just a single frontend (not very close to real world scenarios).
Quoted 1 line
Just to be precise, bumping order to 1 makes ring entries more than 64.
Iirc order 0 -> 32 entries, order 1 -> 64 entries.
Jan
Quoted 36 lines · Jan Beulich
Quoted 36 lines
Quoted 1 line
Quoted 1 line · Wei Liu
Quoted 33 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line
Quoted 1 line · Wei Liu
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Jan Beulich
All the resources allocated based on
xen_blkif_reqsare global in blkback. While (without having measured anything) I think that this is bad from a QoS perspective (not the least implied from a warning issued by Citrix'es multi-page-ring patches:if (
blkif_reqs<BLK_RING_SIZE(order))
printk(KERN_WARNING "WARNING: "
"I/O request space (%d reqs) < ring order %ld, " "consider increasing %s.reqs to >= %ld.",blkif_reqs, order,KBUILD_MODNAME, roundup_pow_of_two(BLK_RING_SIZE(order)));Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
indicating that this _is_ a bottleneck), I'm otoh hesitant to convert this to per-instance allocations, as the amount of memory taken away from Dom0 for this may be not insignificant when there are many devices.
What's your main concern on QoS? Lock contention? Starvation? Or any other things?
However you want to put it. Prior to the multi-page ring patches, we have 64 pending requests (global) and 32 ring entries. Obviously, bumping the ring size just to order 1 will already bring the number of possible in-flight entries per device on par with those in-flight across all devices. So _if_ someone really determined that a multi-page ring helps performance, I wonder whether that was with manually adjusted global pending request values (not said anywhere) or with just a single frontend (not very close to real world scenarios).
Quoted 4 lines
Quoted 1 line
Just to be precise, bumping order to 1 makes ring entries more than 64.
Iirc order 0 -> 32 entries, order 1 -> 64 entries.
I skimmed the code just to make sure. You're right, the size is rounded down to power of 2. What I was talking about is the value before rounded-down.
Wei.
Quoted 2 lines
Jan