I'm looking to solicit opinions on when it is appropriate for an
ebuild to check for kernel config options using linux-info.eclass. I
don't think we have any guidelines documented, instead leaving it up
to the "common sense" of package maintainers.
Adding linux-info calls to pkg_pretend or pkg_setup causes slowdowns
when running emerge, so we should do so only when there is a
compensating benefit. It doesn't make sense to check for kernel
options that are very commonly enabled. But what is "very common"?
An obvious example would be CONFIG_INET, which controls IPv4 support
in the kernel. It does not make sense to check for that in every
package that uses AF_INET sockets.
A less obvious example: a user filed a bug against net-misc/dhcpcd
today asking that we check for CONFIG_PACKET [1]. My first thought was
"why would you ever disable that?". The option description even says
"if unsure, say Y". However, I suppose it is technically possible to
run a Linux system with it disabled.
I think a reasonable rule of thumb would be to assume we can rely on
options that are enabled by "make defconfig". If the user chooses to
disable them, they are responsible for anything that breaks.
Thoughts?
[1] https://bugs.gentoo.org/815064
Adding linux-info calls to pkg_pretend or pkg_setup causes slowdowns
when running emerge, so we should do so only when there is a
compensating benefit.
Adding linux-info calls to pkg_pretend or pkg_setup causes slowdowns
when running emerge, so we should do so only when there is a
compensating benefit.
Is this a significant slowdown? Do you have any numbers?
On Mon, Sep 27, 2021 at 12:23 PM Mike Pagano <mpagano@gentoo.org> wrote:7 seconds is ridiculous.
Adding linux-info calls to pkg_pretend or pkg_setup causes slowdowns
when running emerge, so we should do so only when there is a
compensating benefit.
Is this a significant slowdown? Do you have any numbers?
Adding a check for CONFIG_PACKET to the dhcpcd ebuild adds around 7
seconds of delay time to the pkg_setup and/or pkg_pretend phase on my
system.
That's ok if a small number of packages are doing it, but it would
become quite annoying if a significant number of them get queued up.
I think we need to strip out a lot of the crap about trying to detect
things in the stuff being built, and reduce the check to the simplest possible form:
$ time zgrep -w CONFIG_PACKET /proc/config.gz
CONFIG_PACKET=y
On 9/27/21 12:10 PM, Mike Gilbert wrote:
I'm looking to solicit opinions on when it is appropriate for an
ebuild to check for kernel config options using linux-info.eclass. I
don't think we have any guidelines documented, instead leaving it up
to the "common sense" of package maintainers.
Adding linux-info calls to pkg_pretend or pkg_setup causes slowdowns
when running emerge, so we should do so only when there is a
compensating benefit. It doesn't make sense to check for kernel
options that are very commonly enabled. But what is "very common"?
An obvious example would be CONFIG_INET, which controls IPv4 support
in the kernel. It does not make sense to check for that in every
package that uses AF_INET sockets.
A less obvious example: a user filed a bug against net-misc/dhcpcd
today asking that we check for CONFIG_PACKET [1]. My first thought was
"why would you ever disable that?". The option description even says
"if unsure, say Y". However, I suppose it is technically possible to
run a Linux system with it disabled.
I think a reasonable rule of thumb would be to assume we can rely on options that are enabled by "make defconfig". If the user chooses to disable them, they are responsible for anything that breaks.
Thoughts?
[1] https://bugs.gentoo.org/815064
The challenge I see is that these config checks head off bugs and issues without our intervention.
We as kernel maintainers depend on ebuild maintainers to check these things so they don't become "kernel bugs" to figure out.
On Mon, Sep 27, 2021 at 01:15:10PM -0400, Mike Gilbert wrote:
On Mon, Sep 27, 2021 at 12:23 PM Mike Pagano <mpagano@gentoo.org> wrote:
Adding linux-info calls to pkg_pretend or pkg_setup causes slowdowns when running emerge, so we should do so only when there is a compensating benefit.
Is this a significant slowdown? Do you have any numbers?
Adding a check for CONFIG_PACKET to the dhcpcd ebuild adds around 7
seconds of delay time to the pkg_setup and/or pkg_pretend phase on my system.
That's ok if a small number of packages are doing it, but it would7 seconds is ridiculous.
become quite annoying if a significant number of them get queued up.
On Mon, Sep 27, 2021 at 1:44 PM Robin H. Johnson <robbat2@gentoo.org> wrote:
On Mon, Sep 27, 2021 at 01:15:10PM -0400, Mike Gilbert wrote:
On Mon, Sep 27, 2021 at 12:23 PM Mike Pagano <mpagano@gentoo.org> wrote: >>>>> Adding linux-info calls to pkg_pretend or pkg_setup causes slowdowns >>>>> when running emerge, so we should do so only when there is a7 seconds is ridiculous.
compensating benefit.
Is this a significant slowdown? Do you have any numbers?
Adding a check for CONFIG_PACKET to the dhcpcd ebuild adds around 7
seconds of delay time to the pkg_setup and/or pkg_pretend phase on my
system.
That's ok if a small number of packages are doing it, but it would
become quite annoying if a significant number of them get queued up.
I think the horribly slow performance is mainly due to this change in
how we detect the kernel version:
https://gitweb.gentoo.org/repo/gentoo.git/commit/eclass/linux-info.eclass?id=d1ea596f034285cd044006b107a60902ea059793
That causes "make" to be called 4 times, and each make invocation adds
a couple of seconds to the get_version call.
On Mon, Sep 27, 2021 at 1:44 PM Robin H. Johnson <robbat2@gentoo.org> wrote:
I think we need to strip out a lot of the crap about trying to detect things in the stuff being built, and reduce the check to the simplest possible form:
$ time zgrep -w CONFIG_PACKET /proc/config.gz
CONFIG_PACKET=y
Sure, just please don't strip out the part that actually does what you
just did - check the running kernel. I don't think we should assume
that the user has the configured+prepared sources for a kernel just
lying around all the time. I don't build in /usr/src (which is
apparently discouraged by upstream anyway), so /proc/config.gz is
really the only reliable indication of how things are setup. Well,
that or a config file in /boot which I'm sure others don't use (but
make install puts it there).
It's a waste of time and effort to pepper random ebuilds with checks
for options that everyone should have enabled in the first place.
Mike Gilbert wrote:
It's a waste of time and effort to pepper random ebuilds with checks
for options that everyone should have enabled in the first place.
It's not for you to say what everyone should have enabled in their kernel.
I think we need to strip out a lot of the crap about trying to detect
things in the stuff being built, and reduce the check to the simplest possible form:
$ time zgrep -w CONFIG_PACKET /proc/config.gz
CONFIG_PACKET=y
On Mon, Sep 27, 2021 at 11:44 AM Robin H. Johnson <robbat2@gentoo.org> wrote:
I think we need to strip out a lot of the crap about trying to detect things in the stuff being built, and reduce the check to the simplest possible form:
$ time zgrep -w CONFIG_PACKET /proc/config.gz
CONFIG_PACKET=y
The results from our current method could of course be cached, and
even cached between runs, by just relying on `/proc/version` changing
for different kernels. This seems easy enough to do.
Alternatively, sure, we could require that everyone has /proc/config
in their kernel config. Many kernels don't have this (mine doesn't),
but we could add it to the base requirements.
It's a waste of time and effort to pepper random ebuilds with checks
for options that everyone should have enabled in the first place.
It's not for you to say what everyone should have enabled in their kernel.
Do you not agree that there are some options that should always be
enabled, or at least that we can assume are enabled?
To use my earlier example, should every package that uses AF_INET
check for CONFIG_INET in the kernel?
On Mon, Sep 27, 2021 at 3:11 PM Peter Stuge <peter@stuge.se> wrote:
Mike Gilbert wrote:
It's a waste of time and effort to pepper random ebuilds with checks
for options that everyone should have enabled in the first place.
It's not for you to say what everyone should have enabled in their kernel.
Do you not agree that there are some options that should always be
enabled, or at least that we can assume are enabled?
I'm looking to solicit opinions on when it is appropriate for an
ebuild to check for kernel config options using linux-info.eclass. I
don't think we have any guidelines documented, instead leaving it up
to the "common sense" of package maintainers.
<snip>
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 234:11:46 |
Calls: | 6,624 |
Files: | 12,172 |
Messages: | 5,319,694 |