Commit 01003a6e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] blk: statically initialise the congestion waitqueue_heads

On a really small memory machine (or one with a monstrous kernel memory leak)
we can end up calling blk_congestion_wait() before the waitqueue_heads are set
up.
parent aae898de
...@@ -47,7 +47,10 @@ static kmem_cache_t *request_cachep; ...@@ -47,7 +47,10 @@ static kmem_cache_t *request_cachep;
static LIST_HEAD(blk_plug_list); static LIST_HEAD(blk_plug_list);
static spinlock_t blk_plug_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; static spinlock_t blk_plug_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
static wait_queue_head_t congestion_wqh[2]; static wait_queue_head_t congestion_wqh[2] = {
__WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[0]),
__WAIT_QUEUE_HEAD_INITIALIZER(congestion_wqh[1])
};
/* /*
* Controlling structure to kblockd * Controlling structure to kblockd
...@@ -2825,8 +2828,6 @@ void kblockd_flush(void) ...@@ -2825,8 +2828,6 @@ void kblockd_flush(void)
int __init blk_dev_init(void) int __init blk_dev_init(void)
{ {
int i;
kblockd_workqueue = create_workqueue("kblockd"); kblockd_workqueue = create_workqueue("kblockd");
if (!kblockd_workqueue) if (!kblockd_workqueue)
panic("Failed to create kblockd\n"); panic("Failed to create kblockd\n");
...@@ -2838,9 +2839,6 @@ int __init blk_dev_init(void) ...@@ -2838,9 +2839,6 @@ int __init blk_dev_init(void)
blk_max_low_pfn = max_low_pfn; blk_max_low_pfn = max_low_pfn;
blk_max_pfn = max_pfn; blk_max_pfn = max_pfn;
for (i = 0; i < ARRAY_SIZE(congestion_wqh); i++)
init_waitqueue_head(&congestion_wqh[i]);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment