From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1792) id F23F13858D37; Sun, 19 Feb 2023 23:46:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F23F13858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676850419; bh=lkvga07YFf3IqkRo58RvYfqy5GyRxXUV3y7TteO156A=; h=From:To:Subject:Date:From; b=BpX9vj48M5b8gZnh3BJFWgHVDAyc18s+mZeRIXLyyk9QwVJbXTOLliLOr7t1urRvP qgzZf0m7blaQsT2I1rEf8gLJ4kD1ne2MsbFMjRf1TFmMclbT5zqZUHdDD6ricz+Pmz zWjEKItX4tor3HtTxVQXKxQpsVvTktM6ZVNmZKCU= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Samuel Thibault To: glibc-cvs@sourceware.org Subject: [glibc] mach: Use PAGE_SIZE X-Act-Checkin: glibc X-Git-Author: Sergey Bugaev X-Git-Refname: refs/heads/master X-Git-Oldrev: 90ab316b02d496cfaf09396fcc0c9bc58f15a61c X-Git-Newrev: be318c0f38b6b72a0716edce818b755411e75600 Message-Id: <20230219234659.F23F13858D37@sourceware.org> Date: Sun, 19 Feb 2023 23:46:59 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=be318c0f38b6b72a0716edce818b755411e75600 commit be318c0f38b6b72a0716edce818b755411e75600 Author: Sergey Bugaev Date: Sat Feb 18 23:37:14 2023 +0300 mach: Use PAGE_SIZE The PAGE_SIZE from the Mach headers statically defines the machine's page size. There's no need to query it dynamically; furthermore, the implementation of the vm_statistics () RPC unconditionally fills in pagesize = PAGE_SIZE; Not doing the extra RPC shaves off 2 RPCs from the start-up of every process! Signed-off-by: Sergey Bugaev Message-Id: <20230218203717.373211-7-bugaevc@gmail.com> Diff: --- mach/mach_init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mach/mach_init.c b/mach/mach_init.c index a0d9f7f5e2..42b9cacf68 100644 --- a/mach/mach_init.c +++ b/mach/mach_init.c @@ -17,6 +17,7 @@ #include #include +#include #include mach_port_t __mach_task_self_; @@ -38,7 +39,10 @@ __mach_init (void) __mach_host_self_ = (__mach_host_self) (); __mig_init (0); -#ifdef HAVE_HOST_PAGE_SIZE +#ifdef PAGE_SIZE + __vm_page_size = PAGE_SIZE; + (void) err; +#elif defined (HAVE_HOST_PAGE_SIZE) if (err = __host_page_size (__mach_host_self (), &__vm_page_size)) _exit (err); #else