Re: [PATCH 1/2] blk-mq: make sure hctx->next_cpu is set correctly

2018-01-17 Thread Ming Lei
On Wed, Jan 17, 2018 at 08:45:44AM -0700, Jens Axboe wrote: > On 1/17/18 5:34 AM, Ming Lei wrote: > > When hctx->next_cpu is set from possible online CPUs, there is one > > race in which hctx->next_cpu may be set as >= nr_cpu_ids, and finally > > break workqueue. > > > > The race is triggered when

Re: [PATCH 1/2] blk-mq: make sure hctx->next_cpu is set correctly

2018-01-17 Thread Jens Axboe
On 1/17/18 5:34 AM, Ming Lei wrote: > When hctx->next_cpu is set from possible online CPUs, there is one > race in which hctx->next_cpu may be set as >= nr_cpu_ids, and finally > break workqueue. > > The race is triggered when one CPU is becoming DEAD, blk_mq_hctx_notify_dead() > is called to disp

[PATCH 1/2] blk-mq: make sure hctx->next_cpu is set correctly

2018-01-17 Thread Ming Lei
When hctx->next_cpu is set from possible online CPUs, there is one race in which hctx->next_cpu may be set as >= nr_cpu_ids, and finally break workqueue. The race is triggered when one CPU is becoming DEAD, blk_mq_hctx_notify_dead() is called to dispatch requests from the DEAD cpu context, but at