diff options
author | Donghai Qiao <Donghai.Qiao@Sun.COM> | 2008-09-10 15:33:33 -0700 |
---|---|---|
committer | Donghai Qiao <Donghai.Qiao@Sun.COM> | 2008-09-10 15:33:33 -0700 |
commit | ed0efa6876ba3b938ff57240b02b5f999f8dcda2 (patch) | |
tree | 7eacef0ed0c58fa09034bd7bac0721e47e0b602d | |
parent | 4d4c4c43355e86515b3e8f1309e0d4ca76d9f40c (diff) | |
download | illumos-joyent-ed0efa6876ba3b938ff57240b02b5f999f8dcda2.tar.gz |
6692373 ptree and ps -ef hang during stress test
-rw-r--r-- | usr/src/uts/common/fs/swapfs/swap_vnops.c | 14 | ||||
-rw-r--r-- | usr/src/uts/common/sys/buf.h | 5 | ||||
-rw-r--r-- | usr/src/uts/common/vm/seg_vn.c | 6 |
3 files changed, 13 insertions, 12 deletions
diff --git a/usr/src/uts/common/fs/swapfs/swap_vnops.c b/usr/src/uts/common/fs/swapfs/swap_vnops.c index ec4ad4f3b2..d38aef7dae 100644 --- a/usr/src/uts/common/fs/swapfs/swap_vnops.c +++ b/usr/src/uts/common/fs/swapfs/swap_vnops.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/param.h> #include <sys/systm.h> @@ -496,6 +494,7 @@ swap_putpage( u_offset_t io_off; size_t io_len = 0; int err = 0; + int nowait; struct async_reqs *arg; if (swap_nopage) @@ -503,10 +502,12 @@ swap_putpage( ASSERT(vp->v_count != 0); + nowait = flags & B_PAGE_NOWAIT; + /* * Clear force flag so that p_lckcnt pages are not invalidated. */ - flags &= ~B_FORCE; + flags &= ~(B_FORCE | B_PAGE_NOWAIT); SWAPFS_PRINT(SWAP_VOPS, "swap_putpage: vp %p, off %llx len %lx, flags %x\n", @@ -567,12 +568,13 @@ swap_putpage( * routine page_lookup_nowait() to prevent * reclaiming them from the free list. */ - if ((flags & B_INVAL) || - (flags & (B_ASYNC | B_FREE)) == B_FREE) + if (!nowait && ((flags & B_INVAL) || + (flags & (B_ASYNC | B_FREE)) == B_FREE)) pp = page_lookup(vp, io_off, SE_EXCL); else pp = page_lookup_nowait(vp, io_off, - (flags & B_FREE) ? SE_EXCL : SE_SHARED); + (flags & (B_FREE | B_INVAL)) ? + SE_EXCL : SE_SHARED); if (pp == NULL || pvn_getdirty(pp, flags) == 0) io_len = PAGESIZE; diff --git a/usr/src/uts/common/sys/buf.h b/usr/src/uts/common/sys/buf.h index 2a39fcdc43..44da4608c3 100644 --- a/usr/src/uts/common/sys/buf.h +++ b/usr/src/uts/common/sys/buf.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -39,8 +39,6 @@ #ifndef _SYS_BUF_H #define _SYS_BUF_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types32.h> #include <sys/t_lock.h> #include <sys/kstat.h> @@ -187,6 +185,7 @@ struct biostats { #define B_FAILFAST 0x1000000 /* Fail promptly if device goes away */ #define B_STARTED 0x2000000 /* io:::start probe called for buf */ #define B_ABRWRITE 0x4000000 /* Application based recovery active */ +#define B_PAGE_NOWAIT 0x8000000 /* Skip the page if it is locked */ /* * Insq/Remq for the buffer hash lists. diff --git a/usr/src/uts/common/vm/seg_vn.c b/usr/src/uts/common/vm/seg_vn.c index fba2fbc5fe..56da962297 100644 --- a/usr/src/uts/common/vm/seg_vn.c +++ b/usr/src/uts/common/vm/seg_vn.c @@ -36,8 +36,6 @@ * contributors. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * VM - shared or copy-on-write from a vnode/anonymous memory. */ @@ -7361,7 +7359,9 @@ segvn_sync(struct seg *seg, caddr_t addr, size_t len, int attr, uint_t flags) */ VN_HOLD(vp); err = VOP_PUTPAGE(vp, (offset_t)off, PAGESIZE, - bflags, svd->cred, NULL); + (bflags | (IS_SWAPFSVP(vp) ? B_PAGE_NOWAIT : 0)), + svd->cred, NULL); + VN_RELE(vp); if (err) break; |