Re: [PATCH 1/2] blk-mq: convert hctx.nr_active to refcount_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/22/19 9:04 AM, Peter Zijlstra wrote:
> On Fri, Mar 22, 2019 at 04:01:16PM +0100, Peter Zijlstra wrote:
>> On Fri, Mar 22, 2019 at 10:48:17PM +0800, Yufen Yu wrote:
>>> @@ -2710,7 +2710,7 @@ static struct blk_mq_hw_ctx *blk_mq_alloc_and_init_hctx(
>>>  		return NULL;
>>>  	}
>>>  
>>> -	atomic_set(&hctx->nr_active, 0);
>>> +	refcount_set(&hctx->nr_active, 0);
>>>  	hctx->numa_node = node;
>>>  	hctx->queue_num = hctx_idx;
>>>  
>>
>> That looks bogus, refcount_t cannot inc-from-zero.
> 
> I also don't see a single dec_and_test in that patch, which leads me to
> believe nr_active is not in fact a refcount.

It isn't a refcount at all, it's just a count of how many queues are
active in a shared tag map scenario.

-- 
Jens Axboe




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux