Skip to content

Commit

Permalink
block: add comment on why we save and disable interrupts in flush_plu…
Browse files Browse the repository at this point in the history
…g_list()

It's done at the top to avoid doing it for every queue we unplug.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jens Axboe committed Apr 12, 2011
1 parent 94b5eb2 commit 1881127
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2696,6 +2696,11 @@ static void flush_plug_list(struct blk_plug *plug)

q = NULL;
depth = 0;

/*
* Save and disable interrupts here, to avoid doing it for every
* queue lock we have to take.
*/
local_irq_save(flags);
while (!list_empty(&list)) {
rq = list_entry_rq(list.next);
Expand Down

0 comments on commit 1881127

Please sign in to comment.