[DRBD-cvs] svn commit by lars - r2184 - branches/drbd-0.7/drbd - get rid of GFP_DRBD, explicitly use GFP_NOIO at those p

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Fri Apr 28 17:58:51 CEST 2006


Author: lars
Date: 2006-04-28 17:58:50 +0200 (Fri, 28 Apr 2006)
New Revision: 2184

Modified:
   branches/drbd-0.7/drbd/drbd_int.h
   branches/drbd-0.7/drbd/drbd_main.c
   branches/drbd-0.7/drbd/drbd_receiver.c
   branches/drbd-0.7/drbd/drbd_req.c
Log:
get rid of GFP_DRBD, explicitly use GFP_NOIO at those places

Modified: branches/drbd-0.7/drbd/drbd_int.h
===================================================================
--- branches/drbd-0.7/drbd/drbd_int.h	2006-04-28 14:28:03 UTC (rev 2183)
+++ branches/drbd-0.7/drbd/drbd_int.h	2006-04-28 15:58:50 UTC (rev 2184)
@@ -289,21 +289,6 @@
 	( typecheck(struct Drbd_Conf*,x) && \
 	  ((x) ? (((x)->magic ^ DRBD_MAGIC) == (long)(x)):0))
 
-
-/*
- * GFP_DRBD is used for allocations inside drbd_make_request,
- * and for the sk->allocation scheme.
- *
- * Try to get away with GFP_NOIO, which is
- * in 2.4.x:	(__GFP_HIGH | __GFP_WAIT) // HIGH == EMERGENCY, not HIGHMEM!
- * in 2.6.x:	             (__GFP_WAIT)
- *
- * As far as i can see we do not allocate from interrupt context...
- * if we do, we certainly should fix that.
- * - lge
- */
-#define GFP_DRBD GFP_NOIO
-
 /* these defines should go into blkdev.h
    (if it will be ever includet into linus' linux) */
 #define RQ_DRBD_NOTHING	  0x0001

Modified: branches/drbd-0.7/drbd/drbd_main.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_main.c	2006-04-28 14:28:03 UTC (rev 2183)
+++ branches/drbd-0.7/drbd/drbd_main.c	2006-04-28 15:58:50 UTC (rev 2184)
@@ -245,8 +245,6 @@
 
 	barrier_nr_issue++;
 
-	// THINK this is called in the IO path with the send_mutex held
-	// and GFP_KERNEL may itself start IO. set it to GFP_NOIO.
 	b=kmalloc(sizeof(struct drbd_barrier),GFP_NOIO);
 	if(!b) {
 		ERR("could not kmalloc() barrier\n");

Modified: branches/drbd-0.7/drbd/drbd_receiver.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_receiver.c	2006-04-28 14:28:03 UTC (rev 2183)
+++ branches/drbd-0.7/drbd/drbd_receiver.c	2006-04-28 15:58:50 UTC (rev 2184)
@@ -309,6 +309,11 @@
 			if( ( mdev->ee_vacant+mdev->ee_in_use) < 
 			      mdev->conf.max_buffers ) {
 				if(drbd_alloc_ee(mdev,GFP_TRY)) {
+	/* race race race
+	 * (currently harmless for drbd07, since drbd_get_ee is called by
+	 * receiver_thread only. solved with different implementation in
+	 * drbd-plus already.)
+	 */
 					spin_lock_irq(&mdev->ee_lock);
 					break;
 				}
@@ -328,6 +333,7 @@
 		finish_wait(&mdev->ee_wait, &wait); 
 	}
 
+	/* race race race */
 	le=mdev->free_ee.next;
 	list_del(le);
 	mdev->ee_vacant--;
@@ -747,10 +753,8 @@
 	msock->sk->SK_(reuse)=1; /* SO_REUSEADDR */
 	sock->sk->SK_(reuse)=1; /* SO_REUSEADDR */
 
-	/* to prevent oom deadlock... */
-	/* The default allocation priority was GFP_KERNEL */
-	sock->sk->SK_(allocation) = GFP_DRBD;
-	msock->sk->SK_(allocation) = GFP_DRBD;
+	sock->sk->SK_(allocation) = GFP_NOIO;
+	msock->sk->SK_(allocation) = GFP_NOIO;
 
 	sock->sk->SK_(priority)=TC_PRIO_BULK;
 	NOT_IN_26(sock->sk->tp_pinfo.af_tcp.nonagle=0;)

Modified: branches/drbd-0.7/drbd/drbd_req.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_req.c	2006-04-28 14:28:03 UTC (rev 2183)
+++ branches/drbd-0.7/drbd/drbd_req.c	2006-04-28 15:58:50 UTC (rev 2184)
@@ -225,7 +225,7 @@
 
 	/* allocate outside of all locks
 	 */
-	req = mempool_alloc(drbd_request_mempool, GFP_DRBD);
+	req = mempool_alloc(drbd_request_mempool, GFP_NOIO);
 	if (!req) {
 		/* only pass the error to the upper layers.
 		 * if user cannot handle io errors, thats not our business.



More information about the drbd-cvs mailing list