LinuxQuestions.org
Visit Jeremy's Blog.
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 02-21-2004, 08:22 PM   #1
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
preemptible kernel and dma (?)


Hi all,

I noticed this strange thing. Running mandrake 9.1 and I compiled kernel2.6.3 with the preemptible kernel enabled. What I noticed is that DVD playback got very choppy in xine, just as if I hadn't enabled dma on the drive (/dev/hdc). But hdparm told me that dma was enabled on the drive. After fiddling for a while (I recompiled xine against the new kernel; didn't bother with recompiling X though since it would take too long) and not finding a solution, I recompiled the kernel with preemption disabled. Now DVD playback is smooth again. I'm not sure if this a dma issue or something else that interferes with smooth reading from the drive when preemption is enabled. Has anyone else seen something like this?
 
Old 02-22-2004, 10:43 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
very strange problem
I'm not a Linux master, but I think it comes from something else. For example, in RTLinux you have to disable APM support to avoid similar problems.
For my own, I use a 2.4.23 kernel with low latency patch and I never had such problems
 
Old 02-22-2004, 10:52 AM   #3
Valthonis
LQ Newbie
 
Registered: Feb 2004
Location: Hartford, CT
Distribution: Gentoo
Posts: 5

Rep: Reputation: 0
I'm not too familiar with Mandrake itself, but I have heard of this dilemma with 2.6.x kernels and music/video playback. The problem is usually traceable down to the scripts your distro uses to start XFree86. Some distros (possibly Mandrake) increase the interactivity of X by increasing it's process priority using nice (i.e. nice -10 startx, etc.) With the preemptible kernel option and O(1) scheduler available in the 2.4.x-ck patchset and the 2.6.x stable kernel, such priority cheating is no longer necessary because the scheduler will automatically adjust and make sure your session is as interactive as possible.

You may want to do some research into Mandrake's bootscript setup to see if this is the case, then try again with CONFIG_PREEMPT=y

Just my 2KB
 
Old 02-22-2004, 11:21 AM   #4
Crito
Senior Member
 
Registered: Nov 2003
Location: Knoxville, TN
Distribution: Kubuntu 9.04
Posts: 1,168

Rep: Reputation: 53
Mandy starts X with nice -10 in /etc/X11/xdm/Xservers
 
Old 02-22-2004, 11:38 AM   #5
Valthonis
LQ Newbie
 
Registered: Feb 2004
Location: Hartford, CT
Distribution: Gentoo
Posts: 5

Rep: Reputation: 0
Quote:
Originally posted by Crito
Mandy starts X with nice -10 in /etc/X11/xdm/Xservers
Well, then... okay! If you go in and un-nice the afforementioned Xservers script, all SHOULD be well. Strangely enough, the interactivity features of 2.6 make nice-ing X a BAD idea...
 
Old 02-22-2004, 12:03 PM   #6
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Original Poster
Rep: Reputation: 48
cheers guys,

I'll see if that's the problem.
 
Old 02-22-2004, 12:31 PM   #7
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Original Poster
Rep: Reputation: 48
hm,

actually, X is running with nice value 0. I don't use the graphical login manager so maybe this has something to do with it.
Also, the problem does feel like a problem with disk drive performance. Playing back divx files and such is perfectly smooth. It's only DVDs.
 
Old 02-22-2004, 01:09 PM   #8
Crito
Senior Member
 
Registered: Nov 2003
Location: Knoxville, TN
Distribution: Kubuntu 9.04
Posts: 1,168

Rep: Reputation: 53
Just checked mandrake club archives, apparently they started using nice -10 for X with version 9.2. If your DVD is a combo drive that burns CDs too, you should probably check the /dev/dvd link to make sure it's pointing to the right block device. IDE-SCSI emulation is supposed to be deprecated in 2.6.x but the MDK 9.1 installer wouldn't have know that.
 
Old 02-22-2004, 01:18 PM   #9
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
to know if it comes from your dvd drive or something else, you can use this tool: http://www.linuxdj.com/latency-graph/
Then stress your hard drive... look the result. Do the same with your dvd drive and compare the results
According to my experience (with kernel 2.4 only), graph will have numerous high spikes for stress system without DMA... for DMA drive, no more than 10 spikes in 10-20 seconds. And with preempt or low-latency patch... everything stay flat (in fact 1 or 2 little spike every 20 sec )
 
Old 02-22-2004, 01:23 PM   #10
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Original Poster
Rep: Reputation: 48
Thanks guys,
the entries in /dev are ok. and I don't use ide-scsi. The problem can be 'solved' by merely swtiching to a kernel that has preemption disabled. which is very strange since if anything, I should see less trouble with preemption enabled. I'll check out the tool. thanks again.
 
Old 02-22-2004, 01:38 PM   #11
Crito
Senior Member
 
Registered: Nov 2003
Location: Knoxville, TN
Distribution: Kubuntu 9.04
Posts: 1,168

Rep: Reputation: 53
Guess I should add that all my attempts to bypass SCSI emulation for my IDE DVD/CD-RW drive failed miserably, but I'm using 2.4.22 myself so maybe 2.6.x will do the trick. Switching to the preemptive multimedia kernel did alleviate the problem somewhat however. Anyway, SCSI emulation seems to be the real performance killer... enabling DMA is almost irrelevant if you're stuck using it.

Last edited by Crito; 02-22-2004 at 01:49 PM.
 
Old 02-22-2004, 01:50 PM   #12
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Original Poster
Rep: Reputation: 48
the 2.6 kernel should get around the scsi emulation thing. I can burn CDs without scsi emulation these days.

With the 2.4 kernel, I could somehow fool the system into allowing me to access the drive through scsi emulation (/dev/scd0) *and* as a plain ide device (/dev/hdc). I could enable dma on /dev/hdc which helped for viewing dvds (/dev/dvd pointed to /dev/hdc), and I could burn through /dev/scd0. I'm not sure how I did it except that I was messing around with the kernel parameters. Disable ide-scsi and you get /dev/hdc. And then I enabled ide-scsi and somehow I had both devices available. I'm not sure if this can be reproduced, though.
 
  


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
DMA works but not by default (despite "use DMA by default" kernel) mehlkelm Linux - Hardware 7 04-11-2005 03:29 PM
How to create one non-preemptible and another preemptible thread in the user space? vinayparam Linux - Software 0 01-10-2005 09:17 AM
Preemptible Kernel (PREEMPT)---yes or no? ganja_guru Linux - Software 8 09-05-2004 11:29 AM
Preemptible Kernel? mooreted Linux - General 2 04-24-2004 07:40 PM
preemptible & low latency in 2.6.0test ? yocompia Linux - General 0 09-27-2003 06:29 PM

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

All times are GMT -5. The time now is 12:48 PM.

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