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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/