Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0626710 authored by Tejun Heo's avatar Tejun Heo Committed by Roland Dreier
Browse files

RDMA: Update workqueue usage



* ib_wq is added, which is used as the common workqueue for infiniband
  instead of the system workqueue.  All system workqueue usages
  including flush_scheduled_work() callers are converted to use and
  flush ib_wq.

* cancel_delayed_work() + flush_scheduled_work() converted to
  cancel_delayed_work_sync().

* qib_wq is removed and ib_wq is used instead.

This is to prepare for deprecation of flush_scheduled_work().

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 948579cd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -308,7 +308,7 @@ static void ib_cache_event(struct ib_event_handler *handler,
			INIT_WORK(&work->work, ib_cache_task);
			work->device   = event->device;
			work->port_num = event->element.port_num;
			schedule_work(&work->work);
			queue_work(ib_wq, &work->work);
		}
	}
}
@@ -368,7 +368,7 @@ static void ib_cache_cleanup_one(struct ib_device *device)
	int p;

	ib_unregister_event_handler(&device->cache.event_handler);
	flush_scheduled_work();
	flush_workqueue(ib_wq);

	for (p = 0; p <= end_port(device) - start_port(device); ++p) {
		kfree(device->cache.pkey_cache[p]);
+9 −2
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>

#include "core_priv.h"

@@ -52,6 +51,9 @@ struct ib_client_data {
	void *            data;
};

struct workqueue_struct *ib_wq;
EXPORT_SYMBOL_GPL(ib_wq);

static LIST_HEAD(device_list);
static LIST_HEAD(client_list);

@@ -718,6 +720,10 @@ static int __init ib_core_init(void)
{
	int ret;

	ib_wq = alloc_workqueue("infiniband", 0, 0);
	if (!ib_wq)
		return -ENOMEM;

	ret = ib_sysfs_setup();
	if (ret)
		printk(KERN_WARNING "Couldn't create InfiniBand device class\n");
@@ -726,6 +732,7 @@ static int __init ib_core_init(void)
	if (ret) {
		printk(KERN_WARNING "Couldn't set up InfiniBand P_Key/GID cache\n");
		ib_sysfs_cleanup();
		destroy_workqueue(ib_wq);
	}

	return ret;
@@ -736,7 +743,7 @@ static void __exit ib_core_cleanup(void)
	ib_cache_cleanup();
	ib_sysfs_cleanup();
	/* Make sure that any pending umem accounting work is done. */
	flush_scheduled_work();
	destroy_workqueue(ib_wq);
}

module_init(ib_core_init);
+1 −1
Original line number Diff line number Diff line
@@ -425,7 +425,7 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event
		port->sm_ah = NULL;
		spin_unlock_irqrestore(&port->ah_lock, flags);

		schedule_work(&sa_dev->port[event->element.port_num -
		queue_work(ib_wq, &sa_dev->port[event->element.port_num -
					    sa_dev->start_port].update_task);
	}
}
+1 −1
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ void ib_umem_release(struct ib_umem *umem)
			umem->mm   = mm;
			umem->diff = diff;

			schedule_work(&umem->work);
			queue_work(ib_wq, &umem->work);
			return;
		}
	} else
+1 −1
Original line number Diff line number Diff line
@@ -755,7 +755,7 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev)
	 */
	ipath_shutdown_device(dd);

	flush_scheduled_work();
	flush_workqueue(ib_wq);

	if (dd->verbs_dev)
		ipath_unregister_ib_device(dd->verbs_dev);
Loading