* [PATCH v2] percpu_ida: Handle out-of-tags gracefully
@ 2014-03-12 10:12 Bart Van Assche
0 siblings, 0 replies; only message in thread
From: Bart Van Assche @ 2014-03-12 10:12 UTC (permalink / raw)
To: Jens Axboe
Cc: Alexander Gordeev, Kent Overstreet, Shaohua Li, Mike Christie,
linux-kernel
Wait until a tag becomes available instead of giving up when
running out of tags temporarily. This patch fixes the following
kernel bug:
------------[ cut here ]------------
kernel BUG at lib/percpu_ida.c:81!
invalid opcode: 0000 [#1] SMP
RIP: 0010:[<ffffffff8120f00e>] [<ffffffff8120f00e>] percpu_ida_alloc+0x33e/0x370
Call Trace:
[<ffffffff811ef95f>] blk_mq_get_tag+0x2f/0x50
[<ffffffff811ed79c>] blk_mq_alloc_rq.isra.17+0x1c/0x90
[<ffffffff811eeb9b>] blk_mq_alloc_request_pinned+0x9b/0x110
[<ffffffff811ef4c6>] blk_mq_make_request+0x426/0x480
[<ffffffff811e28f0>] generic_make_request+0xc0/0x110
[<ffffffff811e29ab>] submit_bio+0x6b/0x140
[<ffffffff8117aabb>] _submit_bh+0x13b/0x220
[<ffffffff8117d70f>] block_read_full_page+0x1ff/0x300
[<ffffffff81181128>] blkdev_readpage+0x18/0x20
[<ffffffff811067b7>] __do_page_cache_readahead+0x277/0x280
[<ffffffff81106d1d>] force_page_cache_readahead+0x8d/0xc0
[<ffffffff81106d9b>] page_cache_sync_readahead+0x4b/0x50
[<ffffffff810fdf05>] generic_file_aio_read+0x4c5/0x700
[<ffffffff8118147b>] blkdev_aio_read+0x4b/0x70
[<ffffffff8114a28a>] do_sync_read+0x5a/0x90
[<ffffffff8114a8cb>] vfs_read+0x9b/0x160
[<ffffffff8114b389>] SyS_read+0x49/0xa0
[<ffffffff81416049>] tracesys+0xd0/0xd5
---[ end trace cdd1a8a7968266cf ]---
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Alexander Gordeev <agordeev@redhat.com>
CC: Jens Axboe <axboe@kernel.dk>
Cc: Kent Overstreet <kmo@daterainc.com>
Cc: Shaohua Li <shli@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Mike Christie <michaelc@cs.wisc.edu>
---
lib/percpu_ida.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/percpu_ida.c b/lib/percpu_ida.c
index 93d145e..56b5067 100644
--- a/lib/percpu_ida.c
+++ b/lib/percpu_ida.c
@@ -73,7 +73,7 @@ static inline void steal_tags(struct percpu_ida *pool,
if (cpu >= nr_cpu_ids) {
cpu = cpumask_first(&pool->cpus_have_tags);
if (cpu >= nr_cpu_ids)
- BUG();
+ break;
}
pool->cpu_last_stolen = cpu;
--
1.8.4.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-03-12 10:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-12 10:12 [PATCH v2] percpu_ida: Handle out-of-tags gracefully Bart Van Assche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox