lkml.org 
[lkml]   [2015]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cciss: Optimize scan_thread
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



\
 
 \ /
  Last update: 2015-04-23 19:21    [W:0.029 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site