Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 19 Apr 2014, 01:26
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Kernel patch speeds up Linux
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Author Message
eden6000

Joined: 08 Apr 2007
Posts: 259

PostPosted: Wed 17 Nov 2010, 03:49    Post subject:  Kernel patch speeds up Linux  

The ~200 Line Linux Kernel Patch That Does Wonders
Quote:
...The patch being talked about is designed to automatically create task groups per TTY in an effort to improve the desktop interactivity under system strain. Mike Galbraith wrote the patch, which is currently in its third version in recent weeks, after Linus Torvalds inspired this idea. In its third form (patch), this patch only adds 224 lines of code to the kernel's scheduler while stripping away nine lines of code, thus only 233 lines of code are in play.

Tests done by Mike show the maximum latency dropping by over ten times and the average latency of the desktop by about 60 times. Linus Torvalds has already heavily praised (in an email) this miracle patch....
Back to top
View user's profile Send private message 
nooby

Joined: 29 Jun 2008
Posts: 10521
Location: SwedenEurope

PostPosted: Wed 17 Nov 2010, 04:26    Post subject:  

Quote:
In recent weeks and months there has been quite a bit of work towards improving the responsiveness of the Linux desktop with some very significant milestones building up recently and new patches continuing to come. This work is greatly improving the experience of the Linux desktop when the computer is withstanding a great deal of CPU load and memory strain. Fortunately, the exciting improvements are far from over. There is a new patch that has not yet been merged but has undergone a few revisions over the past several weeks and it is quite small -- just over 200 lines of code -- but it does wonders for the Linux desktop.


Yes in Swedish at the idg.se site but I was too lazy to translate into english and failed to find your text so I waited and there your post came. Smile

Looks interesting but it comes in first quarter of 2011 and not in the kernel that is about to get released now?

_________________
I use Google Search on Puppy Forum
not an ideal solution though
Back to top
View user's profile Send private message 
eden6000

Joined: 08 Apr 2007
Posts: 259

PostPosted: Wed 17 Nov 2010, 16:20    Post subject:  

Well...it seems it is due to come out in kernel 2.6.38, so there is sometime to wait....
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Wed 17 Nov 2010, 20:27    Post subject:  

Well we can patch it now... open source rocks. Wink
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Wed 17 Nov 2010, 21:16    Post subject:  

Very interesting, I wonder if the patch will apply on older kernels, like my 2.6.31.14 used in Wary?
_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 10664
Location: Arizona USA

PostPosted: Wed 17 Nov 2010, 22:10    Post subject:  

The discussion that follows this article about the new Linux kernel patch seems educational, especially the comments by honeymonster.
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Wed 17 Nov 2010, 22:24    Post subject:  

I tried on 2.6.35.7. It's not going to go on easy.

Code:

patch -p1 --dry-run < performance.patch
patching file include/linux/sched.h
Hunk #1 succeeded at 513 (offset 4 lines).
Hunk #3 succeeded at 1903 (offset -33 lines).
patching file kernel/sched.c
Hunk #1 FAILED at 78.
Hunk #2 succeeded at 611 (offset 5 lines).
Hunk #3 FAILED at 2015.
Hunk #4 succeeded at 7548 (offset -436 lines).
Hunk #5 succeeded at 8509 (offset -5 lines).
Hunk #6 succeeded at 8103 (offset -436 lines).
2 out of 6 hunks FAILED -- saving rejects to file kernel/sched.c.rej
patching file kernel/fork.c
Hunk #1 succeeded at 173 (offset -1 lines).
Hunk #2 succeeded at 903 with fuzz 1 (offset -3 lines).
can't find file to patch at input line 164
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: linux-2.6/drivers/tty/tty_io.c
|===================================================================
|--- linux-2.6.orig/drivers/tty/tty_io.c
|+++ linux-2.6/drivers/tty/tty_io.c
--------------------------
Back to top
View user's profile Send private message Visit poster's website 
dejan555


Joined: 30 Nov 2008
Posts: 2589
Location: Montenegro

PostPosted: Thu 18 Nov 2010, 04:11    Post subject:  

Wow, sounds cool. Linux can be even faster? Smile
_________________


Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Sit Heel Speak


Joined: 30 Mar 2006
Posts: 2595
Location: downwind

PostPosted: Thu 18 Nov 2010, 10:42    Post subject: Attempt at the super miracle patch on Wary k-2.6.31.14  

BarryK wrote:
Very interesting, I wonder if the patch will apply on older kernels, like my 2.6.31.14 used in Wary?

An attempt on your 2.6.31.14 Wary kernel, after adjusting the patch to point not at drivers/tty/tty_io.c but rather where it resides in this older kernel, drivers/char/tty_io.c:
Code:
# pwd
/mnt/sdb2/KERNEL_SOURCE/2.6.31.14 Barry's--experiment with super miracle patch/testbed/usr/src/linux-2.6.31.14
#
# patch -p1 -N --dry-run < ../the_patch
patching file include/linux/sched.h
Hunk #1 succeeded at 523 (offset 14 lines).
Hunk #2 succeeded at 588 (offset 10 lines).
Hunk #3 succeeded at 1849 (offset -87 lines).
patching file kernel/sched.c
Hunk #1 FAILED at 78.
Hunk #2 FAILED at 606.
Hunk #3 FAILED at 2010.
Hunk #4 FAILED at 7984.
Hunk #5 succeeded at 9788 with fuzz 2 (offset 1274 lines).
Hunk #6 succeeded at 9815 with fuzz 1 (offset 1276 lines).
4 out of 6 hunks FAILED -- saving rejects to file kernel/sched.c.rej
patching file kernel/fork.c
Hunk #1 FAILED at 174.
Hunk #2 succeeded at 871 with fuzz 2 (offset -35 lines).
1 out of 2 hunks FAILED -- saving rejects to file kernel/fork.c.rej
patching file drivers/char/tty_io.c
Hunk #1 succeeded at 3009 (offset -151 lines).
patching file kernel/sched_autogroup.h
patching file kernel/sched_autogroup.c
patching file kernel/sysctl.c
Hunk #1 succeeded at 366 with fuzz 2 (offset -16 lines).
patching file init/Kconfig
Hunk #1 succeeded at 614 with fuzz 2 (offset -114 lines).
patching file Documentation/kernel-parameters.txt
Hunk #1 succeeded at 1558 (offset -64 lines).
#

sched.c and fork.c are fast-evolving, so to say that this alteration is "just" the 200-or-so-lines patch is misleading. You would need to backport sched.c, fork.c, and who-knows-how-many of their headers.
Back to top
View user's profile Send private message 
l0wt3ch
Guest


PostPosted: Thu 18 Nov 2010, 19:32    Post subject:  

http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html

Quote:
Alternative To The "200 Lines Kernel Patch That Does Wonders" Which You Can Use Right Away

Phoronix recently published an article regarding a ~200 lines Linux Kernel patch that improves responsiveness under system strain. Well, Lennart Poettering, a RedHat developer replied to Linus Torvalds on a maling list with an alternative to this patch that does the same thing yet all you have to do is run 2 commands and paste 4 lines in your ~/.bashrc file. I know it sounds unbelievable, but apparently someone even ran some tests which prove that Lennart's solution works. Read on!


I'm using this right now on my Ubuntu laptop, and it's working awesome.

The Ubuntu laptop is perfect to test this on, because normally it has trouble playing music and using Firefox at the same time - I very frequently have to turn the volume down for a page to load.

Or, should I say it used to have trouble... Very Happy
Back to top
2lss

Joined: 20 Sep 2009
Posts: 225

PostPosted: Thu 18 Nov 2010, 21:06    Post subject:  

I'm running the patch now with 2.6.37-rc2 on ubuntu lucid

So far its working good, although I wouldn't say its a 10X improvement.

Big Buck Bunny @1080p, Midori, Thunderbird, Gnome Terminal, Bricscad, and glxgears all running at the same time. The video payback was slightly choppy but everything else responded ok.

Keep in mind, this is on a core 2 duo with intel GM965/GL960 video. Not exactly the cream of the crop.

If I get some actual numbers I will post them.
Back to top
View user's profile Send private message 
nooby

Joined: 29 Jun 2008
Posts: 10521
Location: SwedenEurope

PostPosted: Fri 19 Nov 2010, 06:16    Post subject:  

Would be cool to have it in later Luci-238 then?
_________________
I use Google Search on Puppy Forum
not an ideal solution though
Back to top
View user's profile Send private message 
Sit Heel Speak


Joined: 30 Mar 2006
Posts: 2595
Location: downwind

PostPosted: Fri 19 Nov 2010, 18:45    Post subject: Attempt--k2.6.31.14 alternative script to the miracle patch  

l0wt3ch wrote:
http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html
It seems that one ought *somehow* to apply this alternative script to Puppy. But I know nothing of cgroups, don't know how to apply them.

I have re-compiled the wary 2.6.31.14 kernel with cgroups and configfs activated, as shown in these three screencaps:

http://i53.tinypic.com/21948za.png
http://i51.tinypic.com/j803kh.png
http://i53.tinypic.com/6giohy.png

then have attempted to replicate the commands disclosed at
http://lkml.org/lkml/2010/11/16/392
starting thusly:
Code:
cd /config
mkdir fs
cd fs
mkdir cgroup
cd cgroup
mkdir cpu
cd cpu
mkdir user
cd user

I then attempted to *literally* replicate the next command --not to /sys of course, but to /config, like this:
Code:
# echo $$ > /config/fs/cgroup/cpu/user/$$/tasks
That returned:
Code:
# echo $$ > /config/fs/cgroup/cpu/user/$$/tasks
bash: /config/fs/cgroup/cpu/user/8817/tasks: No such file or directory
and so, taking that as my clue, I then issued
Code:
mkdir 8817
and then
Code:
# echo $$ > /config/fs/cgroup/cpu/user/$$/tasks
which resulted in the file "tasks" being created within /config/fs/cgroup/cpu/user/8817.

I then tried (and got):
Code:
# mount -t cgroup cgroup /sys/fs/cgroup/cpu -o cpu
mount: mount point /sys/fs/cgroup/cpu does not exist
so then tried mounting it under /config, thusly:
Code:
# mount -t cgroup cgroup /config/fs/cgroup/cpu -o cpu
but got the return
Code:
mount: special device cgroup does not exist
, and at this point I'm out of know-how. Can someone tell me how to create special device cgroup?

Anyone have any other ideas?
Back to top
View user's profile Send private message 
jogreer

Joined: 28 Sep 2010
Posts: 22

PostPosted: Sat 20 Nov 2010, 07:12    Post subject: cgroup patching puppylinux
Subject description: cgrou patch
 

Okay, this is how I did it, BUT DO NOTICE THAT mount -t cgroup DOES NOT WORK WITH KERNEL 2.6.33.2! Can someone take a look at implementing cgroup in kernel?

Add the following commands in your /etc/rc.d/rc.local (open it with: geany /etc/rc.d/rc.local) file:

mkdir -p /dev/cgroup/cpu
mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
mkdir -m 0777 /dev/cgroup/cpu/user
echo "/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent

and make it executable:
chmod +x /etc/rc.d/rc.local

And then add the following to your /root/.bashrc file (to open it: geany /root/.bashrc):

if [ "$PS1" ] ; then
mkdir -p -m 0700 /dev/cgroup/cpu/user/$$ > /dev/null 2>&1
echo $$ > /dev/cgroup/cpu/user/$$/tasks
echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
fi

Run the following command:
geany /usr/local/sbin/cgroup_clean

And paste this:

#!/bin/sh
rm -rf /dev/cgroup/cpu/user/$*

then save the file and make it executable:
chmod +x /usr/local/sbin/cgroup_clean

And finally, restart the computer or manually run the /etc/rc.d/rc.local file ("/etc/rc.d/rc.local").

Run "ls /dev/cgroup/cpu/user/" to see if the different groups are created and running
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2167

PostPosted: Sat 20 Nov 2010, 12:25    Post subject:  

SHS, what is this /config directory? The stuff needs to go under sysfs because that is where the virtual file system interface is. You need a 'mkdir $$' after cd'ing into: /sysfs/fs/cgroup/cpu/user/
Simpler to just do:
mkdir -p -m700 /config/fs/cgroup/cpu/user/$$
before:
echo $$ > /config/fs/cgroup/cpu/user/$$/tasks
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0842s ][ Queries: 12 (0.0041s) ][ GZIP on ]