git: 964a91aac9c9 - stable/14 - proc: Add sysctl flag CTLFLAG_TUN to loader tunable

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Thu, 12 Oct 2023 04:10:01 UTC
The branch stable/14 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=964a91aac9c99d16294bc76d942de7bcc2a1b169

commit 964a91aac9c99d16294bc76d942de7bcc2a1b169
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-10-09 10:30:22 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-10-12 04:08:20 +0000

    proc: Add sysctl flag CTLFLAG_TUN to loader tunable
    
    The sysctl variable 'kern.kstack_pages' is actually a loader tunable.
    Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it
    correctly.
    
    No functional change intended.
    
    Note that on arm64 the thread0 stack size can not be controlled with it,
    kib@ suggested that arm64 maintainers can fix it eventually so let's
    enable it also on arm64 right now.
    
    Reviewed by:    kib, imp
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D42113
    
    (cherry picked from commit 35b3be81f1d9fe38457d9137bef7a2875d24e2c8)
---
 sys/kern/kern_proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index cccce834e284..2daf39b398b5 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -161,7 +161,8 @@ EVENTHANDLER_LIST_DEFINE(process_fork);
 EVENTHANDLER_LIST_DEFINE(process_exec);
 
 int kstack_pages = KSTACK_PAGES;
-SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0,
+SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
+    &kstack_pages, 0,
     "Kernel stack size in pages");
 static int vmmap_skip_res_cnt = 0;
 SYSCTL_INT(_kern, OID_AUTO, proc_vmmap_skip_resident_count, CTLFLAG_RW,