Date: Mon, 05 Jul 1999 20:59:51 +1000 From: Stephen McKay <syssgm@detir.qld.gov.au> To: Kirk McKusick <mckusick@FreeBSD.org> Cc: cvs-committers@freebsd.org, cvs-all@FreeBSD.org, syssgm@detir.qld.gov.au 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: <199907051059.UAA24859@nymph.detir.qld.gov.au> In-Reply-To: <199907040025.RAA83209@freefall.freebsd.org> from Kirk McKusick at "Sat, 03 Jul 1999 17:25:39 -0700" References: <199907040025.RAA83209@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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?199907051059.UAA24859>