public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] mach: Use PAGE_SIZE
@ 2023-02-19 23:46 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2023-02-19 23:46 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=be318c0f38b6b72a0716edce818b755411e75600

commit be318c0f38b6b72a0716edce818b755411e75600
Author: Sergey Bugaev <bugaevc@gmail.com>
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 <bugaevc@gmail.com>
    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 <mach.h>
 #include <mach/mig_support.h>
+#include <mach/vm_param.h>
 #include <unistd.h>
 
 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-19 23:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-19 23:46 [glibc] mach: Use PAGE_SIZE Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).