Fedora Linux Support Community & Resources Center
  #1  
Old 19th November 2010, 03:31 AM
simpleblue Offline
Registered User
 
Join Date: Nov 2010
Posts: 110
linuxchrome
Easy alternative to the new 200 line kernel patch

A couple lines of code could potentially do the same thing as the new 200 line patch.This was developed by Redhat developer Lennart Poettering.

Here is the article: http://www.webupd8.org/2010/11/alter...nel-patch.html


Apparently it results in even better performance then the 200 line kernel patch.


If anyone finds out how to do this in fedora could you please post how.
Reply With Quote
  #2  
Old 19th November 2010, 04:58 AM
GoinEasy9's Avatar
GoinEasy9 Offline
Registered User
 
Join Date: May 2009
Location: Manorville, New York, USA
Posts: 1,677
linuxchrome
Re: Easy alternative to the new 200 line kernel patch

I think the link you gave is a how-to.
__________________
Registered Linux User #348347
Have you been seduced by siduction? http://siduction.org/index.php
Running Fedora 19/20, siduction and openSUSE 13.1 with KDE
Reply With Quote
  #3  
Old 19th November 2010, 06:35 AM
simpleblue Offline
Registered User
 
Join Date: Nov 2010
Posts: 110
linuxchrome
Re: Easy alternative to the new 200 line kernel patch

Quote:
Originally Posted by GoinEasy9 View Post
I think the link you gave is a how-to.
This is what I get when I follow the first instructions (not the Ubuntu instructions below):

Code:
mkdir: cannot create directory `/sys/fs/cgroup/cpu/user/2839': No such file or directory
bash: /sys/fs/cgroup/cpu/user/2839/tasks: No such file or directory
I tried a couple more times with the Ubuntu instructions and had the same result.

Last edited by simpleblue; 19th November 2010 at 06:42 AM.
Reply With Quote
  #4  
Old 19th November 2010, 08:14 AM
RupertPupkin's Avatar
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 6,645
linuxfedorafirefox
Re: Easy alternative to the new 200 line kernel patch

Those instructions don't work in Fedora 13, which uses /cgroup instead of /sys/fs/cgroup. To make it work in F13 (and probably in F14) do this:
  1. As root, run /usr/sbin/system-config-services and enable the cgconfig service, then start the service.
    (That service should already be installed, as part of the libcgroup package. If not, install it : yum install libcgroup)
  2. Run the following command, and also add it to the /etc/rc.d/rc.local file:
    Code:
    mkdir -m 0777 /cgroup/cpu/user
  3. Add these lines to your ~/.bashrc file:
    Code:
    if [ "$PS1" ] ; then
       mkdir -m 0700 /cgroup/cpu/user/$$
       echo $$ > /cgroup/cpu/user/$$/tasks
    fi
You should be good to go now. Because the cgconfig service was started in step 1, there's no need to reboot. You just need to start a new shell to start seeing the effects. Of course, on reboots all of this will happen automatically if you added the command in step 2 to /etc/rc.d/rc.local. It's working fine for me in F13.
Reply With Quote
  #5  
Old 19th November 2010, 11:01 AM
bart3005 Offline
Registered User
 
Join Date: May 2005
Posts: 80
linuxfedorafirefox
Re: Easy alternative to the new 200 line kernel patch

Hi

Does one need to do any clean up?

The task folder in /cgroup/cpu/user/ seem to stay after he shell has been closed.

Regards
Daniel
Reply With Quote
  #6  
Old 19th November 2010, 11:22 AM
witek's Avatar
witek Offline
Registered User
 
Join Date: Oct 2009
Posts: 117
linuxubuntufirefox
Re: Easy alternative to the new 200 line kernel patch

I`m wondering what these entries in .bashrc mean? And if it works why hasn`t it been used before? It looks that linux kernel got big and complicated and nobody understands it as a whole if someone tries to patch a kernel against something solvable with bash setup.
Reply With Quote
  #7  
Old 19th November 2010, 11:31 AM
JONOR's Avatar
JONOR Offline
Registered User
 
Join Date: Aug 2007
Location: Cornwall England
Posts: 485
linuxfedorafirefox
Easy alternative to the new 200 line kernel patch

Quote:
Originally Posted by RupertPupkin View Post
It's working fine for me in F13.
It might be a bit early to ask but do you notice any significant differences with the change ?
Reply With Quote
  #8  
Old 19th November 2010, 04:10 PM
simpleblue Offline
Registered User
 
Join Date: Nov 2010
Posts: 110
linuxchrome
Re: Easy alternative to the new 200 line kernel patch

Thank you for the help Rupert!

I installed system-config-services (already enabled) and libcgroup.

Quote:
Originally Posted by RupertPupkin View Post
[*]Run the following command, and also add it to the /etc/rc.d/rc.local file:
Code:
mkdir -m 0777 /cgroup/cpu/user
[root@localhost user]# mkdir -m 0777 /cgroup/cpu/user
mkdir: cannot create directory `/cgroup/cpu/user': No such file or directory
When I ran this command it displayed this:

Code:
[root@localhost user]# mkdir -m 0777 /cgroup/cpu/user
mkdir: cannot create directory `/cgroup/cpu/user': No such file or directory
Reply With Quote
  #9  
Old 19th November 2010, 05:01 PM
PabloTwo's Avatar
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,562
linuxfirefox
Re: Easy alternative to the new 200 line kernel patch

Try,
Code:
mkdir -p -m 0777 /cgroup/cpu/user
Reply With Quote
  #10  
Old 19th November 2010, 05:04 PM
simpleblue Offline
Registered User
 
Join Date: Nov 2010
Posts: 110
linuxchrome
Re: Easy alternative to the new 200 line kernel patch

Quote:
Originally Posted by PabloTwo View Post
Try,
Code:
mkdir -p -m 0777 /cgroup/cpu/user
It still says the same thing:

Code:
[user@localhost ~]$ mkdir -p -m 0777 /cgroup/cpu/user
mkdir: cannot create directory `/cgroup/cpu': Permission denied
Reply With Quote
  #11  
Old 19th November 2010, 05:26 PM
schurke's Avatar
schurke Offline
Registered User
 
Join Date: Jul 2007
Location: ::1
Posts: 7
linuxfedorafirefox
Re: Easy alternative to the new 200 line kernel patch

if you have
Code:
mkdir -p -m 0777 /cgroup/cpu/user
in rc.local, than
Code:
sudo sh /etc/rc.local
should do the trick without reboot.
Reply With Quote
  #12  
Old 19th November 2010, 05:39 PM
PabloTwo's Avatar
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 7,562
linuxfirefox
Re: Easy alternative to the new 200 line kernel patch

Quote:
Originally Posted by simpleblue View Post
It still says the same thing:

Code:
[user@localhost ~]$ mkdir -p -m 0777 /cgroup/cpu/user
mkdir: cannot create directory `/cgroup/cpu': Permission denied
No, it doesn't say the same thing. When you first ran the command without the -p option you were root, which is what you need to be when running that command. When you ran it again with the -p option, you were not root, and you got the "permission denied" error, which you didn't get the first time around.
Reply With Quote
  #13  
Old 19th November 2010, 06:20 PM
JONOR's Avatar
JONOR Offline
Registered User
 
Join Date: Aug 2007
Location: Cornwall England
Posts: 485
linuxfedorafirefox
Easy alternative to the new 200 line kernel patch

RupertPupkin and Schurke's modification are in place here i think. Thanks guys.
No obvious changes noticable, might be slightly faster but that could easily be wishful thinking.
Of course i did backups of everything beforehand.
Reply With Quote
  #14  
Old 19th November 2010, 09:59 PM
simpleblue Offline
Registered User
 
Join Date: Nov 2010
Posts: 110
linuxchrome
Re: Easy alternative to the new 200 line kernel patch

Quote:
Originally Posted by schurke View Post
if you have
Code:
mkdir -p -m 0777 /cgroup/cpu/user
in rc.local, than
Code:
sudo sh /etc/rc.local
should do the trick without reboot.
When I entered this in again in root it ran without error. Thanks for mentioning that PabloTwo.

I still have this coming up every time I run terminal (with reboot as well):

Code:
mkdir: cannot create directory `/sys/fs/cgroup/cpu/user/3168': No such file or directory
bash: /sys/fs/cgroup/cpu/user/3168/tasks: No such file or directory
Perhaps I've inputted a script or command that's causing it to return? It might even be working with the exception of the error above. Currently my ~/.bashrc file has this added:

Code:
if [ "$PS1" ] ; then
   mkdir -m 0700 /cgroup/cpu/user/$$
   echo $$ > /cgroup/cpu/user/$$/tasks
fi
Reply With Quote
  #15  
Old 19th November 2010, 11:13 PM
JONOR's Avatar
JONOR Offline
Registered User
 
Join Date: Aug 2007
Location: Cornwall England
Posts: 485
linuxfedorafirefox
Easy alternative to the new 200 line kernel patch

@ simpleblue; Are you using Fedora, as RupertPupkin's suggestion is code for Fedora ?

Also when you say :

Quote:
Originally Posted by simpleblue View Post
I still have this coming up every time I run terminal (with reboot as well):

Code:
mkdir: cannot create directory `/sys/fs/cgroup/cpu/user/3168': No such file or directory
bash: /sys/fs/cgroup/cpu/user/3168/tasks: No such file or directory
Perhaps I've inputted a script or command that's causing it to return? It might even be working with the exception of the error above. Currently my ~/.bashrc file has this added:

Code:
if [ "$PS1" ] ; then
   mkdir -m 0700 /cgroup/cpu/user/$$
   echo $$ > /cgroup/cpu/user/$$/tasks
fi
is that without entering any mkdir command into the terminal ?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to Patch Kernel, but The Patch Requires Kernel Config. AwesomeMachine Using Fedora 4 13th January 2010 06:50 PM
Need Help Making a Kernel Patch work with F11 Kernel Jeff91 Installation, Upgrades and Live Media 1 12th June 2009 12:51 AM
Line-In Problem (Probably an Easy Solution?) jobeirne Using Fedora 7 28th April 2006 01:44 AM
how to patch using command line xyleo Using Fedora 4 4th April 2006 06:51 AM
how to patch a kernel thesource Using Fedora 1 1st July 2005 04:59 AM


Current GMT-time: 04:51 (Sunday, 22-10-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat