From nobody Tue May 03 10:05:52 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 59FD11ACDEC7; Tue, 3 May 2022 10:05:52 +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 4KswZm28Jvz4bH2; Tue, 3 May 2022 10:05:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651572352; 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=RMHAQPl1vB+UarW3H5FtlULO/sVkNN1uDv8A3bM1wQw=; b=pkkkayqB3VuVUMj/+dRI7p4xusn7mkJ/AVbBkYxst62F9xFSVNvs+gojGX0PtPgN1XT6dZ hBW4Yk0vCXplXZ93zkrozkXaIeokL/ZwUg05UvILJBPVnYHD5oSTxYCU6JwqS+dKOIWZiz nppR1iprPAE0E7zaJiuTuxMBG0LDpL1ovp1TLp0cnTjGfDwAsRIgAVa2uBfW2LPzmqJGzp R1xLrJUl1yWBxJo/B0VGnOPfb2E67HvL3ziO1fIYrQhPjjzHz8i3aaXZYbtTpymLJHDoQq is2mvJSBKZ+gbqGnZDF7oEof7kHmQhbzJzv3IRDOfBBi5bbs5zNBT7HIUzhf0A== 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 254041C356; Tue, 3 May 2022 10:05:52 +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 243A5qL2053526; Tue, 3 May 2022 10:05:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 243A5qCG053525; Tue, 3 May 2022 10:05:52 GMT (envelope-from git) Date: Tue, 3 May 2022 10:05:52 GMT Message-Id: <202205031005.243A5qCG053525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 86c500937c45 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 86c500937c4514dda2319f193c4ccc043ffde2b3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651572352; 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=RMHAQPl1vB+UarW3H5FtlULO/sVkNN1uDv8A3bM1wQw=; b=txNTs3wl2ryyFqgTuLIBynlmESTatalg+Fu/YHlliwiRIbRjpaxjGAWr/KQKAolv+XnBAC fUmKb7JTnnsC6fVtvon2oZljaAv6oxerlAvTkHPDBGo5cYjG5Sfvc7j+VicZ7sj81dTCIK dzrKueQ8Gw2CVcFvffml/MCqzJn1ndNBWG3Fqicc8edWvuohdFDBfUmwyuEXr5W60utib4 yqrGRXllPgpWclExqDxtWLAjdy1kif2x+h2Z/T7sipBQOuXmW/7Q9B0f2BaV1lt8maw+4v NhwK1zHcInVfGfONBMtSQTh3qnzexVrcqJPamHItsL2Jj/fAc+tf6nJpV3ykQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651572352; a=rsa-sha256; cv=none; b=fa6L7ru/Ywa6hy+2ZD/47iOcui9kL7gRJKuZVElKDiaqFgPV/rDRtSIoiUV0w+01deqI63 4sJXmm4BsdqEksmt4/SbdNgvlY3Zhdv/HytbsPVt5FKhMvvLFbZOPdQsOAmPgyTt+AfFEI i14FtLgu5qjfLhFvWbEgYtgxY12ia6Wsolfk2UNpZ2XpMNaI08QvFW79dsgg2Rn93aat0s 4iBsYSh8HcaQLE6mCtFeTSdGG0I99nRNmf7dIFBGlzRWOZQp5Zx4kO0KSGyVLXDRcU7yvZ kLclJFzh3U3PQpMUOFAkZW4ez4iNb8IJhRWQe+NO6BA2GgmTCs7FSxtXPjIhXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=86c500937c4514dda2319f193c4ccc043ffde2b3 commit 86c500937c4514dda2319f193c4ccc043ffde2b3 Author: Andrew Turner AuthorDate: 2022-04-07 16:20:04 +0000 Commit: Andrew Turner CommitDate: 2022-05-03 10:04:06 +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 --- 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];