aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/ib_rdma.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rds/ib_rdma.c')
-rw-r--r--net/rds/ib_rdma.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
index 00f3995351c8..0eb597670c5b 100644
--- a/net/rds/ib_rdma.c
+++ b/net/rds/ib_rdma.c
@@ -691,6 +691,26 @@ out_nolock:
691 return ret; 691 return ret;
692} 692}
693 693
694struct workqueue_struct *rds_ib_fmr_wq;
695
696int __init rds_ib_fmr_init(void)
697{
698 rds_ib_fmr_wq = create_workqueue("rds_fmr_flushd");
699 if (!rds_ib_fmr_wq)
700 return -ENOMEM;
701 return 0;
702}
703
704/*
705 * By the time this is called all the IB devices should have been torn down and
706 * had their pools freed. As each pool is freed its work struct is waited on,
707 * so the pool flushing work queue should be idle by the time we get here.
708 */
709void __exit rds_ib_fmr_exit(void)
710{
711 destroy_workqueue(rds_ib_fmr_wq);
712}
713
694static void rds_ib_mr_pool_flush_worker(struct work_struct *work) 714static void rds_ib_mr_pool_flush_worker(struct work_struct *work)
695{ 715{
696 struct rds_ib_mr_pool *pool = container_of(work, struct rds_ib_mr_pool, flush_worker.work); 716 struct rds_ib_mr_pool *pool = container_of(work, struct rds_ib_mr_pool, flush_worker.work);
@@ -718,7 +738,7 @@ void rds_ib_free_mr(void *trans_private, int invalidate)
718 /* If we've pinned too many pages, request a flush */ 738 /* If we've pinned too many pages, request a flush */
719 if (atomic_read(&pool->free_pinned) >= pool->max_free_pinned || 739 if (atomic_read(&pool->free_pinned) >= pool->max_free_pinned ||
720 atomic_read(&pool->dirty_count) >= pool->max_items / 10) 740 atomic_read(&pool->dirty_count) >= pool->max_items / 10)
721 queue_delayed_work(rds_wq, &pool->flush_worker, 10); 741 queue_delayed_work(rds_ib_fmr_wq, &pool->flush_worker, 10);
722 742
723 if (invalidate) { 743 if (invalidate) {
724 if (likely(!in_interrupt())) { 744 if (likely(!in_interrupt())) {
@@ -726,7 +746,8 @@ void rds_ib_free_mr(void *trans_private, int invalidate)
726 } else { 746 } else {
727 /* We get here if the user created a MR marked 747 /* We get here if the user created a MR marked
728 * as use_once and invalidate at the same time. */ 748 * as use_once and invalidate at the same time. */
729 queue_delayed_work(rds_wq, &pool->flush_worker, 10); 749 queue_delayed_work(rds_ib_fmr_wq,
750 &pool->flush_worker, 10);
730 } 751 }
731 } 752 }
732 753