History log of /openbsd/sys/sys/sysctl.h (Results 1 – 25 of 240)
Revision Date Author Comments
# b3802834 04-Nov-2024 jsg <jsg@openbsd.org>

correct HW_MAXID; ok deraadt@ jca@ kettenis@


# 2cfc28ad 26-Oct-2024 jsg <jsg@openbsd.org>

remove unneeded forward struct declarations


# 51c8e26b 30-Sep-2024 claudio <claudio@openbsd.org>

Use ps_ppid instead of ps_pptr->ps_pid in all places.
OK mpi@


# d800346e 02-Aug-2024 mvs <mvs@openbsd.org>

Push kernel lock down to sysctl(2).

Unlock few obvious immutable or read-only variables from "kern.*" and
"hw.*" paths. Keep the rest variables locked as before, include pages
wiring. Use new sysctl

Push kernel lock down to sysctl(2).

Unlock few obvious immutable or read-only variables from "kern.*" and
"hw.*" paths. Keep the rest variables locked as before, include pages
wiring. Use new sysctl_vs{,un}lock() functions introduced for thar
purpose.

In kern.* path:

- KERN_OSTYPE, KERN_OSRELEASE, KERN_OSVERSION, KERN_VERSION -
immutable;
- KERN_NUMVNODES - read-only access to integer;
- KERN_MBSTAT - read-only access to per-CPU counters;

In hw.* path:

- HW_MACHINE, HW_MODEL, HW_NCPUONLINE, HW_PHYSMEM, HW_VENDOR,
HW_PRODUCT, HW_VERSION, HW_SERIALNO, HW_UUID, HW_PHYSMEM64 -
immutable;
- HW_USERMEM and HW_USERMEM64 - `physmem' is immutable, uvmexp.wired
is mutable but integer; read-only access to localy stored difference
between `physmem' and uvmexp.wired;
- `hw_vars' - read-only access to integers; some of them like
HW_BYTEORDER and HW_PAGESIZE are immutable;

ok bluhm kettenis

show more ...


# 241d6723 08-Jul-2024 claudio <claudio@openbsd.org>

Rework per proc and per process time usage accounting

For procs (threads) the accounting happens now lockless by curproc using
a generation counter. Callers need to use tu_enter() and tu_leave() for

Rework per proc and per process time usage accounting

For procs (threads) the accounting happens now lockless by curproc using
a generation counter. Callers need to use tu_enter() and tu_leave() for this.
To read the proc p_tu struct tuagg_get_proc() should be used. It ensures
that the values read is consistent.

For processes only the time of exited threads is accumulated in ps_tu and
to get the proper process time usage tuagg_get_process() needs to be called.
tuagg_get_process() will sum up all procs p_tu plus the ps_tu.

This removes another SCHED_LOCK() dependency. Adjust the code in
exit1() and exit2() to correctly account for the full run time.
For this adjust sched_exit() to do the runtime accounting like it is done
in mi_switch().

OK jca@ dlg@

show more ...


# 36bb8c29 01-Oct-2023 krw <krw@openbsd.org>

Add sysctl hw.ucomnames to list 'fixed' paths to USB serial
ports.

Suggested by deraadt@, USB route idea from kettenis@. Feedback
from anton@, man page improvements from deraadt@, jmc@,
schwarze@.

Add sysctl hw.ucomnames to list 'fixed' paths to USB serial
ports.

Suggested by deraadt@, USB route idea from kettenis@. Feedback
from anton@, man page improvements from deraadt@, jmc@,
schwarze@.

ok deraadt@ kettenis@

show more ...


# 5d90c77a 04-Jul-2023 jsg <jsg@openbsd.org>

remove prototypes for removed functions


# 22acc011 17-May-2023 kettenis <kettenis@openbsd.org>

Implement battery management sysctl. This will provide a set of sysctls
to control the charging of laptop batteries:

* hw.battery.chargemode (int)

-1: force discharge
0: inhibit charge
1:

Implement battery management sysctl. This will provide a set of sysctls
to control the charging of laptop batteries:

* hw.battery.chargemode (int)

-1: force discharge
0: inhibit charge
1: auto

In auto mode charging may be controlled by:

* hw.battery.chargestop (int)

Percentage (0-100) of last full capacity at which the battery should
stop charging.

* hw.battery.chargestart (int)

Percentage (0-100) of last full capacity at which the battery should
start charging.

The idea is that with

hw.battery.chargemode=1
hw.battery.chargestop=80
hw.battery.chargestart=75

the battery would be kept charged within the range between 75% and 80%.

Allowable settings and some details of the behavior may differ between
hardware implementations.

Committing this early to easy testing of further diffs that implement this
functionality in acpithinkpad(4) and aplsmc(4).

ok kn@

show more ...


# cef5a146 07-Jan-2023 guenther <guenther@openbsd.org>

Add {get,set}thrname(2) for putting thread names in the kernel and
exposed in a new field returned by sysctl(KERN_PROC). Update
pthread_{get,set}_name_np(3) to use the syscalls. Show them, when
set

Add {get,set}thrname(2) for putting thread names in the kernel and
exposed in a new field returned by sysctl(KERN_PROC). Update
pthread_{get,set}_name_np(3) to use the syscalls. Show them, when
set, in ps -H and top -H output.

libc and libpthread minor bumps

ok mpi@, mvs@, deraadt@

show more ...


# 45a1a30e 07-Nov-2022 robert <robert@openbsd.org>

introduce a new kern.autoconf_serial sysctl that can be used by userland
to monitor state changes of the kernel device tree

input from dnd ok dlg@, deraadt@


# 329e3480 05-Nov-2022 cheloha <cheloha@openbsd.org>

clockintr(9): initial commit

clockintr(9) is a machine-independent clock interrupt scheduler. It
emulates most of what the machine-dependent clock interrupt code is
doing on every platform. Every

clockintr(9): initial commit

clockintr(9) is a machine-independent clock interrupt scheduler. It
emulates most of what the machine-dependent clock interrupt code is
doing on every platform. Every CPU has a work schedule based on the
system uptime clock. For now, every CPU has a hardclock(9) and a
statclock(). If schedhz is set, every CPU has a schedclock(), too.

This commit only contains the MI pieces. All code is conditionally
compiled with __HAVE_CLOCKINTR. This commit changes no behavior yet.

At a high level, clockintr(9) is configured and used as follows:

1. During boot, the primary CPU calls clockintr_init(9). Global state
is initialized.
2. Primary CPU calls clockintr_cpu_init(9). Local, per-CPU state is
initialized. An "intrclock" struct may be installed, too.
3. Secondary CPUs call clockintr_cpu_init(9) to initialize their
local state.
4. All CPUs repeatedly call clockintr_dispatch(9) from the MD clock
interrupt handler. The CPUs complete work and rearm their local
interrupt clock, if any, during the dispatch.
5. Repeat step (4) until the system shuts down, suspends, or hibernates.
6. During resume, the primary CPU calls inittodr(9) and advances the
system uptime.
7. Go to step (2). This time around, clockintr_cpu_init(9) also
advances the work schedule on the calling CPU to skip events that
expired during suspend. This prevents a "thundering herd" of
useless work during the first clock interrupt.

In the long term, we need an MI clock interrupt scheduler in order to
(1) provide control over the clock interrupt to MI subsystems like
timeout(9) and dt(4) to improve their accuracy, (2) provide drivers
like acpicpu(4) a means for slowing or stopping the clock interrupt on
idle CPUs to conserve power, and (3) reduce the amount of duplicated
code in the MD clock interrupt code.

Before we can do any of that, though, we need to switch every platform
over to using clockintr(9) and do some cleanup.

Prompted by "the vmm(4) time bug," among other problems, and a
discussion at a2k19 on the subject. Lots of design input from
kettenis@. Early versions reviewed by kettenis@ and mlarkin@.
Platform-specific help and testing from kettenis@, gkoehler@,
mlarkin@, miod@, aoyama@, visa@, and dv@. Babysitting and spiritual
guidance from mlarkin@ and kettenis@.

Link: https://marc.info/?l=openbsd-tech&m=166697497302283&w=2

ok kettenis@ mlarkin@

show more ...


# 9bf42e34 16-Aug-2022 visa <visa@openbsd.org>

Remove obsolete kern.nselcoll sysctl.

OK millert@ deraadt@


# 77aba2be 13-May-2022 claudio <claudio@openbsd.org>

Use the process ps_mtx to protect the process sigacts structure.
With this cursig(), postsig() and trapsignal() become safe to be called
without KERNEL_LOCK. As a side-effect sleep with PCATCH no lon

Use the process ps_mtx to protect the process sigacts structure.
With this cursig(), postsig() and trapsignal() become safe to be called
without KERNEL_LOCK. As a side-effect sleep with PCATCH no longer needs
the KERNEL_LOCK either. Since sending a signal can happen from interrupt
context raise the ps_mtx IPL to high.
Feedback from mpi@ and kettenis@
OK kettenis@

show more ...


# ce05de28 25-Feb-2022 rob <rob@openbsd.org>

A few additional changes related to the now 32 bit accounting flag.
Pointers from and discussions with millert and deraadt.
Ok millert@, deraadt@, bluhm@


# f862925e 22-Feb-2022 deraadt <deraadt@openbsd.org>

sysctl already passed the commandname as a 24-byte string KI_MAXCOMLEN
because it was padded. Define it in terms of _MAXCOMLEN from syslimits.h
ok millert


# 44dfbf20 22-Feb-2022 deraadt <deraadt@openbsd.org>

The FILL_KPROC() macro should be useable in situations where sys/param.h
hasn't been included, so the use of MIN() is not legit, and a local
version is required.


# 0407a8a1 14-Feb-2022 rob <rob@openbsd.org>

Revert change to ps for displaying chrooted process.
Ok deraadt


# a7a55cec 07-Feb-2022 rob <rob@openbsd.org>

New status flag: 'c' - process is chrooted.
Feedback and tweaks from deraadt@ guenther@
Ok bluhm@ deraadt@


# 4cd1828e 25-Jan-2022 gnezdo <gnezdo@openbsd.org>

Capture a repeated pattern into sysctl_securelevel_int function

A few variables in the kernel are only writeable before securelevel is
raised. It makes sense to handle them with less code.

OK sthen

Capture a repeated pattern into sysctl_securelevel_int function

A few variables in the kernel are only writeable before securelevel is
raised. It makes sense to handle them with less code.

OK sthen@ bluhm@

show more ...


# 2d7f2af4 11-Jan-2022 jsg <jsg@openbsd.org>

spelling


# 4ed6f7c2 07-Dec-2021 guenther <guenther@openbsd.org>

Delete the last emulation callbacks: we're Just ELF, so declare
exec_elf_fixup() and coredump_elf() in <sys/exec_elf.h> and call
them and the MD setregs() directly in kern_exec.c and kern_sig.c

Also

Delete the last emulation callbacks: we're Just ELF, so declare
exec_elf_fixup() and coredump_elf() in <sys/exec_elf.h> and call
them and the MD setregs() directly in kern_exec.c and kern_sig.c

Also delete e_name[] (only used by sysctl), e_errno (unused), and
e_syscallnames[] (only used by SYSCALL_DEBUG) and constipate
syscallnames to 'const char *const[]'

ok kettenis@

show more ...


# 0294e0be 30-Oct-2021 deraadt <deraadt@openbsd.org>

Change hw.perfpolicy=auto by default, at startup. If the system has AC
power connected (default is yes when no driver differentiates) then default
to 100% performance. On battery, use the existing a

Change hw.perfpolicy=auto by default, at startup. If the system has AC
power connected (default is yes when no driver differentiates) then default
to 100% performance. On battery, use the existing auto algorithm (which is
admittedly somewhat unrefined).
This change overrides the system/BIOS speed and puts OpenBSD in control.
As this happens very early during boot, besides speedups in all usage usage
patterns, some surprises: unhibernate and sysupgrade times are cut in half.
note: on a few architectures, the setperf fn pointer is changed late, and
thus the auto algorithm stops timeing out. kettenis and i will look for
a solution.
in snaps for more than a week.
ok kettenis

show more ...


# 4ccf9104 17-May-2021 claudio <claudio@openbsd.org>

Forgot this directory in last commit for the UNIX-domain socket buffer
change.


# 70de0cbd 04-May-2021 bluhm <bluhm@openbsd.org>

Reorder the integer sysctl functions. Then the traditional 4.4BSD
comment 'As above...' makes sense again. Improve comments for
sysctl_int_bounded() and sysctl_bounded_arr().
OK gnezdo@ mvs@


# f8e80a28 01-May-2021 gnezdo <gnezdo@openbsd.org>

Removed unused SYSCTL_INT_UNBOUNDED (no use planned)

Added a comment for SYSCTL_INT_READONLY.

OK mvs@


12345678910