From: Petr Vorel <pvorel@suse.cz>
To: Terry Tritton <terry.tritton@linaro.org>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] ioctl_pidfd02-06: Add CONFIG_USER_NS and CONFIG_PID_NS to needs_kconfigs
Date: Mon, 5 Jan 2026 15:11:36 +0100 [thread overview]
Message-ID: <20260105141136.GE654507@pevik> (raw)
In-Reply-To: <CABeuJB2TJ4bQDX709-sLO0tb0acYH770kS6X5zXMh0V0M3Yt-w@mail.gmail.com>
> Hi,
> > On Mon Dec 15, 2025 at 5:52 PM CET, Petr Vorel wrote:
> > > > > And https://www.man7.org/linux/man-pages/man7/user_namespaces.7.html.
> > > > > Yeah, I understand that. The dependency of CLONE_NEWUSER/CLONE_NEWPID is also
> > > > > visible in kernel sources (e.g. fs/nsfs.c). But my question was different:
> > > > > Do we now prefer everything kind of document with .needs_kconfigs, even it's
> > > > > possible to detect it otherwise? (speed of parsing kconfig, kind of hard request
> > > > > for kconfig being available even we can figure the support otherwise).
> > > > I believe we shouldn't see this as black/white but use this feature when
> > > > it's really needed. This is the case.
> > > Sure, .needs_kconfigs is used when test request some functionality based on
> > > kconfig. But many tests use /proc or /sys based detection (e.g. ioctl_ns06.c)
> > > or based on certain errno, see include/lapi/syscalls.h or
> > > testcases/kernel/syscalls/fanotify/fanotify.h) because these were
> > > added before LTP supported kconfig. Later, when kconfig was added it was
> > > considering as a last resort (when there was no way to detect dependency
> > > otherwise).
> > > Have we decide to move everything into kconfig?
> > > I'm not sure myself. needs_kconfigs is simpler and obvious, but it requires
> > > kernel config. I suppose the speed of parsing config is not an issue.
> > > It'd be nice to mention the resolution (preferred vs. only if no other way to
> > > detect the support) into
> > > https://linux-test-project.readthedocs.io/en/latest/developers/writing_tests.html
> > Feel free to add this comment, but for me it's obvious that if a
> > feature can't be present in the kernel due to kconfigs we should check
> > kconfig :-)
> I've just taken another look at this and it appears the test would still
> fail if the config is not present or if KCONFIG_SKIP_CHECK is set, in
> which case perhaps the run time detection may be preferred as it will
> still work in these cases?
Maybe I'm missing something obvious. IMHO kconfig check for CONFIG_USER_NS and
CONFIG_PID_NS is equal to checking for /proc/self/ns/user and /proc/self/ns/pid.
"runtime detection" you mean looking at /proc, but actually both ways are
"runtime detections" because LTP expects correct kernel config for running
kernel or looks into /proc/config.gz.
Just looking at /proc is faster and works without KCONFIG_SKIP_CHECK. OTOH
kconfig is somehow documenting it. It could be documented in normal test doc if
we inspect /proc.
@Li @Cyril, I'm sorry to raise this again (I haven't found a thread in which we
discussed it last time). Which one do we prefer in case both can be used?
> I'm not sure how common either of those cases are though?
> Would it be better to have the run time detection in tst_kconfig_check
> as a fall back in case the config is not present?
> Then the tests can just define the needs_kconfigs and not have to worry
> about other checks.
Using both looks to me overkill.
Kind regards,
Petr
> > > or into upcommig doc/developers/ground_rules.rst
> > > https://patchwork.ozlabs.org/project/ltp/patch/20251215124404.16395-2-chrubis@suse.cz/
> > > Kind regards,
> > > Petr
> > > > > And if we decide for forcing kconfig, we should update ioctl_ns06.c, which does
> > > > > /proc based detection (i.e. to use the same approach).
> > > > I didn't check this, but I'm pretty sure we should go all around and
> > > > verify many other tests with the same issue. We should do it in this
> > > > patch-set or on a searate one.
> > > > > Kind regards,
> > > > > Petr
> > So what we do with the patch? Should we merge it?
> I'm happy to go through and update other tests in this patch or another.
> Thanks
> Terry
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-01-05 14:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 21:16 [LTP] [PATCH] ioctl_pidfd02-06: Add CONFIG_USER_NS and CONFIG_PID_NS to needs_kconfigs Terry Tritton
2025-12-12 10:20 ` Andrea Cervesato via ltp
2025-12-15 15:53 ` Petr Vorel
2025-12-15 15:59 ` Andrea Cervesato via ltp
2025-12-15 16:13 ` Petr Vorel
2025-12-15 16:23 ` Andrea Cervesato via ltp
2025-12-15 16:52 ` Petr Vorel
2025-12-18 8:18 ` Andrea Cervesato via ltp
2026-01-05 13:50 ` Terry Tritton
2026-01-05 14:11 ` Petr Vorel [this message]
2026-01-07 16:00 ` Cyril Hrubis
2026-01-07 16:06 ` Petr Vorel
2026-01-07 16:16 ` Cyril Hrubis
2026-01-07 16:18 ` Petr Vorel
2026-01-08 7:26 ` Jan Stancek via ltp
2026-01-08 13:31 ` Petr Vorel
2026-01-28 7:24 ` Petr Vorel
2026-01-29 15:08 ` Cyril Hrubis
2026-01-29 23:58 ` Petr Vorel
2026-01-29 15:06 ` Cyril Hrubis
2026-01-30 0:27 ` Petr Vorel
2026-01-30 0:41 ` Li Wang via ltp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260105141136.GE654507@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=terry.tritton@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox