[SCSI] fcoe: Cleanup locking on fcoe_percpu_receive_thread
authorNeil Horman <nhorman@tuxdriver.com>
Fri, 6 Jul 2012 17:40:05 +0000 (10:40 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 20 Jul 2012 07:58:55 +0000 (08:58 +0100)
commit95fdd5e980e6eea4579c15043f7a9be6ad63012c
treee74fcd944435fe471d15e78e901dee32e1b46a98
parent902a45af5c9fad283a530c3bc71225fa6a8e616a
[SCSI] fcoe: Cleanup locking on fcoe_percpu_receive_thread

Noticed that we can shuffle the code around in fcoe_percpu_receive_thread a bit
and avoid taking the fcoe_rx_list lock twice per iteration.  This should improve
throughput somewhat.  With this change we take the lock, and check for new
frames in a single critical section.  Only if the list is empty do we drop the
lock and re-acquire it after being signaled to wake up.

Change Notes:
v2) did some further cleanup on the patch by replacing the 2nd call of
spin_lock/splice_init with a goto to the top of the outer loop.  This allows me
to change the inner while loop to an if conditional and remove the sencond check
of kthread_should_stop.  Based on suggestion from Vasu Dev.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/fcoe/fcoe.c