- Fixes BUG: scheduling while atomic
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 24 Apr 2009 13:16:38 +0000 (13:16 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 24 Apr 2009 13:16:38 +0000 (13:16 +0000)
 - 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
scst/src/scst_main.c

index f057e22..33377ef 100644 (file)
@@ -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);
                        }
                }
 
index 348c226..a4857be 100644 (file)
@@ -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;