From owner-cvs-src@FreeBSD.ORG Tue Apr 22 13:00:27 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3488937B401; Tue, 22 Apr 2003 13:00:27 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D117B43FD7; Tue, 22 Apr 2003 13:00:26 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3MK0Q0U040273; Tue, 22 Apr 2003 13:00:26 -0700 (PDT) (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3MK0Q6l040269; Tue, 22 Apr 2003 13:00:26 -0700 (PDT) Message-Id: <200304222000.h3MK0Q6l040269@repoman.freebsd.org> From: John Baldwin Date: Tue, 22 Apr 2003 13:00:26 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/fs/procfs procfs_ctl.c src/sys/sys proc.h src/sys/vm vm_glue.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2003 20:00:27 -0000 jhb 2003/04/22 13:00:26 PDT FreeBSD src repository Modified files: sys/fs/procfs procfs_ctl.c sys/sys proc.h sys/vm vm_glue.c Log: - Always call faultin() in _PHOLD() if PS_INMEM is clear. This closes a race where a thread could assume that a process was swapped in by PHOLD() when it actually wasn't fully swapped in yet. - In faultin(), always msleep() if PS_SWAPPINGIN is set instead of doing this check after bumping p_lock in the PS_INMEM == 0 case. Also, sched_lock is only needed for setting and clearning swapping PS_* flags and the swap thread inhibitor. - Don't set and clear the thread swap inhibitor in the same loops as the pmap_swapin/out_thread() since we have to do it under sched_lock. Instead, mimic the treatment of the PS_INMEM flag and use separate loops to set the inhibitors when clearing PS_INMEM and clear the inhibitors when setting PS_INMEM. - swapout() now returns with the proc lock held as it holds the lock while adjusting the swapping-related PS_* flags so that the proc lock can be used to test those flags. - Only use the proc lock to check the swapping-related PS_* flags in several places. - faultin() no longer requires sched_lock to be held by callers. - Rename PS_SWAPPING to PS_SWAPPINGOUT to be less ambiguous now that we have PS_SWAPPINGIN. Revision Changes Path 1.50 +0 -2 src/sys/fs/procfs/procfs_ctl.c 1.320 +4 -6 src/sys/sys/proc.h 1.166 +36 -42 src/sys/vm/vm_glue.c