]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
IB/fmr_pool: Stop ib_fmr threads from contributing to load average
authorAnton Blanchard <anton@samba.org>
Tue, 30 Oct 2007 21:57:43 +0000 (14:57 -0700)
committerRoland Dreier <rolandd@cisco.com>
Tue, 30 Oct 2007 21:57:43 +0000 (14:57 -0700)
I noticed my machine was at a constant load average of 1. This was
because ib_create_fmr_pool calls kthread_create but does not
immediately wake the thread up.

Change to using kthread_run so we enter ib_fmr_cleanup_thread(), set
TASK_INTERRUPTIBLE, then go to sleep.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/fmr_pool.c

index d7f64525469b5769d23621c22f4842a7b49387a9..e8d5f6b6499823893a38c263dd8428a214813d59 100644 (file)
@@ -291,10 +291,10 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd             *pd,
        atomic_set(&pool->flush_ser, 0);
        init_waitqueue_head(&pool->force_wait);
 
-       pool->thread = kthread_create(ib_fmr_cleanup_thread,
-                                     pool,
-                                     "ib_fmr(%s)",
-                                     device->name);
+       pool->thread = kthread_run(ib_fmr_cleanup_thread,
+                                  pool,
+                                  "ib_fmr(%s)",
+                                  device->name);
        if (IS_ERR(pool->thread)) {
                printk(KERN_WARNING PFX "couldn't start cleanup thread\n");
                ret = PTR_ERR(pool->thread);