From 735814fb793676e7c6b0cdefd4a56dc92edac212 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 24 Apr 2009 13:23:00 +0000 Subject: [PATCH] Merge of r796: - Fixes BUG: scheduling while atomic - Removes nested allocation, because MAX_LOCKDEP_SUBCLASSES isn't sufficiently high in many cases - Size for mempools for UAs and sense buffers increased git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/1.0.1.x@797 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 10 +++++----- scst/src/scst_main.c | 12 +++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 5313e9f11..450c36ade 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -522,8 +522,8 @@ static void scst_queue_report_luns_changed_UA(struct scst_session *sess, list_for_each_entry(tgt_dev, shead, sess_tgt_dev_list_entry) { - spin_lock_nested(&tgt_dev->tgt_dev_lock, - tgt_dev->lun); + /* Lockdep triggers here a false positive.. */ + spin_lock(&tgt_dev->tgt_dev_lock); } } @@ -3441,8 +3441,8 @@ again: struct scst_tgt_dev *tgt_dev; list_for_each_entry(tgt_dev, sess_tgt_dev_list_head, sess_tgt_dev_list_entry) { - spin_lock_nested(&tgt_dev->tgt_dev_lock, - tgt_dev->lun); + /* Lockdep triggers here a false positive.. */ + spin_lock(&tgt_dev->tgt_dev_lock); } } @@ -3500,7 +3500,7 @@ out_unlock: struct scst_tgt_dev *tgt_dev; list_for_each_entry_reverse(tgt_dev, sess_tgt_dev_list_head, sess_tgt_dev_list_entry) { - spin_unlock_bh(&tgt_dev->tgt_dev_lock); + spin_unlock(&tgt_dev->tgt_dev_lock); } } diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 038fa3c5e..adaafcc8c 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -1782,6 +1782,11 @@ static int __init init_scst(void) goto out_destroy_acg_cache; } + /* + * All mgmt stubs, UAs and sense buffers are bursty and loosing them + * may have fatal consequences, so let's have big pools for them. + */ + scst_mgmt_stub_mempool = mempool_create(1024, mempool_alloc_slab, mempool_free_slab, scst_mgmt_stub_cachep); if (scst_mgmt_stub_mempool == NULL) { @@ -1789,17 +1794,14 @@ static int __init init_scst(void) goto out_destroy_mgmt_mempool; } - scst_ua_mempool = mempool_create(64, mempool_alloc_slab, + scst_ua_mempool = mempool_create(512, mempool_alloc_slab, mempool_free_slab, scst_ua_cachep); if (scst_ua_mempool == NULL) { res = -ENOMEM; goto out_destroy_mgmt_stub_mempool; } - /* - * Loosing sense may have fatal consequences, so let's have a big pool - */ - scst_sense_mempool = mempool_create(128, mempool_alloc_slab, + scst_sense_mempool = mempool_create(1024, mempool_alloc_slab, mempool_free_slab, scst_sense_cachep); if (scst_sense_mempool == NULL) { res = -ENOMEM;