From 207d73fdac452844b74e94b629c7b2895c4f1e64 Mon Sep 17 00:00:00 2001 From: vlnb Date: Fri, 24 Apr 2009 13:16:38 +0000 Subject: [PATCH] - 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 git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@796 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 f057e22..33377ef 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); } } @@ -3501,8 +3501,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); } } @@ -3560,7 +3560,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 348c226..a4857be 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -1777,6 +1777,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) { @@ -1784,17 +1789,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; -- 2.17.1