Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #81430 > unrolled thread

Bug#1059969: linux-image-6.6.9-amd64: CONFIG_MODULE_COMPRESS_XZ=y breaks cpu frequency scaling governor kernel module

Started byLuca Boccassi <bluca@debian.org>
First post2024-01-04 12:40 +0100
Last post2024-01-04 16:50 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.debian.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Bug#1059969: linux-image-6.6.9-amd64: CONFIG_MODULE_COMPRESS_XZ=y breaks cpu frequency scaling governor kernel module Luca Boccassi <bluca@debian.org> - 2024-01-04 12:40 +0100
    Bug#1059969: linux-image-6.6.9-amd64: CONFIG_MODULE_COMPRESS_XZ=y breaks cpu frequency scaling governor kernel module Jy Deng <1700011628@pku.edu.cn> - 2024-01-04 14:50 +0100
      Bug#1059969: linux-image-6.6.9-amd64: CONFIG_MODULE_COMPRESS_XZ=y breaks cpu frequency scaling governor kernel module Diederik de Haas <didi.debian@cknow.org> - 2024-01-04 15:20 +0100
        Bug#1059969: linux-image-6.6.9-amd64: CONFIG_MODULE_COMPRESS_XZ=y breaks cpu frequency scaling governor kernel module Jy Deng <1700011628@pku.edu.cn> - 2024-01-04 16:00 +0100
        Bug#1059969: linux-image-6.6.9-amd64: CONFIG_MODULE_COMPRESS_XZ=y breaks cpu frequency scaling governor kernel module Jy Deng <1700011628@pku.edu.cn> - 2024-01-04 16:50 +0100

#81430 — Bug#1059969: linux-image-6.6.9-amd64: CONFIG_MODULE_COMPRESS_XZ=y breaks cpu frequency scaling governor kernel module

FromLuca Boccassi <bluca@debian.org>
Date2024-01-04 12:40 +0100
SubjectBug#1059969: linux-image-6.6.9-amd64: CONFIG_MODULE_COMPRESS_XZ=y breaks cpu frequency scaling governor kernel module
Message-ID<HSueR-IDo-3@gated-at.bofh.it>
On Thu, 04 Jan 2024 17:16:57 +0800 Jy Deng <1700011628@pku.edu.cn>
wrote:
> Package: src:linux
> Version: 6.6.9-1
> Severity: normal
> Tags: patch
> X-Debbugs-Cc: 1700011628@pku.edu.cn
> 
> Dear Maintainer,
> 
> In short, current configuration of debian kernel makes some scaling
governors
> not usable, for example amd_pstate=passive Ondemand. Some small
changes to
> configuration can solve the problem.
> 
> To sovle the problem there is two optional ways:
> 1. Change some configurations like CONFIG_CPU_FREQ_GOV_POWERSAVE to y
rather
> than m
> All the configuraion below needs to be chanegd to y:
> CONFIG_CPU_FREQ_GOV_POWERSAVE=y
> CONFIG_CPU_FREQ_GOV_USERSPACE=y
> CONFIG_CPU_FREQ_GOV_ONDEMAND=y
> CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
> 
> 2. Change the configuration CONFIG_MODULE_COMPRESS_XZ=y to
> CONFIG_MODULE_COMPRESS_NONE=y
> Notice that CONFIG_MODULE_COMPRESS_XZ=y not only breaks cpu frequency
governors
> but also breaks make bindeb-pkg. See
> https://bugzilla.kernel.org/show_bug.cgi?id=218341
> So that choose this option can deal with this issue too.
> 
> Two file attached is about the two ways above to fix the problem.
> 
> 
> 
> Here is some explanation:
> 
> Debian kernel used to set configuration as
CONFIG_MODULE_COMPRESS_NONE=y. but
> after 6.6 debian kernel configuration use CONFIG_MODULE_COMPRESS_XZ=y
to
> compress the kernel module. However, modules for cpu frequency
governors is not
> usable when it's module is compressed.
> 
> For example, CONFIG_CPU_FREQ_GOV_POWERSAVE=m is fine to work if
> CONFIG_MODULE_COMPRESS_NONE=y , but if CONFIG_MODULE_COMPRESS_XZ=y is
set then
> powersave governor is unavailable. This problem is same to other cpu
frequency
> governor configurations like CONFIG_CPU_FREQ_GOV_ONDEMAND=m
> 
> On the other hand, configuration like CONFIG_CPU_FREQ_GOV_POWERSAVE=y
build the
> governor into kernel rather than module, so that such problem does
not exist.
> 
> Notice that such problem not only breaks scaling driver acpi-cpufreq,
but also
> breaks modules for example amd pstate.

Why do those config break when the compression config is enabled? That
sounds like a bug in the kernel for those features, have you reported
that upstream? At the very least, the configuration system should
automatically set those to built-in, or refuse the wrong combination

-- 
Kind regards,
Luca Boccassi

[toc] | [next] | [standalone]


#81431

FromJy Deng <1700011628@pku.edu.cn>
Date2024-01-04 14:50 +0100
Message-ID<HSwgF-K5o-1@gated-at.bofh.it>
In reply to#81430
On Thu, 04 Jan 2024 12:37:51 +0100 Luca Boccassi <bluca@debian.org> wrote:
 > On Thu, 04 Jan 2024 17:16:57 +0800 Jy Deng <1700011628@pku.edu.cn>
 > wrote:
 > > Package: src:linux
 > > Version: 6.6.9-1
 > > Severity: normal
 > > Tags: patch
 > > X-Debbugs-Cc: 1700011628@pku.edu.cn
 > >
 > > Dear Maintainer,
 > >
 > > In short, current configuration of debian kernel makes some scaling
 > governors
 > > not usable, for example amd_pstate=passive Ondemand. Some small
 > changes to
 > > configuration can solve the problem.
 > >
 > > To sovle the problem there is two optional ways:
 > > 1. Change some configurations like CONFIG_CPU_FREQ_GOV_POWERSAVE to y
 > rather
 > > than m
 > > All the configuraion below needs to be chanegd to y:
 > > CONFIG_CPU_FREQ_GOV_POWERSAVE=y
 > > CONFIG_CPU_FREQ_GOV_USERSPACE=y
 > > CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 > > CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
 > >
 > > 2. Change the configuration CONFIG_MODULE_COMPRESS_XZ=y to
 > > CONFIG_MODULE_COMPRESS_NONE=y
 > > Notice that CONFIG_MODULE_COMPRESS_XZ=y not only breaks cpu frequency
 > governors
 > > but also breaks make bindeb-pkg. See
 > > https://bugzilla.kernel.org/show_bug.cgi?id=218341
 > > So that choose this option can deal with this issue too.
 > >
 > > Two file attached is about the two ways above to fix the problem.
 > >
 > >
 > >
 > > Here is some explanation:
 > >
 > > Debian kernel used to set configuration as
 > CONFIG_MODULE_COMPRESS_NONE=y. but
 > > after 6.6 debian kernel configuration use CONFIG_MODULE_COMPRESS_XZ=y
 > to
 > > compress the kernel module. However, modules for cpu frequency
 > governors is not
 > > usable when it's module is compressed.
 > >
 > > For example, CONFIG_CPU_FREQ_GOV_POWERSAVE=m is fine to work if
 > > CONFIG_MODULE_COMPRESS_NONE=y , but if CONFIG_MODULE_COMPRESS_XZ=y is
 > set then
 > > powersave governor is unavailable. This problem is same to other cpu
 > frequency
 > > governor configurations like CONFIG_CPU_FREQ_GOV_ONDEMAND=m
 > >
 > > On the other hand, configuration like CONFIG_CPU_FREQ_GOV_POWERSAVE=y
 > build the
 > > governor into kernel rather than module, so that such problem does
 > not exist.
 > >


Some tips that I already have:

1. Many distros like arch or fedora have change 
CONFIG_CPU_FREQ_GOV_POWERSAVE from m to y. It is possible that they all 
have met such problem.

2. In Debian bug report I find something that may have some relation. 
See bug #1010581

3. I find that if CONFIG_CPU_FREQ_GOV_POWERSAVE=m, then though such 
module cannot be in use after boot at once, but it is possible to 
manually modprobe them. So it may indicate that to use 
CONFIG_CPU_FREQ_GOV_POWERSAVE=m with   CONFIG_MODULE_COMPRESS_XZ=y is 
actually possible. The problem we find here may be not so fundamental.


What else I want to say:

1. Changing such configs from m to y can solve the problem with almost 
not cost. So I suggest thinking about it.

2.  Surely I accept your suggestion that it is very likely a small 
mistake from kernel upstream, since even at userspace I can load and use 
these module by manually modprobe. I want to communicate with upstream 
but  I do not know how to use kernel.org bugzilla. The problem I have is 
that, I do not know how to make a line end. You can see here 
(https://bugzilla.kernel.org/show_bug.cgi?id=218341) that I use some 
stupid way to make new lines. So could you teach me how to start new 
line in kernel bugzilla?


Thanks,

Jy Deng

[toc] | [prev] | [next] | [standalone]


#81432

FromDiederik de Haas <didi.debian@cknow.org>
Date2024-01-04 15:20 +0100
Message-ID<HSwJH-Kxm-1@gated-at.bofh.it>
In reply to#81431

[Multipart message — attachments visible in raw view] — view raw

On Thursday, 4 January 2024 14:34:10 CET Jy Deng wrote:
> 3. I find that if CONFIG_CPU_FREQ_GOV_POWERSAVE=m, then though such
> module cannot be in use after boot at once, but it is possible to
> manually modprobe them. So it may indicate that to use
> CONFIG_CPU_FREQ_GOV_POWERSAVE=m with   CONFIG_MODULE_COMPRESS_XZ=y is
> actually possible. The problem we find here may be not so fundamental.

That's actually how it always worked.
$ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors

likely only lists 'performance' and 'schedutil'.
/lib/modules/$(uname -r)/kernel/drivers/cpufreq/ lists several more governors 
and when you modprobe them, they get added to 'scaling_available_governors'.
And also to `cpupower frequency-info` -> 'available cpufreq governors'.

So if you can verify whether it works with 'modprobe' then this is not a bug.

[toc] | [prev] | [next] | [standalone]


#81433

FromJy Deng <1700011628@pku.edu.cn>
Date2024-01-04 16:00 +0100
Message-ID<HSxmp-KZ5-3@gated-at.bofh.it>
In reply to#81432
在 2024/1/4 22:26, Jy Deng 写道:
> On Thu, 04 Jan 2024 15:04:53 +0100 Diederik de Haas 
> <didi.debian@cknow.org> wrote:
> > On Thursday, 4 January 2024 14:34:10 CET Jy Deng wrote:
> > > 3. I find that if CONFIG_CPU_FREQ_GOV_POWERSAVE=m, then though such
> > > module cannot be in use after boot at once, but it is possible to
> > > manually modprobe them. So it may indicate that to use
> > > CONFIG_CPU_FREQ_GOV_POWERSAVE=m with CONFIG_MODULE_COMPRESS_XZ=y is
> > > actually possible. The problem we find here may be not so fundamental.
> >
> > That's actually how it always worked.
> > $ cat 
> /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors
> >
> > likely only lists 'performance' and 'schedutil'.
> > /lib/modules/$(uname -r)/kernel/drivers/cpufreq/ lists several more 
> governors
> > and when you modprobe them, they get added to 
> 'scaling_available_governors'.
> > And also to `cpupower frequency-info` -> 'available cpufreq governors'.
>
> >So if you can verify whether it works with 'modprobe' then this is 
> not a bug.
>
>
> The problem is that those modules of governors, when without kernel 
> module compression, they will be automatically loaded. However, when 
> module compression like CONFIG_MODULE_COMPRESS_XZ is set as 'y', then 
> I have to manually load them by 'modprobe'. While it is OK to say this 
> is not a bug, it is also important to find out what makes such difference.
>

[toc] | [prev] | [next] | [standalone]


#81434

FromJy Deng <1700011628@pku.edu.cn>
Date2024-01-04 16:50 +0100
Message-ID<HSy8N-LI2-1@gated-at.bofh.it>
In reply to#81432

[Multipart message — attachments visible in raw view] — view raw

On Thu, 04 Jan 2024 15:04:53 +0100 Diederik de Haas 
<didi.debian@cknow.org> wrote:
 > On Thursday, 4 January 2024 14:34:10 CET Jy Deng wrote:
 > > 3. I find that if CONFIG_CPU_FREQ_GOV_POWERSAVE=m, then though such
 > > module cannot be in use after boot at once, but it is possible to
 > > manually modprobe them. So it may indicate that to use
 > > CONFIG_CPU_FREQ_GOV_POWERSAVE=m with CONFIG_MODULE_COMPRESS_XZ=y is
 > > actually possible. The problem we find here may be not so fundamental.
 >
 > That's actually how it always worked.
 > $ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors
 >
 > likely only lists 'performance' and 'schedutil'.
 > /lib/modules/$(uname -r)/kernel/drivers/cpufreq/ lists several more 
governors
 > and when you modprobe them, they get added to 
'scaling_available_governors'.
 > And also to `cpupower frequency-info` -> 'available cpufreq governors'.
 >

 > So if you can verify whether it works with 'modprobe' then this is 
not a bug.

Fine. I have found the problem. It is a bug, but maybe I should say it 
not a bug of kernel but a bug of cooperation.

The backgroud is : Debian (unlike some other distros) uses 'loadcpufreq' 
to load scaling governors. However, 'loadcpufreq' is an out-of-date .sh 
script that does not support compressed kmod (which end with like .ko.xz 
or .ko.zst rather than .ko, which is not considered in the script).

So when kernel team decided to change the config to compress the kmod 
with xz, the maintainer of package 'cpufrequtils' (which includes 
'loadcpufreq' script) did not get such information so he/she did not 
make any update so that now the governors are not available out of box.

I will report bug to 'cpufrequtils' tomorrow.

Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web