Page MenuHomeFreeBSD

Make kern.argmax boot tunable
Needs ReviewPublic

Authored by novel on Jun 27 2016, 10:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 1:34 PM
Unknown Object (File)
Mar 24 2024, 8:35 AM
Unknown Object (File)
Feb 22 2024, 11:03 PM
Unknown Object (File)
Jan 19 2024, 10:58 AM
Unknown Object (File)
Dec 19 2023, 11:40 PM
Unknown Object (File)
Dec 13 2023, 4:45 AM
Unknown Object (File)
Nov 13 2023, 8:52 PM
Unknown Object (File)
Nov 13 2023, 11:39 AM
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This is a continuation of effort started here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=58803 with a patch provided Per Hedeland. Frankly, it didn't change much although almost 13 years passed.

I haven't had a close look at the userland part of it, though it seems that some things have improved and a lot more things use sysconf(_SC_ARG_MAX).

I performed some basic testing, i.e. I needed that for some specific need and it fixed my issue.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 7089

Event Timeline

novel retitled this revision from to Make kern.argmax boot tunable.
novel updated this object.
novel edited the test plan for this revision. (Show Details)
novel set the repository for this revision to rS FreeBSD src repository - subversion.

Perhaps this is a good first step regarding ARG_MAX.

The kernel uses ARG_MAX more frequently such as when copying in and out argument strings (including ABI compatibility layers and sysctl kern.proc.<N>.args), which are not adjusted by the patch.

sys/kern/kern_mib.c
115 ↗(On Diff #17954)

Please do not remove CTLFLAG_CAPRD here.

sys/kern/subr_param.c
86 ↗(On Diff #17954)

Are these conditional #defines necessary? The conditional #defines above seem to allow for optional values in the kernel configuration, but ARG_MAX and _POSIX_ARG_MAX are defined in header files. Changing _POSIX_ARG_MAX in a kernel configuration definitely does not make sense.

sys/vm/vm_init.c
267 ↗(On Diff #17954)

This will use more kernel virtual address space (KVA) which may be a problem on 32-bit systems. Users can work around this by setting the tunable vm.exec_map_entries lower (default 16).

Perhaps we want to treat small arguments lists specially or copy from old to new address space directly.

Thanks for looking! I'll update the patch to include missing bits.

Added some inline comments as well...

sys/kern/kern_mib.c
115 ↗(On Diff #17954)

Will add it back.

sys/kern/subr_param.c
86 ↗(On Diff #17954)

ARG_MAX holds the default size of arg max. _POSIX_ARG_MAX is the minimum value we allow for arg max. Do you mean it should be just inlined?

sys/vm/vm_init.c
267 ↗(On Diff #17954)

Honestly speaking, that's something I have to look deeper to understand. Pointers where to start would be much appreciated.

sys/kern/subr_param.c
86 ↗(On Diff #17954)

The value of ARG_MAX should be obtained from <sys/syslimits.h>. The definition of _POSIX_ARG_MAX should probably be moved from include/limits.h to something under sys/ that can be included here.

sys/vm/vm_init.c
267 ↗(On Diff #17954)

For copying from old to new address space, see proc_rwmem() in sys/kern/sys_process.c.

Just rebase onto fresh -CURRENT.