[rds-commits] zab commits r184 - trunk/linux/net/rds
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Jan 19 12:10:37 PST 2007
Author: zab
Date: 2007-01-19 12:10:36 -0800 (Fri, 19 Jan 2007)
New Revision: 184
Modified:
trunk/linux/net/rds/ib.h
trunk/linux/net/rds/page.c
Log:
Disable interrupts while working with the per-cpu page remainder data.
The rx path allocates acks with the page remainder allocator and so can swoop
in mess with the per-cpu data structures under the paths which are allocating
form user context. It pinned the user path to a cpu and disabled pre-emption,
but forgot to disable interrupts.
Modified: trunk/linux/net/rds/ib.h
===================================================================
--- trunk/linux/net/rds/ib.h 2007-01-11 21:20:12 UTC (rev 183)
+++ trunk/linux/net/rds/ib.h 2007-01-19 20:10:36 UTC (rev 184)
@@ -1,6 +1,8 @@
#ifndef _RDS_IB_H
#define _RDS_IB_H
+#include <linux/mutex.h>
+
#include <rdma/ib_verbs.h>
#include <rdma/rdma_cm.h>
#include "rds.h"
Modified: trunk/linux/net/rds/page.c
===================================================================
--- trunk/linux/net/rds/page.c 2007-01-11 21:20:12 UTC (rev 183)
+++ trunk/linux/net/rds/page.c 2007-01-19 20:10:36 UTC (rev 184)
@@ -87,6 +87,7 @@
gfp_t gfp)
{
struct rds_page_remainder *rem;
+ unsigned long flags;
struct page *page;
int ret;
@@ -107,6 +108,7 @@
}
rem = &rds_per_cpu(rds_page_remainders, get_cpu());
+ local_irq_save(flags);
for(;;) {
/* avoid a tiny region getting stuck by tossing it */
@@ -136,9 +138,13 @@
}
/* alloc if there is nothing for us to use */
+ local_irq_restore(flags);
put_cpu();
+
page = alloc_page(gfp);
+
rem = &rds_per_cpu(rds_page_remainders, get_cpu());
+ local_irq_save(flags);
if (page == NULL) {
ret = -ENOMEM;
@@ -156,6 +162,7 @@
rem->r_offset = 0;
}
+ local_irq_restore(flags);
put_cpu();
out:
rdsdebug("bytes %lu ret %d %p %u %u\n", bytes, ret,
More information about the rds-commits
mailing list