Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Jul 1999 04:20:10 -0700
From:      David Greenman <dg@root.com>
To:        Stephen McKay <syssgm@detir.qld.gov.au>
Cc:        Kirk McKusick <mckusick@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/i386/i386 machdep.c src/sys/kern vfs_bio.c vfs_subr.c src/sys/sys buf.h kernel.h proc.h src/sys/vm vm_pageout.c vm_pager.c 
Message-ID:  <199907051120.EAA02790@implode.root.com>
In-Reply-To: Your message of "Mon, 05 Jul 1999 20:59:51 %2B1000." <199907051059.UAA24859@nymph.detir.qld.gov.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
   Looks good - please commit.

-DG

David Greenman
Co-founder/Principal Architect, The FreeBSD Project - http://www.freebsd.org
Creator of high-performance Internet servers - http://www.terasolutions.com

>On Saturday, 3rd July 1999, Kirk McKusick wrote:
>
>>  A small race condition was fixed in getpbuf() in vm/vm_pager.c.
>
>That's one butt ugly goto!  Here is my suggested (untested) reformatting:
>
>
>Index: vm_pager.c
>===================================================================
>RCS file: /cvs/src/sys/vm/vm_pager.c,v
>retrieving revision 1.50
>diff -u -c -r1.50 vm_pager.c
>*** vm_pager.c	1999/07/04 00:25:38	1.50
>--- vm_pager.c	1999/07/05 10:50:41
>***************
>*** 377,394 ****
>  
>  	s = splvm();
>  
>! retry:
>! 	if (pfreecnt) {
>! 		while (*pfreecnt == 0) {
>! 			tsleep(pfreecnt, PVM, "wswbuf0", 0);
>  		}
>- 	}
>  
>! 	/* get a bp from the swap buffer header pool */
>! 	while ((bp = TAILQ_FIRST(&bswlist)) == NULL) {
>  		bswneeded = 1;
>  		tsleep(&bswneeded, PVM, "wswbuf1", 0);
>! 		goto retry;	/* loop in case someone else grabbed one */
>  	}
>  	TAILQ_REMOVE(&bswlist, bp, b_freelist);
>  	if (pfreecnt)
>--- 377,396 ----
>  
>  	s = splvm();
>  
>! 	for (;;) {
>! 		if (pfreecnt) {
>! 			while (*pfreecnt == 0) {
>! 				tsleep(pfreecnt, PVM, "wswbuf0", 0);
>! 			}
>  		}
>  
>! 		/* get a bp from the swap buffer header pool */
>! 		if ((bp = TAILQ_FIRST(&bswlist)) != NULL)
>! 			break;
>! 
>  		bswneeded = 1;
>  		tsleep(&bswneeded, PVM, "wswbuf1", 0);
>! 		/* loop in case someone else grabbed one */
>  	}
>  	TAILQ_REMOVE(&bswlist, bp, b_freelist);
>  	if (pfreecnt)
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907051120.EAA02790>