diff options
author | kib <kib@FreeBSD.org> | 2008-07-11 11:27:42 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-07-11 11:27:42 +0000 |
commit | b341cd2da2055a5743eb5a0e542f24b48a015bd4 (patch) | |
tree | fd39b9b6ada9e2cd17c7e39bd452ad7bf92b8b8d /sys/vm | |
parent | da671c053375bcabe7698de8cd91540e9b53fc6c (diff) | |
download | FreeBSD-src-b341cd2da2055a5743eb5a0e542f24b48a015bd4.zip FreeBSD-src-b341cd2da2055a5743eb5a0e542f24b48a015bd4.tar.gz |
Use the VM_ALLOC_INTERRUPT for the page requests when allocating memory
for the bio for swapout write. It allows the page allocator to drain
free page list deeper. As result, a deadlock where pageout deamon sleeps
waiting for bio to be allocated for swapout is no more reproducable in
practice.
Alan said that M_USE_RESERVE shall be ressurrected and used there, but
until this is implemented, M_NOWAIT does exactly what is needed.
Tested by: pho, kris
Reviewed by: alc
No objections from: phk
MFC after: 2 weeks (RELENG_7 only)
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index eb910f7..39af009 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2339,19 +2339,17 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp) bufdone(bp); return; } - bio = g_alloc_bio(); -#if 0 - /* - * XXX: We shouldn't really sleep here when we run out of buffers - * XXX: but the alternative is worse right now. - */ + if (bp->b_iocmd == BIO_WRITE) + bio = g_new_bio(); + else + bio = g_alloc_bio(); if (bio == NULL) { bp->b_error = ENOMEM; bp->b_ioflags |= BIO_ERROR; bufdone(bp); return; } -#endif + bio->bio_caller2 = bp; bio->bio_cmd = bp->b_iocmd; bio->bio_data = bp->b_data; |