diff options
author | alc <alc@FreeBSD.org> | 2004-11-08 00:43:46 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-11-08 00:43:46 +0000 |
commit | 279c442e7b00039336f35f8337221afc75097719 (patch) | |
tree | 9c22bf433a4b1e53785d707539f3ec1a29b480d8 /sys/sparc64 | |
parent | ddc1dfe834242dfb57955d438edf435598a4ebeb (diff) | |
download | FreeBSD-src-279c442e7b00039336f35f8337221afc75097719.zip FreeBSD-src-279c442e7b00039336f35f8337221afc75097719.tar.gz |
Introduce two new options, "CPU private" and "no wait", to sf_buf_alloc().
Change the spelling of the "catch" option to be consistent with the new
options. Implement the "no wait" option. An implementation of the "CPU
private" for i386 will be committed at a later date.
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/vm_machdep.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/sparc64/sparc64/vm_machdep.c b/sys/sparc64/sparc64/vm_machdep.c index 70d4451..ead11b4 100644 --- a/sys/sparc64/sparc64/vm_machdep.c +++ b/sys/sparc64/sparc64/vm_machdep.c @@ -375,17 +375,19 @@ sf_buf_init(void *arg) * Get an sf_buf from the freelist. Will block if none are available. */ struct sf_buf * -sf_buf_alloc(struct vm_page *m, int pri) +sf_buf_alloc(struct vm_page *m, int flags) { struct sf_buf *sf; int error; mtx_lock(&sf_freelist.sf_lock); while ((sf = SLIST_FIRST(&sf_freelist.sf_head)) == NULL) { + if (flags & SFB_NOWAIT) + goto break; sf_buf_alloc_want++; mbstat.sf_allocwait++; - error = msleep(&sf_freelist, &sf_freelist.sf_lock, PVM | pri, - "sfbufa", 0); + error = msleep(&sf_freelist, &sf_freelist.sf_lock, + (flags & SFB_CATCH) ? PCATCH | PVM : PVM, "sfbufa", 0); sf_buf_alloc_want--; /* |