1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

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)
This commit is contained in:
Konstantin Belousov 2008-07-11 11:27:42 +00:00
parent ae95dc623a
commit 11041003c6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180446

View File

@ -2339,19 +2339,17 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp)
bufdone(bp);
return;
}
if (bp->b_iocmd == BIO_WRITE)
bio = g_new_bio();
else
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 (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;