LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-10-2018, 08:51 PM   #1
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 495

Rep: Reputation: 285Reputation: 285Reputation: 285
Proposed patch for libcgroup (cgrulesengd 100% cpu usage)


libgroup is no longer under active development - see: https://sourceforge.net/p/libcg/mail...sage/35872380/
The last commit in the git log is dated Tue Dec 8 17:09:08 2015 +0100

The reason may be a takeover by systemd - see 1st paragraph of: https://access.redhat.com/documentat...ibcgroup_tools

Since we don't use systemd, we're stuck with libcgroup. However the release version we use (0.41) does not include some changes applied to the git tree after version 0.41 was tagged at Mon Jan 13 15:48:09 2014 +0100. Therefore our version doesn't fix the serious issue of 100% cpu usage by cgrulesengd in some circumstances. Furthermore it seems unlikely that there will be a new official release version that includes the fix - since there is no longer any active development of the project.

The 100% cpu usage by cgrulesengd is an issue that I experience whenever launching an unprivileged container (no problem ever with privileged containers). Although no one else on this list responded when I asked whether anyone else has the same experience, it is nevertheless well enough known in the wider LXC community that it was reported and a fix committed to the git tree. Unfortunately that fix was incorporated after 0.41 was tagged i.e. the source tarball that we use does not incorporate the fix.

My proposal is to apply a patch which incorporates all the changes in the git tree after the tagging of release 0.41 - the "fix infinite loop" commit is the second most recent commit and many of the others are documentation fixes, so nothing drastic. I've made such a patch myself and have been testing it for a few weeks - alternating between stock and patched versions whenever I have some spare time to do so. I've found a 100% correlation between, on the one hand, the stock version and 100% cpu usage by cgrulesengd and, on the other hand, the patched version and normal cpu usage by cgrulesengd.

I have attached the patch I used (added .txt to the name so it could be attached here), made by a "git diff" between the 0.41 tagging and the head. I applied it to the SlackBuild at (14.2)/patches/source/libcgroup immediately before the existing patches. It requires including "autoreconf -i" just before #Configure.

I hope this, or something like this, can be incorporated in the libcgroup package.

Thanks,
chris
Attached Files
File Type: txt libcgroup.loop.diff.gz.txt (12.2 KB, 18 views)
 
Old 06-11-2018, 01:58 AM   #2
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 1,611

Rep: Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917
Thanks, I'll look into adding this.
 
4 members found this post helpful.
Old 06-12-2018, 06:14 PM   #3
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 495

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by volkerdi View Post
Thanks, I'll look into adding this.
I see the new patched version in -current. Thanks for that.

It would be good to have it in 14.2 as well - any chance of that happening? I installed the -current package on 14.2 where it's all working well so far.

chris
 
2 members found this post helpful.
Old 06-14-2018, 01:05 AM   #4
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 495

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
Thanks, I just saw the package for 14.2.

However something strange is happening with it. After installing the new libcgroup-0.41-x86_64-3_slack14.2.txz, rc.cgconfig failed with error:
Code:
error at line number 2 at qwerty:syntax error
Error: failed to parse file /etc/cgconfig.conf
/usr/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Have multiple paths for the same namespace
It happens when the script runs cgconfigparser (the same error can be induced just by running "cgconfigparser -l /etc/cgconfig.conf"), yet all worked correctly when using yesterday's libcgroup-0.41-x86_64-4.txz from -current. In effect, different versions of cgconfigparser (and cgclear, for that matter) seem to be treating the same /etc/cgconfig.conf file differently.

I won't go into the tortuous path leading to this possible solution - the value of the LANG environment variable. Mine is set LANG=en_AU.utf8 (in /etc/profile.d/lang.sh) and rebuilding either 14.2 or -current versions of the newly patched libcgroup with that LANG value generated the same error as above. On the other hand, building with
Code:
LANG=C ./libcgroup.SlackBuild
produced error-free packages for both 14.2 & -current.

I guess LANG=C just happened to be set when libcgroup-0.41-x86_64-4.txz was being built for -current, but not set like that when libcgroup-0.41-x86_64-3_slack14.2.txz was built for 14.2.

Therefore, could I suggest that the 14.2 version of patched libcgroup be rebuilt with LANG=C please?

One other thing, I found that when rc.cgred is run, the directory /etc/cgconfig.d is now expected to exist (empty is OK). Perhaps that could be added to the SlackBuild (for both 14.2 and -current)?

chris
 
Old 06-14-2018, 01:35 AM   #5
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 1,611

Rep: Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917
This is an excellent example of why I normally do not go dorking around in -stable for non-security reasons.
 
1 members found this post helpful.
Old 06-14-2018, 06:09 PM   #6
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 495

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
I installed libcgroup-0.41-x86_64-4_slack14.2.txz that appeared overnight.

However running rc.cgconfig (cgclear and/or cgconfigparser) produces the same error. It seems the package was not built with LANG=C. It's the build environment that needs this set, not the runtime environment. I rebuilt the package with LANG=C and the error has disappeared.

I understand the reluctance to "go dorking around in -stable" but you're right to want properly working packages rather than broken ones.

chris
 
1 members found this post helpful.
Old 06-14-2018, 09:23 PM   #7
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 1,611

Rep: Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917Reputation: 4917
New packages up in 14.2-stable, let me know if they work for you. Tested here - thanks for the excellent guide to setting up unprivileged containers that you've got online.
 
1 members found this post helpful.
Old 06-15-2018, 03:41 AM   #8
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 495

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
Yep, the new libcgroup-0.41-x86_64-5_slack14.2 is working here too. Thanks for that - sorry about the heartburn but great that it's working completely now.

chris
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unprivileged container triggers 100%cpu by cgrulesengd chris.willing Slackware 0 06-01-2018 10:45 AM
Squid 3 near 100% cpu usage and high RAM usage piman Linux - Software 1 11-16-2013 03:20 AM
cpu usage 100% ahhkyyda Linux - Enterprise 2 09-03-2009 08:26 AM
FF 2.0 100% CPU Usage cexshun Slackware 12 04-05-2007 02:11 AM
100 % CPU usage ???? rolandi Linux - Newbie 1 10-08-2003 12:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration