Skip to content

Commit

Permalink
RDS: flush fmrs before allocating new ones
Browse files Browse the repository at this point in the history
Flushing FMRs is somewhat expensive, and is currently kicked off when
the interrupt handler notices that we are getting low.  The result of
this is that FMR flushing only happens from the interrupt cpus.

This spreads the load more effectively by triggering flushes just before
we allocate a new FMR.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason authored and Andy Grover committed Sep 9, 2010
1 parent b4e1da3 commit 8576f37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/rds/ib_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "ib.h"
#include "xlist.h"

struct workqueue_struct *rds_ib_fmr_wq;

static DEFINE_PER_CPU(unsigned long, clean_list_grace);
#define CLEAN_LIST_BUSY_BIT 0

Expand Down Expand Up @@ -304,6 +306,9 @@ static struct rds_ib_mr *rds_ib_alloc_fmr(struct rds_ib_device *rds_ibdev)
struct rds_ib_mr *ibmr = NULL;
int err = 0, iter = 0;

if (atomic_read(&pool->dirty_count) >= pool->max_items / 10)
queue_delayed_work(rds_ib_fmr_wq, &pool->flush_worker, 10);

while (1) {
ibmr = rds_ib_reuse_fmr(pool);
if (ibmr)
Expand Down Expand Up @@ -691,8 +696,6 @@ static int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool,
return ret;
}

struct workqueue_struct *rds_ib_fmr_wq;

int rds_ib_fmr_init(void)
{
rds_ib_fmr_wq = create_workqueue("rds_fmr_flushd");
Expand Down

0 comments on commit 8576f37

Please sign in to comment.