]> git.baikalelectronics.ru Git - kernel.git/commit
sbitmap: Protect swap_lock from softirqs
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 14 Jan 2019 17:25:40 +0000 (12:25 -0500)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 14 Jan 2019 19:31:18 +0000 (07:31 +1200)
commitd7d5d51c39deebb7acffb2d73cfd15369729bf11
tree395e8ab29d48c025bae872b23830ad0c0fa47c03
parent23e2aee705c5dec8b3de32a67932e6ef66613bf4
sbitmap: Protect swap_lock from softirqs

The swap_lock used by sbitmap has a chain with locks taken from softirq,
but the swap_lock is not protected from being preempted by softirqs.

A chain exists of:

 sbq->ws[i].wait -> dispatch_wait_lock -> swap_lock

Where the sbq->ws[i].wait lock can be taken from softirq context, which
means all locks below it in the chain must also be protected from
softirqs.

Reported-by: Clark Williams <williams@redhat.com>
Fixes: cd80ddc212fa ("sbitmap: silence bogus lockdep IRQ warning")
Fixes: 5cd47079aec1 ("sbitmap: amortize cost of clearing bits")
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/sbitmap.c