From nobody Tue Jun 07 14:23:27 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0E1857CACFE; Tue, 7 Jun 2022 14:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LHXdq6SXrz3r85; Tue, 7 Jun 2022 14:23:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654611808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rFkSp0UE2D0+syEaTeyDa9lpsuHxvvM/VEJFAHgso2k=; b=s+bk0FJCdbsXNuG8MZXWegUQsBO5HYYJ7fRdmOaxAUVPONZ3vVjySFC48CR9yRZDJYt4e+ Qw+qK+ctpWezoozoMgm1ly9n+wb+3/6iL4pP6GoF4ZT6sur04ZEftrs+bPmm2O/02c7yg7 EftDKsU6fo3XceAVnlBrS7RKS8VD1HCQvCQ17IPeBzXq8SJg/9aNuuh1Mt4880TcTfycYH CVLHnk4cLGxAmljDEsOwiE/xRo2dLIea1nbSqGbNS8xj3//r5Pr08nNSXUcP9gOe6T0xTq NhjvlZZei+EMDeIiYJVeMm4W7eaGmwRO3PxFS1fr+CbS2kvsSk7BVREdQNU2Lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC7951C84A; Tue, 7 Jun 2022 14:23:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 257ENROG020253; Tue, 7 Jun 2022 14:23:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 257ENRFb020252; Tue, 7 Jun 2022 14:23:27 GMT (envelope-from git) Date: Tue, 7 Jun 2022 14:23:27 GMT Message-Id: <202206071423.257ENRFb020252@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 152c34e2dd8e - stable/13 - Use the existing page size in libthr List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 152c34e2dd8e221609928cf736ceb18a892346cf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654611808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rFkSp0UE2D0+syEaTeyDa9lpsuHxvvM/VEJFAHgso2k=; b=cqx3sRMahIU+jK7+bctpFpfluhBbNCkjNiumrXOILVdi3B1AiM6Ux5PCnbbLn4oDOClLRW CL5WGElp4QW3ezVs0wV4zPng8X4MqLVpxhL67Kmceos9eWgoIh+gI6ecb8Tes9BymlUV/L rTyI7CBQoM/rIoLx/vV4/880yInm98/AKFuA4cEKrcjTW8o4r+RteHEZb0NMhsyjJhfKWL UJoqBpSR1MLGa9LfMvakGV/ANVRkmYKiYFo2lX/GTCzkgPA8HoJasy8HAE9PBlLHNmAI1V OKQFBVnHGAQKq35Tn+J89ajcnnRkPxSZp1Xz+wUbGDQVrb3aanp4eCeCJ7Pwyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654611808; a=rsa-sha256; cv=none; b=gXJsXC+OX0MNtH5JtZkKEj+QFG1J2WUuTneZeCi3+/qtWGg5V0hVJ2EQgMuXrXyzAAZIxl sCYwbmZ/hMKoALzk84LBousLIcwpGWcEf4zpKP3ppBWJmE9L2EJEhzVDoYLUbDiKYXWcfB e3tpt6NgvoHXf1TkWO7Z4NiFIHUDIZ6hE3WirHgR6bN6zJSEkBrX1IdRrQ2FlvmFsTKkqR lb+Jsn2NmchmsuULtZdXxCmxb8JMzsqy9dZwVWA28UJzXsxOmqM2+wTmHhAImnMwwQalPv 1flyUr/S9fWTjeRYQmnpRB8QGWalc090qjDlUU1++bW3hbvgT6bjLDnABbpLyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=152c34e2dd8e221609928cf736ceb18a892346cf commit 152c34e2dd8e221609928cf736ceb18a892346cf Author: Andrew Turner AuthorDate: 2022-04-07 16:20:04 +0000 Commit: Andrew Turner CommitDate: 2022-06-07 14:20:18 +0000 Use the existing page size in libthr Rather than calling getpagesize() twice use the value saved after the first call to size a mmap allocation. Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34983 (cherry picked from commit 86c500937c4514dda2319f193c4ccc043ffde2b3) --- lib/libthr/thread/thr_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_kern.c b/lib/libthr/thread/thr_kern.c index 1e6338657204..0b83b2dd5ac9 100644 --- a/lib/libthr/thread/thr_kern.c +++ b/lib/libthr/thread/thr_kern.c @@ -158,7 +158,7 @@ _thr_alloc_wake_addr(void) unsigned i; unsigned pagesize = getpagesize(); struct wake_addr *pp = (struct wake_addr *) - mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE, + mmap(NULL, pagesize, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0); for (i = 1; i < pagesize/sizeof(struct wake_addr); ++i) pp[i].link = &pp[i+1];