发新话题
打印

from gentoo weekly news mailist

from gentoo weekly news mailist

my hd performance was so much better after I enabled it.  Also, if you want dma to be enabled when you start your computer add this line to your /etc/conf.d/local.start file:  "/sbin/hdparm -qc1 -qd1 -qm16 -qk1 -qu1 /dev/hda" without quotes.  you can do a man hdparm to find out what each flag does, but I have found that this gies me the best performance.  Also, the "q" before each flag tells it to do that in quiet mode, which means it won't spit anything out on the screen when you boot up.      
象一阵风 拂过我身边 忽然间 想要去很远 和你去看繁华世界

TOP

nice -n -10 <emerger package>?      
象一阵风 拂过我身边 忽然间 想要去很远 和你去看繁华世界

TOP

速度能有多少提高?测试过吗AIKO?      
在自由的天空自由翱翔... Blog: http://www.donews.net/maxzhongcn

TOP

[QUOTE]最初由 AIKO_sex 发布
[B]nice -n -10 <emerger package>? [/B][/QUOTE]

这个是什么?      
在自由的天空自由翱翔... Blog: http://www.donews.net/maxzhongcn

TOP

hdparm /dev/hda (or whatever harddrive you have linux on)

My output looks like this:

/dev/hda:
multcount    = 16 (on)
IO_support   =  1 (32-bit)
unmaskirq    =  1 (on)
using_dma    =  1 (on)
keepsettings =  0 (off)
readonly     =  0 (off)
readahead    =  8 (on)
geometry     = 14593/255/63, sectors = 234441648, start = 0

The important one to look at is the 'using_dma' one.  If that is
not on, then it explains your problem.  You can set this by
issuing this command:

# hdparm -d1 /dev/hda
复制内容到剪贴板
代码:
I think this is all done for you if you have hdparm run on boot via

rc-update add hdparm default

Or run "/etc/init.d/hdparm start", at least on my system
You can check the performance difference by issuing this command
before and after you make that modification.

# hdparm -Tt /dev/hda
复制内容到剪贴板
代码:
Bob> I had this exact problem before.  This has much to do with the fact that
Bob> other distros enable DMA and put harddrive optimizations in for you.
Bob> With gentoo, you're going to have to do this yourself.

[...]

Bob> The important one to look at is the 'using_dma' one.  If that is not on,
Bob> then it explains your problem.  You can set this by issuing this
Bob> command:

I got the DMA flag on (the -d1 in my /etc/conf.d/hdparm); but thanks with the
-Tt flag, I didn't know it ;)

I play with the two flags I didn't have (-uX and -cX), and both seems to make
a BIG difference in the hard drive responsiveness. Besides, with the "-j1"
flag for make in /etc/make.conf, the compilation jerkiness are reduced a lot
too. The system is again usable emerging nautilus :)

Problem solved. The solution (in my laptop, at least, I'm in the office right
now), is to set this parameters for hdX (the hard drive):

hdparm -u1 -d1 -c1 -X66 /dev/hdX

-u1 set the interrupt unmask flag for the drive... whatever, it's faster :)
-c1 set the IO support for the drive to 32 bits
-d1 set the DMA flag for the drive (this is a must)
-X66 set the IDE transfer mode (watch out, the manual says that it could be
dangerous)

To set all this automagically, I put this line in /etc/conf.d/hdparm

disc0_args="-u1 -c1 -d1 -X66"

(my CD is a burner, so I use ide-scsi and hdparm can't work on those :) )

Don't forget to "rc-update add hdparm boot" :)

Besides, using "-j1" in the make options helps the compilation jerkiness (it
stops parallel buildings), so this goes in /etc/make.conf:

The difference is HUGE, so if anyone it's having problems with disk
performance, I greatly recommend it (just keep an eye in the -X66 flag).

Thanks everyone; it only took like two hours to have my problem solved.
      
象一阵风 拂过我身边 忽然间 想要去很远 和你去看繁华世界

TOP

about nc

复制内容到剪贴板
代码:
ok, here we go :)

first thing:
        do not do this if you're using the ck-sources.

the attached application ( compile it simply as "gcc -o XFree86.wrapper
wrapper.c" for example) simply starts  /usr/X11R6/bin/XFree86
with nice=-10.

so compile it,

move it to /usr/X11R6/bin

and verify that X is a symlink to XFree86.


now delete X,

and create it as a symlink to our wrapper:
"ln -s XFree86.wrapper X".

make our wrapper suid root(because of the nicing)

this way, when starting X, it calls our wrapper, which in turn calls the
original XFree86 executable with nice=-10.

hope this helps,

gabor


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>

const char *app = "/usr/X11R6/bin/XFree86";   // the actual binary
const int root = 0;   // root's uid
const int n = -10;    // desired nice priority valid range -20..20.

int main(int argc, char **argv)
{
  seteuid(root);    // The X server must be started as root under any Linux
  nice(n);          // Makes it nice
  execv(app, argv); // This is it!
  /* Should never see this unless *app points to invalid binary */
  fprintf(stderr, "Failed to execv %s with nice value of %d\n", app, n);
  exit(1);
}
复制内容到剪贴板
代码:
That makes sense if you want to start X manually. If you are starting it at
boot using XDM, wouldnt it be easier to change the Xservers file to:

:0 local nice -n -10 /usr/X11R6/bin/X
      
象一阵风 拂过我身边 忽然间 想要去很远 和你去看繁华世界

TOP

about the X flag

复制内容到剪贴板
代码:
The difference is HUGE, so if anyone it's having problems with disk
> performance, I greatly recommend it (just keep an eye in the -X66 flag).

yeah, definately keep an eye on or just don't use the -X flag. a few
years back i trashed my / filesystem using it.
      
象一阵风 拂过我身边 忽然间 想要去很远 和你去看繁华世界

TOP

3ks!好好消化一下。      
在自由的天空自由翱翔... Blog: http://www.donews.net/maxzhongcn

TOP

发新话题