DaemonForums  

Go Back   DaemonForums > DaemonForums.org > News

News News regarding BSD and related.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 16th November 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default The ~200 Line Linux Kernel Patch That Does Wonders

http://www.phoronix.com/scan.php?pag...37_video&num=1

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.

My lowly laptop has always suffered from problems when doing a large compile of any sort, often on FreeBSD, making Firefox 3.x unusable (but that's crap on FreeBSD anyway). I must admit, Linux has done better at surviving it but not by a big much in terms of interactive performance.

If this so called "Wonder" patch really does make such big improvements, I wonder when something comparable might make it's way into FreeBSD...
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #2   (View Single Post)  
Old 16th November 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,064
Thanked 198 Times in 156 Posts
Default

It would be silly for the system to leave a certain amount of resources unused during a "large compile" so that the user *might* do some browsing or whatever....

Nice levels are there for a reason
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #3   (View Single Post)  
Old 18th November 2010
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

Yeah, if you want something to run in the background, then set it to run in the background.

sudo /usr/bin/nice -n 10 portmaster yadda blah stuff

Works beautifully, even when burning CDs, trolling through forums, and streaming shows to the laptop attached to the tv.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #4   (View Single Post)  
Old 18th November 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,064
Thanked 198 Times in 156 Posts
Default

An alias also works:

Code:
alias make "nice -n 20 make"
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #5   (View Single Post)  
Old 18th November 2010
rocket357's Avatar
rocket357 rocket357 is offline
Real Name: Jonathon
Wannabe OpenBSD porter
 
Join Date: Jun 2010
Location: 127.0.0.1
Posts: 317
Thanked 9 Times in 9 Posts
Default

Quote:
Originally Posted by Carpetsmoker View Post
Nice levels are there for a reason
Patching the kernel is the Tao of Linux. If you think about it, the entire
system is based on a re-invention of the wheel...so why not reinvent it
some more?
Reply With Quote
  #6   (View Single Post)  
Old 19th November 2010
Oliver_H's Avatar
Oliver_H Oliver_H is offline
Real Name: Oliver Herold
UNIX lover
 
Join Date: May 2008
Location: Germany
Posts: 429
Thanked 26 Times in 22 Posts
Default

Nice levels are far away from this patch. This patch is about automatically adjusts group scheduling.
__________________
use UNIX or die :-)
Reply With Quote
  #7   (View Single Post)  
Old 20th November 2010
hansivers hansivers is offline
Real Name: Hans Ivers
Port Guard
 
Join Date: Jun 2008
Location: Quebec City, Canada
Posts: 20
Thanked 0 Times in 0 Posts
Default

A Redhat engineer post a mail about achieving the same result with only userspace code :

Quote:
Here's my super-complex patch btw, to achieve exactly the same thing
from userspace without involving any kernel or systemd patching and
kernel-side logic. Simply edit your own ~/.bashrc and add this to the end:

if [ "$PS1" ] ; then
mkdir -m 0700 /sys/fs/cgroup/cpu/user/$$
echo $$ > /sys/fs/cgroup/cpu/user/$$/tasks
fi
Then, as the superuser do this:

mount -t cgroup cgroup /sys/fs/cgroup/cpu -o cpu
mkdir -m 0777 /sys/fs/cgroup/cpu/user

Done. Same effect. However: not crazy.
http://lkml.org/lkml/2010/11/16/330

Linus Torvald disagree, basically because he doubt that normal users will take time to tweak their shell, and argued that, by including the patch in the kernel, everybody will benefit from it.

Interesting thread.
Reply With Quote
  #8   (View Single Post)  
Old 20th November 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

Quote:
Originally Posted by hansivers View Post
A Redhat engineer post a mail about achieving the same result with only userspace code
This engineer is Poettering, the same guy that committed the 'great' PulseAudio ... and systemd lately.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #9   (View Single Post)  
Old 20th November 2010
Oliver_H's Avatar
Oliver_H Oliver_H is offline
Real Name: Oliver Herold
UNIX lover
 
Join Date: May 2008
Location: Germany
Posts: 429
Thanked 26 Times in 22 Posts
Default

Quote:
Originally Posted by vermaden View Post
This engineer is Poettering, the same guy that committed the 'great' PulseAudio ... and systemd lately.

Sure, but PulseAudio and different audio layers are necessary for crappy ALSA. So PulseAudio may not be the best layer, but it depends on ALSA and ALSA is a huge failure.

Apart from that, would be nice to see whether something similar is possible in FreeBSD too. Group scheduling per se is available.
__________________
use UNIX or die :-)
Reply With Quote
Old 21st November 2010
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Thanked 6 Times in 6 Posts
Default

Perhaps you've seen it already, but a thread was started on the FreeBSD MLs:

http://lists.freebsd.org/pipermail/f...er/004067.html
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
Old 21st November 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

Quote:
Originally Posted by DNAeon View Post
Perhaps you've seen it already, but a thread was started on the FreeBSD MLs:

http://lists.freebsd.org/pipermail/f...er/004067.html
From my experience, this would be a very long and detailed discussion ... and in the end nothing will happen ;p

'Our' interactiveness problem is responsiveness under heavy I/O, I have Intel SSD (which has very fast random access times) but when I do some heavy I/O (even merging a snapshot at VirtualBox) responsiveness is a lot worse until that process stops.

I even have a script to automatically 'renice' the most CPU intensive process:
Code:
% cat scripts/renice.sh 

#! /bin/sh

PROCESS=$( top -b 5 | grep -A 5 USERNAME | sed 1d | head -1 | awk '{print $12}' )
renice -n 10 $( pgrep ${PROCESS} )
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Old 22nd November 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Quote:
Originally Posted by vermaden View Post
From my experience, this would be a very long and detailed discussion ... and in the end nothing will happen ;p

'Our' interactiveness problem is responsiveness under heavy I/O, I have Intel SSD (which has very fast random access times) but when I do some heavy I/O (even merging a snapshot at VirtualBox) responsiveness is a lot worse until that process stops.

I even have a script to automatically 'renice' the most CPU intensive process:
Code:
% cat scripts/renice.sh 

#! /bin/sh

PROCESS=$( top -b 5 | grep -A 5 USERNAME | sed 1d | head -1 | awk '{print $12}' )
renice -n 10 $( pgrep ${PROCESS} )
http://lkml.org/lkml/2010/11/16/351
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 22nd November 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

Quote:
Originally Posted by TerryP View Post
Why You sent that link as response to my post?
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Old 22nd November 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Quote:
Originally Posted by Linus Torvalds
If the choice is between telling everybody "you should do this", and "we should just do this for you", I'll take the second one every time.
Linus Torvalds, wiper of other peoples... faces.
Reply With Quote
Old 22nd November 2010
Oliver_H's Avatar
Oliver_H Oliver_H is offline
Real Name: Oliver Herold
UNIX lover
 
Join Date: May 2008
Location: Germany
Posts: 429
Thanked 26 Times in 22 Posts
Default

Quote:
Originally Posted by vermaden View Post
From my experience, this would be a very long and detailed discussion ... and in the end nothing will happen ;p

'Our' interactiveness problem is responsiveness under heavy I/O, I have Intel SSD (which has very fast random access times) but when I do some heavy I/O (even merging a snapshot at VirtualBox) responsiveness is a lot worse until that process stops.

I even have a script to automatically 'renice' the most CPU intensive process:
Code:
% cat scripts/renice.sh 

#! /bin/sh

PROCESS=$( top -b 5 | grep -A 5 USERNAME | sed 1d | head -1 | awk '{print $12}' )
renice -n 10 $( pgrep ${PROCESS} )
Linux does more things in parallel during disk access, so this is to some degree an advantage. But using geom sched with UFS (it's not necessary with ZFS), the situation is quiet different. But while getting more and more patches into the kernel, regression in Linux is on the rise. In the end it's maybe sometimes faster, at least in some static benchmark, but it doesn't contribute to reliability and stability.
__________________
use UNIX or die :-)
Reply With Quote
Old 23rd November 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Quote:
Originally Posted by vermaden View Post
Why You sent that link as response to my post?
You could say I'm one of those freakish there is a right way and a wrong way to solve problems sort of guy. You know, the kind who thinks using chewing gum is supposed to be a temporary solution, not a fix for problems coming straight out of the factory.


If you can improve performance: should it be done at the level of the thing responsible for it (hint: not the user) and better yet, maybe have it become tunable by the system administrator (BSD via a sysctl, Linux via the file system) Or should it be a cobbled together on a per user basis, sooner or later to fall out of sync with reality, and probably be so much more likely to see random bugs slip in?

While I don't always agree with Linus (and sometimes curse at him for one thing or another), I think in that posting, he was quite right. The most a user space implementation should be, is a configurable daemon, and it would still be faster done in kernel. It's called "Monolithic" for a reason after all.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 23rd November 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

@TerryP

I was talking about FreeBSD mailing lists discussion, about that there would be a long detailed discussion and nothing will be done

I would like to see scheduler (or I/O scheduler) improvements, but there have to be person who will sit and write these changes, and its not for free
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Old 23rd November 2010
Oliver_H's Avatar
Oliver_H Oliver_H is offline
Real Name: Oliver Herold
UNIX lover
 
Join Date: May 2008
Location: Germany
Posts: 429
Thanked 26 Times in 22 Posts
Default

@vermaden

Fabio Checconi and Luigi Rizzo are the developers of geom_sched. So it's the beginning and we will certainly see a lots of improvements, including different scheduler plugins. ZFS doesn't need such a scheduler, because it already has such an IO scheduler.
__________________
use UNIX or die :-)
Reply With Quote
Old 28th November 2010
Oliver_H's Avatar
Oliver_H Oliver_H is offline
Real Name: Oliver Herold
UNIX lover
 
Join Date: May 2008
Location: Germany
Posts: 429
Thanked 26 Times in 22 Posts
Default

Just saw this:

http://www.c0t0d0s0.org/archives/706...t-century.html

The idea is rather old ....
__________________
use UNIX or die :-)
Reply With Quote
Old 28th November 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

Fucking blind hype ...
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Reply

Thread Tools
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
ATI Radeon HD 4250 - kernel patch giddyupman FreeBSD Installation and Upgrading 6 3rd October 2011 06:01 PM
ZFS for the Linux kernel J65nko News 0 7th June 2010 06:43 PM
Remote debugging Linux kernel Mr-Biscuit Other BSD and UNIX/UNIX-like 0 11th December 2008 04:46 AM
FreeBSD 7.1 kernel incompatible with a linux program map7 FreeBSD Installation and Upgrading 7 5th November 2008 11:17 PM
Linux Kernel map TerryP Other BSD and UNIX/UNIX-like 2 1st July 2008 05:33 AM


All times are GMT. The time now is 12:26 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick