Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified)) by mollari.NetBSD.org (Postfix) with ESMTPS id 6486B1A921F for ; Wed, 4 Nov 2020 01:30:21 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id EA8D284DBD; Wed, 4 Nov 2020 01:30:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 6C1D484DB9 for ; Wed, 4 Nov 2020 01:30:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 2pthj0RrVUbN for ; Wed, 4 Nov 2020 01:30:20 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id C1BB984D27 for ; Wed, 4 Nov 2020 01:30:19 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id B18CBFB28; Wed, 4 Nov 2020 01:30:19 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Wed, 4 Nov 2020 01:30:19 +0000 From: "Chuck Silvers" Subject: CVS commit: src/sys To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20201104013019.B18CBFB28@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Chuck Silvers" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: chs Date: Wed Nov 4 01:30:19 UTC 2020 Modified Files: src/sys/kern: init_main.c src/sys/uvm: uvm_aobj.c uvm_init.c uvm_pdaemon.c Log Message: In uvmpd_tryownerlock(), if the initial try-lock of the owner lock fails then rather than do more try-locks and eventually sleep for a tick, take a hold on the current owner's lock, drop the page interlock, and acquire the lock that we took the hold on in a blocking fashion. After we get the lock, check if the lock that we acquired is still the lock for the owner of the page that we're interested in. If the owner hasn't changed then can proceed with this page, otherwise we will skip this page and move on to a different page. This dramatically reduces the amount of time that the pagedaemon sleeps trying to get locks, since even 1 tick is an eternity to sleep in this context and it was easy to trigger that case in practice, and with this new method the pagedaemon only very rarely actually blocks to acquire the lock that it wants since the object locks are adaptive, and when the pagedaemon does block then the amount of time it spends sleeping will be generally be much less than 1 tick. To generate a diff of this commit: cvs rdiff -u -r1.531 -r1.532 src/sys/kern/init_main.c cvs rdiff -u -r1.151 -r1.152 src/sys/uvm/uvm_aobj.c cvs rdiff -u -r1.54 -r1.55 src/sys/uvm/uvm_init.c cvs rdiff -u -r1.130 -r1.131 src/sys/uvm/uvm_pdaemon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.