lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yd7J4XbkdIm52bVw@smile.fi.intel.com>
Date:   Wed, 12 Jan 2022 14:30:25 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     QiuLaibin <qiulaibin@...wei.com>
Cc:     axboe@...nel.dk, ming.lei@...hat.com, john.garry@...wei.com,
        martin.petersen@...cle.com, hare@...e.de,
        johannes.thumshirn@....com, bvanassche@....org,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next v4] blk-mq: fix tag_get wait task can't be awakened

On Wed, Jan 12, 2022 at 12:18:53PM +0800, QiuLaibin wrote:
> On 2022/1/11 22:15, Andy Shevchenko wrote:
> > On Tue, Jan 11, 2022 at 10:02:16PM +0800, Laibin Qiu wrote:

...

> > > +		if (test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags) ||
> > > +		    test_and_set_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags)) {
> > 
> > Whoever wrote this code did too much defensive programming, because the first
> > conditional doesn't make much sense here. Am I right?
> > 
> I think because this judgement is in the general IO process, there are also
> some performance considerations here.

I didn't buy this. Is there any better argument why you need redundant
test_bit() call?

> > > +			return true;

> > >   	} else {
> > 
> > > +		if (test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state) ||
> > > +		    test_and_set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state)) {
> > 
> > Ditto.
> > 
> > > +			return true;

> > >   	}

...

> > > +	unsigned int wake_batch = clamp_t(unsigned int,
> > > +			(sbq->sb.depth + users - 1) / users, 4U, SBQ_WAKE_BATCH);
> > 
> > 
> > 	unsigned int wake_batch;
> > 
> > 	wake_batch = clamp_val((sbq->sb.depth + users - 1) / users, 4, SBQ_WAKE_BATCH);
> > 	...
> > 
> > is easier to read, no?
> 
> Here I refer to the calculation method in sbq_calc_wake_batch(). And I will
> separate the definition from the calculation in V5.

I'm not sure I understand how it's related to the style changes I proposed.
I haven't changed any logic behind.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ