Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
disable control groups [resolved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 8:29 am    Post subject: disable control groups [resolved] Reply with quote

ref this post:
a.b. wrote:
You could also check if you've got control groups enabled in your Kernel config, if you have, disable them.

how would i do that? i need some confirmation if i'm doing it right.

i had:
Code:
 $ cat /usr/src/linux/.config | grep -i group
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_PIDS=y
# CONFIG_CGROUP_DEVICE is not set
CONFIG_CGROUP_CPUACCT=y
# CONFIG_CGROUP_PERF is not set
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_SCHED_AUTOGROUP=y
CONFIG_CFQ_GROUP_IOSCHED=y
# CONFIG_CGROUP_NET_PRIO is not set
# CONFIG_CGROUP_NET_CLASSID is not set


so i removed what i could, and now i have:
Code:
$ cat /usr/src/linux/.config | grep -i group                                                                                                                                                     
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
# CONFIG_CGROUP_FREEZER is not set
# CONFIG_CGROUP_PIDS is not set
# CONFIG_CGROUP_DEVICE is not set
# CONFIG_CGROUP_CPUACCT is not set
# CONFIG_CGROUP_PERF is not set
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_RT_GROUP_SCHED is not set
# CONFIG_BLK_CGROUP is not set
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_CGROUP_NET_PRIO is not set
# CONFIG_CGROUP_NET_CLASSID is not set

menuconfig won't let me remove CONFIG_CGROUPS=y from gentoo-sources.
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey


Last edited by josephg on Wed Oct 12, 2016 2:24 pm; edited 2 times in total
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1519
Location: KUUSANKOSKI, Finland

PostPosted: Wed Oct 12, 2016 12:16 pm    Post subject: Reply with quote

in root shell:
cd /usr/src/linux
./scripts/config -d CGROUPS
... and it's disabled... if no errors occured. Then just recompile your kernel.
I'm not the expert of this cgroups thing, but I have a feeling that it might mess things up when disabled. So backup your kernel and have a meny entry in bootloader configs for the backup kernel.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 12:56 pm    Post subject: Reply with quote

Zucca wrote:
in root shell:
cd /usr/src/linux
./scripts/config -d CGROUPS
... and it's disabled... if no errors occured. Then just recompile your kernel.

fab :) thank you

Zucca wrote:
I'm not the expert of this cgroups thing, but I have a feeling that it might mess things up when disabled. So backup your kernel and have a meny entry in bootloader configs for the backup kernel.

ulp.. perhaps i shouldn't do this then :?: i'm still finding my way around gentoo, and i might not realise if i mess up

i've heard some say that control groups are evil..
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1519
Location: KUUSANKOSKI, Finland

PostPosted: Wed Oct 12, 2016 1:16 pm    Post subject: Reply with quote

You can of course test it first. ;)
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 1:34 pm    Post subject: Reply with quote

Zucca wrote:
You can of course test it first. ;)

ok to change some config somewhere.. i'm feel reluctant to delete the cgroups codebase from kernel source. how would i revert back? or do you mean backup the whole /usr/src/linux directory itself??
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 1:42 pm    Post subject: Reply with quote

ok i found that command. i thought -d was delete! :oops:
Code:
$ /usr/src/linux/scripts/config --help
...
        --enable|-e option   Enable option
        --disable|-d option  Disable option
        --module|-m option   Turn option into a module
        --set-str option string
                             Set option to "string"
        --set-val option value
                             Set option to value
        --undefine|-u option Undefine option
        --state|-s option    Print state of option (n,y,m,undef)

        --enable-after|-E beforeopt option
                             Enable option directly after other option
        --disable-after|-D beforeopt option
                             Disable option directly after other option
        --module-after|-M beforeopt option
                             Turn option into module directly after other option

        commands can be repeated multiple times

options:
        --file config-file   .config file to change (default .config)
        --keep-case|-k       Keep next symbols' case (dont' upper-case it)

config doesn't check the validity of the .config file. This is done at next
make time.

By default, config will upper-case the given symbol. Use --keep-case to keep
the case of all following symbols unchanged.

config uses 'CONFIG_' as the default symbol prefix. Set the environment
variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" config ...


thank you Zucca :) didn't know about this command.. very handy.. compared to trawling through all those menus looking for something
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 1:48 pm    Post subject: Reply with quote

Code:
# cd /usr/src/linux/
# cat .config | grep CGROUPS
CONFIG_CGROUPS=y
# ./scripts/config -d cgroups
# cat .config | grep CGROUPS
# CONFIG_CGROUPS is not set
# ./scripts/config -e cgroups
# cat .config | grep CGROUPS
CONFIG_CGROUPS=y

i like it :)
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 1:53 pm    Post subject: Reply with quote

Zucca wrote:
in root shell:
cd /usr/src/linux
./scripts/config -d CGROUPS
... and it's disabled... if no errors occured. Then just recompile your kernel.


so that disabled cgroups in .config. but if i do menuconfig, cgroups get enabled again!

or did you mean disable it like above, and just recompile kernel without going into menuconfig to validate?
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1519
Location: KUUSANKOSKI, Finland

PostPosted: Wed Oct 12, 2016 2:00 pm    Post subject: Reply with quote

josephg wrote:
so that disabled cgroups in .config. but if i do menuconfig, cgroups get enabled again!
Then something is forcibly enabling it by a reason. :) Don't mess with it. ;)
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 2:21 pm    Post subject: Reply with quote

Zucca wrote:
josephg wrote:
so that disabled cgroups in .config. but if i do menuconfig, cgroups get enabled again!
Then something is forcibly enabling it by a reason. :) Don't mess with it. ;)

i think gentoo-sources force enable it. i think as you say, i better leave this one alone ;)

if i do a search within menuconfig, i get this:
Code:
Symbol: CGROUPS [=y]
  │ Type  : boolean
  │ Prompt: Control Group support
  │   Location:
  │ (1) -> General setup
  │   Defined at init/Kconfig:927
  │   Selects: KERNFS [=y]
  │   Selected by: GENTOO_LINUX_PORTAGE [=y] && GENTOO_LINUX [=y] || GENTOO_LINUX_INIT_SYSTEMD [=n] && GENTOO_LINUX [=y] && GENTOO_LINUX_UDEV [=y] || SCHED_AUTOGROUP [=n]


could i have got this or the [Help] text, without going through menuconfig? ie some command line?
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1519
Location: KUUSANKOSKI, Finland

PostPosted: Wed Oct 12, 2016 2:30 pm    Post subject: Reply with quote

josephg wrote:
Code:
Symbol: CGROUPS [=y]
  │ Type  : boolean
  │ Prompt: Control Group support
  │   Location:
  │ (1) -> General setup
  │   Defined at init/Kconfig:927
  │   Selects: KERNFS [=y]
  │   Selected by: GENTOO_LINUX_PORTAGE [=y] && GENTOO_LINUX [=y] || GENTOO_LINUX_INIT_SYSTEMD [=n] && GENTOO_LINUX [=y] && GENTOO_LINUX_UDEV [=y] || SCHED_AUTOGROUP [=n]


could i have got this or the [Help] text, without going through menuconfig? ie some command line?
I think it should be possible some way, but I haven't investigated. Please post if you find a way. :)
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 6:04 pm    Post subject: Reply with quote

Zucca wrote:
josephg wrote:
could i have got this or the [Help] text, without going through menuconfig? ie some command line?
I think it should be possible some way, but I haven't investigated. Please post if you find a way. :)

ok i found the help text in Kconfig files in all the various subdirectories. i'm still looking through them. we might need your awk skills to extract the text after the help line till the config line.
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey


Last edited by josephg on Wed Oct 12, 2016 6:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 6:38 pm    Post subject: Reply with quote

for example, the [Help] text for CGROUPS is found in init/Kconfig after the "help" line
Code:
$ grep -A12 "config CGROUPS" init/Kconfig
menuconfig CGROUPS
        bool "Control Group support"
        select KERNFS
        help
          This option adds support for grouping sets of processes together, for
          use with process control subsystems such as Cpusets, CFS, memory
          controls or device isolation.
          See
                - Documentation/scheduler/sched-design-CFS.txt  (CFS)
                - Documentation/cgroups/ (features for grouping, isolation
                                          and resource control)

          Say N if unsure.

_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 6:50 pm    Post subject: Reply with quote

Code:
$ grep -A33 "config ACPI_TOSHIBA" drivers/platform/x86/Kconfig
config ACPI_TOSHIBA
        tristate "Toshiba Laptop Extras"
        depends on ACPI
        depends on ACPI_WMI
        select LEDS_CLASS
        select NEW_LEDS
        depends on BACKLIGHT_CLASS_DEVICE
        depends on INPUT
        depends on SERIO_I8042 || SERIO_I8042 = n
        depends on ACPI_VIDEO || ACPI_VIDEO = n
        select INPUT_POLLDEV
        select INPUT_SPARSEKMAP
        ---help---
          This driver adds support for access to certain system settings
          on "legacy free" Toshiba laptops.  These laptops can be recognized by
          their lack of a BIOS setup menu and APM support.

          On these machines, all system configuration is handled through the
          ACPI.  This driver is required for access to controls not covered
          by the general ACPI drivers, such as LCD brightness, video output,
          etc.

          This driver differs from the non-ACPI Toshiba laptop driver (located
          under "Processor type and features") in several aspects.
          Configuration is accessed by reading and writing text files in the
          /proc tree instead of by program interface to /dev.  Furthermore, no
          power management functions are exposed, as those are handled by the
          general ACPI drivers.

          More information about this driver is available at
          <http://memebeam.org/toys/ToshibaAcpiDriver>.

          If you have a legacy free Toshiba laptop (such as the Libretto L1
          series), say Y.

_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1519
Location: KUUSANKOSKI, Finland

PostPosted: Wed Oct 12, 2016 7:15 pm    Post subject: Reply with quote

I managed to do it with sed and head...
shell command:
sed -n '/^config ACPI_TOSHIBA/,/^config/p' drivers/platform/x86/Kconfig | head -n -1
... for example.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 8:13 pm    Post subject: Reply with quote

Zucca wrote:
I managed to do it with sed and head...
shell command:
sed -n '/^config ACPI_TOSHIBA/,/^config/p' drivers/platform/x86/Kconfig | head -n -1
... for example.


fab :D slightly tweaking it.. we might get there yet!
Code:

sed -n '/config ACPI_TOSHIBA/,/^config/p' drivers/platform/x86/Kconfig | head -n -2
sed -n '/config CGROUPS/,/^config/p' init/Kconfig | head -n -2

_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey


Last edited by josephg on Wed Oct 12, 2016 8:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Wed Oct 12, 2016 8:27 pm    Post subject: Reply with quote

i had a conversation with grknight on #gentoo earlier today. he told me that he had taught ack how to only search through Kconfig files. in short, this is howto:
Code:
# emerge sys-apps/ack

~/.ackrc:
--type-add=kernel:match:/Kconfig.*/

Code:
$ ack -l --kernel ACPI_TOSHIBA
drivers/platform/x86/Kconfig

and.. we got the filename to do the above :)
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1519
Location: KUUSANKOSKI, Finland

PostPosted: Wed Oct 12, 2016 9:20 pm    Post subject: Reply with quote

Well. My awk-fu isn't at its strongest now (need more rtfm), but:
run in shell:
find /usr/src/linux/ -type f -iname 'Kconfig*' -print0 | xargs -0 sed -n '/^config ACPI_TOSHIBA/,/^config/p' | head -n -1
...does it too.

Actually running cat with xargs and then piping all the output to awk, that then would stop the process after first match, would be ideal. My example here goes trough all the files even if the match was found from the first file.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Thu Oct 13, 2016 8:02 am    Post subject: Reply with quote

Zucca wrote:
Well. My awk-fu isn't at its strongest now (need more rtfm)

#kernel guys suggested perl to me.. mine's even worse :oops:

Zucca wrote:
run in shell:
find /usr/src/linux/ -type f -iname 'Kconfig*' -print0 | xargs -0 sed -n '/^config ACPI_TOSHIBA/,/^config/p' | head -n -1

great! all files are named Kconfig only. so we don't need the * after.. bit simpler and quicker.
and you've gotta take your top off ;) but only the first one, as i tweaked above.. or it won't find the likes of CGROUPS.

so this returns nothing
Code:
$ find /usr/src/linux/ -type f -iname 'Kconfig*' -print0 | xargs -0 sed -n '/^config CGROUPS/,/^config/p' | head -n -1


but this does
Code:
$ find /usr/src/linux/ -type f -iname 'Kconfig' -print0 | xargs -0 sed -n '/config CGROUPS/,/^config/p' | head -n -1

and this works too
Code:
$ find /usr/src/linux/ -type f -iname 'Kconfig' -print0 | xargs -0 sed -n '/config ACPI_TOSHIBA/,/^config/p' | head -n -1


Zucca wrote:
Actually running cat with xargs and then piping all the output to awk, that then would stop the process after first match, would be ideal. My example here goes trough all the files even if the match was found from the first file.

yes, you're right. some config options should have multiple matches like ACPI_THERMAL or TOSHIBA, as they match partial configs too.
_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey


Last edited by josephg on Thu Oct 13, 2016 12:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1519
Location: KUUSANKOSKI, Finland

PostPosted: Thu Oct 13, 2016 11:50 am    Post subject: Reply with quote

A small improvement would be to replace -iname with -name.

But If you really want this... I'd suggest searching if there was already made tool for this...
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum