Index | Thread | Search

From:
Philip Guenther <guenther@gmail.com>
Subject:
Re: remove redundant kernel data
To:
Miod Vallat <miod@online.fr>
Cc:
tech@openbsd.org
Date:
Wed, 27 Mar 2024 14:28:01 -0700

Download raw body.

Thread
ok guenther@

Or maybe keep it but make it a read-write sysctl entry instead?  Might be
interesting to try running a system with different page sizes!


Philip


On Wed, Mar 27, 2024 at 1:18 PM Miod Vallat <miod@online.fr> wrote:

> There is no need to have an extra global variable storing the MMU page
> size.
>
> Index: sys/kern/kern_sysctl.c
> ===================================================================
> RCS file: /OpenBSD/src/sys/kern/kern_sysctl.c,v
> retrieving revision 1.411
> diff -u -p -r1.411 kern_sysctl.c
> --- sys/kern/kern_sysctl.c      22 Jan 2023 12:05:44 -0000      1.411
> +++ sys/kern/kern_sysctl.c      25 Mar 2024 19:44:12 -0000
> @@ -664,13 +664,12 @@ int hw_power = 1;
>
>  /* morally const values reported by sysctl_bounded_arr */
>  static int byte_order = BYTE_ORDER;
> -static int page_size = PAGE_SIZE;
>
>  const struct sysctl_bounded_args hw_vars[] = {
>         {HW_NCPU, &ncpus, SYSCTL_INT_READONLY},
>         {HW_NCPUFOUND, &ncpusfound, SYSCTL_INT_READONLY},
>         {HW_BYTEORDER, &byte_order, SYSCTL_INT_READONLY},
> -       {HW_PAGESIZE, &page_size, SYSCTL_INT_READONLY},
> +       {HW_PAGESIZE, &uvmexp.pagesize, SYSCTL_INT_READONLY},
>         {HW_DISKCOUNT, &disk_count, SYSCTL_INT_READONLY},
>         {HW_POWER, &hw_power, SYSCTL_INT_READONLY},
>  };
>
>