Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214455
b: refs/heads/master
c: 515e079
h: refs/heads/master
i:
  214453: 22bde66
  214451: 4c846ab
  214447: 6a26a04
v: v3
  • Loading branch information
Zach Brown authored and Andy Grover committed Sep 9, 2010
1 parent 4199340 commit b35341a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8aeb1ba6630ffd44001ae9833842794df0107676
refs/heads/master: 515e079dab19cf774d1eec6e5f4ed65509e31ef1
9 changes: 8 additions & 1 deletion trunk/net/rds/ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ void rds_ib_exit(void)
rds_ib_sysctl_exit();
rds_ib_recv_exit();
rds_trans_unregister(&rds_ib_transport);
rds_ib_fmr_exit();
}

struct rds_transport rds_ib_transport = {
Expand Down Expand Up @@ -386,10 +387,14 @@ int __init rds_ib_init(void)

INIT_LIST_HEAD(&rds_ib_devices);

ret = ib_register_client(&rds_ib_client);
ret = rds_ib_fmr_init();
if (ret)
goto out;

ret = ib_register_client(&rds_ib_client);
if (ret)
goto out_fmr_exit;

ret = rds_ib_sysctl_init();
if (ret)
goto out_ibreg;
Expand All @@ -412,6 +417,8 @@ int __init rds_ib_init(void)
rds_ib_sysctl_exit();
out_ibreg:
rds_ib_unregister_client();
out_fmr_exit:
rds_ib_fmr_exit();
out:
return ret;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/rds/ib.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents,
void rds_ib_sync_mr(void *trans_private, int dir);
void rds_ib_free_mr(void *trans_private, int invalidate);
void rds_ib_flush_mrs(void);
int __init rds_ib_fmr_init(void);
void __exit rds_ib_fmr_exit(void);

/* ib_recv.c */
int __init rds_ib_recv_init(void);
Expand Down
25 changes: 23 additions & 2 deletions trunk/net/rds/ib_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,26 @@ static int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool,
return ret;
}

struct workqueue_struct *rds_ib_fmr_wq;

int __init rds_ib_fmr_init(void)
{
rds_ib_fmr_wq = create_workqueue("rds_fmr_flushd");
if (!rds_ib_fmr_wq)
return -ENOMEM;
return 0;
}

/*
* By the time this is called all the IB devices should have been torn down and
* had their pools freed. As each pool is freed its work struct is waited on,
* so the pool flushing work queue should be idle by the time we get here.
*/
void __exit rds_ib_fmr_exit(void)
{
destroy_workqueue(rds_ib_fmr_wq);
}

static void rds_ib_mr_pool_flush_worker(struct work_struct *work)
{
struct rds_ib_mr_pool *pool = container_of(work, struct rds_ib_mr_pool, flush_worker.work);
Expand Down Expand Up @@ -718,15 +738,16 @@ void rds_ib_free_mr(void *trans_private, int invalidate)
/* If we've pinned too many pages, request a flush */
if (atomic_read(&pool->free_pinned) >= pool->max_free_pinned ||
atomic_read(&pool->dirty_count) >= pool->max_items / 10)
queue_delayed_work(rds_wq, &pool->flush_worker, 10);
queue_delayed_work(rds_ib_fmr_wq, &pool->flush_worker, 10);

if (invalidate) {
if (likely(!in_interrupt())) {
rds_ib_flush_mr_pool(pool, 0, NULL);
} else {
/* We get here if the user created a MR marked
* as use_once and invalidate at the same time. */
queue_delayed_work(rds_wq, &pool->flush_worker, 10);
queue_delayed_work(rds_ib_fmr_wq,
&pool->flush_worker, 10);
}
}

Expand Down

0 comments on commit b35341a

Please sign in to comment.