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]
Date:	Thu, 23 Apr 2015 10:51:59 -0600
From:	Jens Axboe <axboe@...nel.dk>
To:	Davidlohr Bueso <dave@...olabs.net>
CC:	Mike Miller <mike.miller@...com>, Don Brace <don.brace@...s.com>,
	iss_storagedev@...com, storagedev@...s.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cciss: Optimize scan_thread

On 04/22/2015 12:43 PM, Davidlohr Bueso wrote:
> Two rather small optimizations found while going through driver
> code:
>
> 1) Use the cheaper alternative to set_current_state() as we are
> sure the task will block right afterward.
>
> 2) Checks for list_empty without the scan_mutex. The list_empty
> function is very much designed to work without locks, obviously
> as long as the head (scan_q) is reliable. In this case if another
> thread is doing add_to_scan_list(), we still buckle in the outer
> loop, so it will be caught upon the next iteration -- and if
> kthread_should_stop() hits, it does not matter _anyway_ as we'd
> still need to abort the function regardless of the status of
> the scan_q.

Not that it's wrong, but this is mostly some unneeded optimizations. 
It's not like this is in a hot path.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ