LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-26-2007, 10:41 PM   #1
squallce
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Rep: Reputation: 0
Question System temporarily freezes at hard drive write!


Hi, I built my system from source following the LFS 6.3 book to the letter(pretty sure). After that I went though a mix of the latest BLFS book 6.2 and the dev copy of the BLFS book. I am running gnome but I noticed this problem before that when I was running TWM right after I installed X. It seems that whenever my system is doing a write to the hard drive the entire screen freezes including text when typing and mouse movement. It is possible it has been going on before I had X but did not notice because I only used one tty. It is very annoying needless to say but havn't had much luck finding anything out there on what the problem might be! Oh yeah, the system doesn't lock up perminatly. Only for a second or two while it does the write and then resumes normal operation for another 5-7 seconds.

Thanks for your ideas!!
 
Old 09-26-2007, 11:09 PM   #2
studioj
Member
 
Registered: Oct 2006
Posts: 460

Rep: Reputation: 31
that should be easy enough to fix.
the first thing i think of is make sure your disk is being seen as the correct type and DMA is enabled etc.
there is a weird trade off with a desktop machine and x.
also xorg just runs like crap and eats way to much resources.
you always want x to be responsive and not yield to others to the point of frozen cursor. on the other hand sometimes i set my box like that so i get good solid real time hard drive writes.

next thing i guess would be to make x less "nice"
try some thing like
renice -2 -p `ps -C Xorg -o pid=`
or
renice -3 -p `ps -C Xorg -o pid=`
you can of course put this in boot up scripts if it works

another factor potentially at work is the latency settings for your video card.
check out
lspci -v
for your video card you will see something like
latency 0
try something like
setpci -v -s '03:00.0' latency_timer=ff
where you make the '03:00.0' match whatever the address for your video card is showing in lspci.
ff in the above command will try to open the latency all the way up to max burst size and max getting along better with others (might help)
you can also try other numbers including lower ones than defaults.. some video drivers might not take this command at all.
also might help to make sure mtrr is being set on your video memory
i have to use the command
echo "base=0xc0000000 size=0x10000000 type=write-combining" >| /proc/mtrr
at boot but i can remember the procedure for comming up with the proper command.
just google mtrr.

last but not least is to recompile the kernel with it set to use a better scheduling algorithm.

Last edited by studioj; 09-26-2007 at 11:12 PM.
 
Old 09-27-2007, 12:56 AM   #3
squallce
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: 0
I checked if DMA was enabled using "cat /proc/ide/hda/settings" and using_dma is set to 0 so attempting to follow a tutorial I found I installed hdparm and this is the results of what happens when I try to enable DMA.

root@cegan-lfs:/home/chris$ hdparm -i /dev/hda

/dev/hda:

Model=FUJITSU MHV2080AT PL, FwRev=008300A1, SerialNo=NS90T642CYCE
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=156301488
IORDY=yes, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled
Drive conforms to: unknown: ATA/ATAPI-2,3,4,5,6,7

* signifies the current active mode

root@cegan-lfs:/home/chris$ hdparm -d1 /dev/hda

/dev/hda:
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
using_dma = 0 (off)
root@cegan-lfs:/home/chris$

It says "HDIO_SET_DMA failed: Operation not permitted" but I don't understand this. As you can see by my prompt I am logged in as root.
The guide I attempted to follow is http://www.linuxjournal.com/article/5203

Thanks for your advice studioj!
If anyone knows why i'm getting this Operation not permitted please let me know!!
 
Old 09-27-2007, 02:07 AM   #4
squallce
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Talking

I found the solution and everything seems to be working now!!! Thanks so much! If anyone comes across this same problem looking at this thread in the future I found the answer in another thread http://www.linuxquestions.org/questi...d.php?t=260894


I recompiled my kernel and it worked like a charm
 
  


Reply



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
System freezes when I write to/read from either of my two new SATA drives jagavskyrproblem Linux - Hardware 0 09-22-2007 11:22 PM
Can't Write to External Hard Drive Sloppyunderfoot Linux - Hardware 2 08-18-2007 10:05 PM
2 hard drive in system mirror 1st hard drive sburns76247 Linux - General 2 12-21-2004 01:47 AM
hard drive write causes reboot eastsuse Linux - Newbie 2 05-14-2004 10:49 AM
My comp freezes while using two hard drive stickman200 Debian 4 11-12-2003 10:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11: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
Open Source Consulting | Domain Registration