about summary refs log tree commit homepage
path: root/svc_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'svc_dev.c')
-rw-r--r--svc_dev.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/svc_dev.c b/svc_dev.c
index 3a87800..a7e6dce 100644
--- a/svc_dev.c
+++ b/svc_dev.c
@@ -310,27 +310,25 @@ static void svc_rescale_warn_fix_capa(struct mog_svc *svc, unsigned ndev_new)
         svc->thr_per_dev = 1;
 }
 
+/* Only called by the main/notify thread */
 static void mog_svc_dev_rescale_all(struct mog_svc *svc)
 {
         struct mog_dev *dev;
-        khash_t(by_mog_devid) *h;
+        khash_t(by_mog_devid) *h = svc->by_mog_devid;
 
-        /* iterate through each device of this svc */
         CHECK(int, 0, pthread_mutex_lock(&svc->by_mog_devid_lock));
-        h = svc->by_mog_devid;
-        mog_kh_foreach_key(h, dev, mog_dev_user_rescale_i(dev, svc));
+        mog_kh_foreach_key(h, dev, mog_ioq_adjust(&dev->ioq, svc->thr_per_dev));
         CHECK(int, 0, pthread_mutex_unlock(&svc->by_mog_devid_lock));
 }
 
 void mog_svc_dev_requeue_prepare(struct mog_svc *svc)
 {
         struct mog_dev *dev;
-        khash_t(by_mog_devid) *h;
+        khash_t(by_mog_devid) *h = svc->by_mog_devid;
 
         /* iterate through each device of this svc */
         CHECK(int, 0, pthread_mutex_lock(&svc->by_mog_devid_lock));
-        h = svc->by_mog_devid;
-        mog_kh_foreach_key(h, dev, mog_dev_requeue_prepare(dev, svc));
+        mog_kh_foreach_key(h, dev, mog_dev_requeue_prepare(dev));
         CHECK(int, 0, pthread_mutex_unlock(&svc->by_mog_devid_lock));
 }