From: Jens Axboe <axboe@kernel.dk>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Mike Miller <mike.miller@hp.com>, Don Brace <don.brace@pmcs.com>,
iss_storagedev@hp.com, storagedev@pmcs.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cciss: Optimize scan_thread
Date: Thu, 23 Apr 2015 11:11:02 -0600 [thread overview]
Message-ID: <553927A6.2050407@kernel.dk> (raw)
In-Reply-To: <1429808789.10273.37.camel@stgolabs.net>
On 04/23/2015 11:06 AM, Davidlohr Bueso wrote:
> On Thu, 2015-04-23 at 10:51 -0600, Jens Axboe wrote:
>> Not that it's wrong, but this is mostly some unneeded optimizations.
>> It's not like this is in a hot path.
>
> Most definitely small optimizations, I just happened to run into
> auditing schedule calls. Still no harm in applying.
Are you sure? What happens if scan_thread() races with pci removal? The
list was non-empty, enter the loop. PCI removal removes the device from
the scan list. Now we grab the lock in scan_thread(), and
unconditionally attempt to remove an entry from scan_q. Maybe something
protects us from this, maybe it doesn't.
So IOW, I don't like your lock optimization, it's a bad idea. The
__set_current_state() change is definitely fine, though.
--
Jens Axboe
prev parent reply other threads:[~2015-04-23 17:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-22 18:43 [PATCH] cciss: Optimize scan_thread Davidlohr Bueso
2015-04-23 16:51 ` Jens Axboe
2015-04-23 17:06 ` Davidlohr Bueso
2015-04-23 17:11 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=553927A6.2050407@kernel.dk \
--to=axboe@kernel.dk \
--cc=dave@stgolabs.net \
--cc=don.brace@pmcs.com \
--cc=iss_storagedev@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.miller@hp.com \
--cc=storagedev@pmcs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.