From 83badc5efcf51e3da547705a72878f05a3aa0af8 Mon Sep 17 00:00:00 2001 From: eeb Date: Wed, 21 Aug 2002 22:17:39 +0000 Subject: [PATCH] optional highmem buffers in obdecho/test_brw --- lustre/obdclass/class_obd.c | 4 +++- lustre/obdecho/echo.c | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 7c31246..4c67ad4 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -53,6 +53,8 @@ unsigned long obd_fail_loc = 0; unsigned long obd_timeout = 100; char obd_recovery_upcall[128] = "/usr/lib/lustre/ha_assist"; +int obdclass_highmem = 0; + extern struct obd_type *class_nm_to_type(char *nm); /* opening /dev/obd */ @@ -519,7 +521,7 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, off = data->ioc_offset; for (j = 0, pgp = pga; j < pages; j++, off += PAGE_SIZE, pgp++){ - pgp->pg = alloc_pages(GFP_KERNEL, 0); + pgp->pg = alloc_pages(obdclass_highmem ? GFP_HIGHUSER : GFP_KERNEL, 0); if (!pgp->pg) { CERROR("no memory for brw pages\n"); GOTO(brw_cleanup, err = -ENOMEM); diff --git a/lustre/obdecho/echo.c b/lustre/obdecho/echo.c index eb31dac..a63f67e 100644 --- a/lustre/obdecho/echo.c +++ b/lustre/obdecho/echo.c @@ -11,8 +11,8 @@ * by Peter Braam */ -static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.24 2002/08/19 23:45:00 adilger Exp $"; -#define OBDECHO_VERSION "$Revision: 1.24 $" +static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.25 2002/08/21 22:17:39 eeb Exp $"; +#define OBDECHO_VERSION "$Revision: 1.25 $" #define EXPORT_SYMTAB @@ -43,6 +43,8 @@ static long echo_pages = 0; static atomic_t echo_page_rws; static atomic_t echo_getattrs; +int obdecho_highmem = 0; + #define ECHO_PROC_STAT "sys/obdecho" int @@ -153,7 +155,7 @@ int echo_preprw(int cmd, struct lustre_handle *conn, int objcount, int j; for (j = 0 ; j < obj->ioo_bufcnt ; j++, nb++, r++) { - r->page = alloc_pages(GFP_KERNEL, 0); + r->page = alloc_pages(obdecho_highmem ? GFP_HIGHUSER : GFP_KERNEL, 0); if (!r->page) { CERROR("can't get page %d/%d for id "LPU64"\n", j, obj->ioo_bufcnt, obj->ioo_id); -- 1.8.3.1