Re: [RFC PATCH bitmap-for-next 4/4] blk_mq: Fix cpumask_check() warning in blk_mq_hctx_next_cpu()

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

 



> >>  static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx)
> >>  {
> >> -	bool tried = false;
> >>      int next_cpu = hctx->next_cpu;
> >>
> >>      if (hctx->queue->nr_hw_queues == 1)
> >>              return WORK_CPU_UNBOUND;
> >>
> >> -	if (--hctx->next_cpu_batch <= 0) {
> >> -select_cpu:
> >> -		next_cpu = cpumask_next_and(next_cpu, hctx->cpumask,
> >> -				cpu_online_mask);
> >> -		if (next_cpu >= nr_cpu_ids)
> >> -			next_cpu = blk_mq_first_mapped_cpu(hctx);
> >> +	if (--hctx->next_cpu_batch > 0 && cpu_online(next_cpu))
> >> +		return next_cpu;
> >> +
> >> +	next_cpu = cpumask_next_and_wrap(next_cpu, hctx->cpumask, cpu_online_mask, next_cpu, false);
> >
> > Last two parameters are simply useless. In fact, in many cases they
> > are useless for cpumask_next_wrap(). I'm working on simplifying the
> > cpumask_next_wrap() so that it would take just 2 parameters - pivot
> > point and cpumask.
> >
> > Regarding 'next' version - we already have find_next_and_bit_wrap(),
> > and I think cpumask_next_and_wrap() should use it.
> >
> 
> Oh, I had missed those, that makes more sense indeed.
> 
> > For the context: those last parameters are needed to exclude part of
> > cpumask from traversing, and to implement for-loop. Now that we have
> > for_each_cpu_wrap() based on for_each_set_bit_wrap(), it's possible
> > to remove them. I'm working on it.
> 
> Sounds good.

Hi Valentin, all,

I'd  like to share my work-in-progress for cpumask_next_wrap(). It's 
now in testing (at least, it boots on x86_64 VM).

I'd like to collect early comments on the rework. If you like it, please
align your 'and' version with this.

https://github.com/norov/linux/commits/__bitmap-for-next

Thanks,
Yury



[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