svn commit: r217561 - in head/sys: arm/arm i386/i386 mips/mips powerpc/aim powerpc/booke sparc64/sparc64

Konstantin Belousov kib at FreeBSD.org
Tue Jan 18 21:57:02 UTC 2011


Author: kib
Date: Tue Jan 18 21:57:02 2011
New Revision: 217561
URL: http://svn.freebsd.org/changeset/base/217561

Log:
  For architectures not using direct map , and requiring real KVA page for
  sf buf allocation, use wakeup() instead of wakeup_one() to notify sf
  buffer waiters about free buffer.
  
  sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given,
  and for simultaneous wakeup and signal delivery, msleep() returns
  EINTR/ERESTART despite the thread was selected for wakeup_one(). As
  result, we loose a wakeup, and some other waiter will not be woken up.
  
  Reported and tested by:	az
  Reviewed by:	alc, jhb
  MFC after:	1 week

Modified:
  head/sys/arm/arm/vm_machdep.c
  head/sys/i386/i386/vm_machdep.c
  head/sys/mips/mips/vm_machdep.c
  head/sys/powerpc/aim/vm_machdep.c
  head/sys/powerpc/booke/vm_machdep.c
  head/sys/sparc64/sparc64/vm_machdep.c

Modified: head/sys/arm/arm/vm_machdep.c
==============================================================================
--- head/sys/arm/arm/vm_machdep.c	Tue Jan 18 21:47:30 2011	(r217560)
+++ head/sys/arm/arm/vm_machdep.c	Tue Jan 18 21:57:02 2011	(r217561)
@@ -175,7 +175,7 @@ sf_buf_free(struct sf_buf *sf)
 		 sf->m = NULL;
 		 LIST_REMOVE(sf, list_entry);
 		 if (sf_buf_alloc_want > 0)
-			 wakeup_one(&sf_buf_freelist);
+			 wakeup(&sf_buf_freelist);
 	 }
 	 mtx_unlock(&sf_buf_lock);				 
 #endif

Modified: head/sys/i386/i386/vm_machdep.c
==============================================================================
--- head/sys/i386/i386/vm_machdep.c	Tue Jan 18 21:47:30 2011	(r217560)
+++ head/sys/i386/i386/vm_machdep.c	Tue Jan 18 21:57:02 2011	(r217561)
@@ -916,7 +916,7 @@ sf_buf_free(struct sf_buf *sf)
 		LIST_REMOVE(sf, list_entry);
 #endif
 		if (sf_buf_alloc_want > 0)
-			wakeup_one(&sf_buf_freelist);
+			wakeup(&sf_buf_freelist);
 	}
 	mtx_unlock(&sf_buf_lock);
 }

Modified: head/sys/mips/mips/vm_machdep.c
==============================================================================
--- head/sys/mips/mips/vm_machdep.c	Tue Jan 18 21:47:30 2011	(r217560)
+++ head/sys/mips/mips/vm_machdep.c	Tue Jan 18 21:57:02 2011	(r217561)
@@ -528,7 +528,7 @@ sf_buf_free(struct sf_buf *sf)
 	SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list);
 	nsfbufsused--;
 	if (sf_buf_alloc_want > 0)
-		wakeup_one(&sf_freelist);
+		wakeup(&sf_freelist);
 	mtx_unlock(&sf_freelist.sf_lock);
 }
 

Modified: head/sys/powerpc/aim/vm_machdep.c
==============================================================================
--- head/sys/powerpc/aim/vm_machdep.c	Tue Jan 18 21:47:30 2011	(r217560)
+++ head/sys/powerpc/aim/vm_machdep.c	Tue Jan 18 21:57:02 2011	(r217561)
@@ -347,7 +347,7 @@ sf_buf_free(struct sf_buf *sf)
                 nsfbufsused--;
 
                 if (sf_buf_alloc_want > 0)
-                        wakeup_one(&sf_buf_freelist);
+                        wakeup(&sf_buf_freelist);
         }
         mtx_unlock(&sf_buf_lock);
 }

Modified: head/sys/powerpc/booke/vm_machdep.c
==============================================================================
--- head/sys/powerpc/booke/vm_machdep.c	Tue Jan 18 21:47:30 2011	(r217560)
+++ head/sys/powerpc/booke/vm_machdep.c	Tue Jan 18 21:57:02 2011	(r217561)
@@ -346,7 +346,7 @@ sf_buf_free(struct sf_buf *sf)
 		nsfbufsused--;
 
 		if (sf_buf_alloc_want > 0)
-			wakeup_one(&sf_buf_freelist);
+			wakeup(&sf_buf_freelist);
 	}
 	mtx_unlock(&sf_buf_lock);
 }

Modified: head/sys/sparc64/sparc64/vm_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/vm_machdep.c	Tue Jan 18 21:47:30 2011	(r217560)
+++ head/sys/sparc64/sparc64/vm_machdep.c	Tue Jan 18 21:57:02 2011	(r217561)
@@ -483,7 +483,7 @@ sf_buf_free(struct sf_buf *sf)
 	SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list);
 	nsfbufsused--;
 	if (sf_buf_alloc_want > 0)
-		wakeup_one(&sf_freelist);
+		wakeup(&sf_freelist);
 	mtx_unlock(&sf_freelist.sf_lock);
 }
 


More information about the svn-src-all mailing list