[DRBD-cvs] svn commit by lars - r2186 - branches/drbd-0.7/drbd - more GFP flag magic

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Fri Apr 28 21:24:11 CEST 2006


Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: lars
Date: 2006-04-28 21:24:10 +0200 (Fri, 28 Apr 2006)
New Revision: 2186

Modified:
   branches/drbd-0.7/drbd/drbd_receiver.c
Log:
more GFP flag magic

Modified: branches/drbd-0.7/drbd/drbd_receiver.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_receiver.c	2006-04-28 16:15:07 UTC (rev 2185)
+++ branches/drbd-0.7/drbd/drbd_receiver.c	2006-04-28 19:24:10 UTC (rev 2186)
@@ -161,7 +161,11 @@
 {
 	struct Tl_epoch_entry* e;
 
-	e = kmem_cache_alloc(drbd_ee_cache, mask);
+	/* kmem_cache does not like to mix different memory types.
+	 * so even if we alloc'ed the page from HIGHMEM,
+	 * the ee comes from normal memory.
+	 */
+	e = kmem_cache_alloc(drbd_ee_cache, mask & ~(__GFP_HIGHMEM));
 	if( e == NULL ) return FALSE;
 
 	drbd_ee_init(e,page);
@@ -181,7 +185,12 @@
 	page=alloc_page(mask);
 	if(!page) return FALSE;
 
-	if(!_drbd_alloc_ee(mdev,page,mask)) {
+	/* if we got the page, we really want the ee, too,
+	 * even for "GFP_TRY".
+	 * we may wait, but better not cause IO,
+	 * we might be in the IO path (of our peer).
+	 */
+	if(!_drbd_alloc_ee(mdev,page,mask | GFP_NOIO)) {
 		__free_page(page);
 		return FALSE;
 	}



More information about the drbd-cvs mailing list