Re: reschedule_idle changes in ac kernels

2001-06-04 Thread Nigel Gamble
hould be fixed in goodness(), if at all possible, and not leak out as an undocumented magic number into reschedule_idle(). Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ MontaVista Software

Re: [PATCH] x86 page fault handler not interrupt safe

2001-05-07 Thread Nigel Gamble
On Mon, 7 May 2001, Brian Gerst wrote: > Nigel Gamble wrote: > > > > On Mon, 7 May 2001, Linus Torvalds wrote: > > > On Mon, 7 May 2001, Brian Gerst wrote: > > > > This patch will still cause the user process to seg fault: The error > > > > code

Re: [PATCH] x86 page fault handler not interrupt safe

2001-05-07 Thread Nigel Gamble
s safe to allow preemption after cr2 has been saved */ + local_irq_restore(regs->eflags); + tsk = current; /* Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ MontaVista Software

Re: #define HZ 1024 -- negative effects?

2001-04-27 Thread Nigel Gamble
On Fri, 27 Apr 2001, Mike Galbraith wrote: > On Fri, 27 Apr 2001, Nigel Gamble wrote: > > > What about SCHED_YIELD and allocating during vm stress times? > > snip > > > A well-written GUI should not be using SCHED_YIELD. If it is > > I was refering to th

Re: #define HZ 1024 -- negative effects?

2001-04-27 Thread Nigel Gamble
it won't be using SCHED_YIELD or be marked runnable, it will be blocked, waiting until the resource becomes available. When that happens, it will preempt the compute task (if its priority is high enough, which is very likely - and can be assured if it's running at a real-time priority as I

Viewing SCHED_FIFO, SCHED_RR stats in /proc

2001-04-26 Thread Nigel Gamble
(task->policy == SCHED_FIFO) + nice = -99; + else + nice = task->nice; read_lock(&tasklist_lock); ppid = task->p_opptr->pid; Can anyone think of a better way of doing this? Nigel Gamble[EMAIL PROTECTED] Mou

Re: #define HZ 1024 -- negative effects?

2001-04-25 Thread Nigel Gamble
nything else, like serial port timing, etc.? Why not just run the X server at a realtime priority? Then it will get to respond to existing events, such as keyboard and mouse input, promptly without creating lots of superfluous extra clock interrupts. I think you will find this is a better solution.

Re: Scheduling bug for SCHED_FIFO and SCHED_RR

2001-04-24 Thread Nigel Gamble
On Fri, 20 Apr 2001, Nigel Gamble wrote: > A SCHED_FIFO or SCHED_RR task with priority n+1 will not preempt a > running task with priority n. You need to give the higher priority task > a priority of at least n+2 for it to be chosen by the scheduler. > > The problem is caused by

Re: 2.4.3+ sound distortion

2001-04-21 Thread Nigel Gamble
roblem. Try running xmms as root with the "Use realtime priority when available" option checked. If the distortion is because xmms isn't getting enough CPU time, then running it at a realtime priority will fix it. Nigel Gamble[EMAIL PROTEC

Scheduling bug for SCHED_FIFO and SCHED_RR

2001-04-20 Thread Nigel Gamble
ed = 1; #endif } Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ MontaVista Software [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

Re: [Lse-tech] Re: [PATCH for 2.5] preemptible kernel

2001-04-11 Thread Nigel Gamble
ssible delays in such cases. How's this > going to work for Linux? The same way everything works for Linux: with enough people around the world interested in and working on these problems, they will be fixed. Nigel Gamble[EMAIL

Re: [Lse-tech] Re: [PATCH for 2.5] preemptible kernel

2001-04-11 Thread Nigel Gamble
h as > > module unloading, where there was a concern that it was not > > practical to have any sort of lock in the read-side code path and > > the write side was not time critical. > > True, but only if the synchronize_kernel() implementa

Re: [Lse-tech] Re: [PATCH for 2.5] preemptible kernel

2001-04-10 Thread Nigel Gamble
re was a concern that it was not practical to have any sort of lock in the read-side code path and the write side was not time critical. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ MontaVista Software

Re: [Lse-tech] Re: [PATCH for 2.5] preemptible kernel

2001-04-09 Thread Nigel Gamble
text switches. Second, the scheduler should not penalize the preempted task for being preempted, so that it should usually get to continue running as soon as the preempting task is descheduled, which is at most one timeslice for timesharing tasks. Nigel Gamble[EMA

Re: [PATCH for 2.5] preemptible kernel

2001-04-01 Thread Nigel Gamble
e because of the problem of avoiding deadlock on the runqueue lock, which the wait queues also use. The above code in schedule needs the runqueue lock to protect sync_count. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http:/

Re: [PATCH for 2.5] preemptible kernel

2001-04-01 Thread Nigel Gamble
ve schedule() point, aren't they, so those tasks are already safe to access the data we are protecting. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ MontaVista Software

Re: [PATCH for 2.5] preemptible kernel

2001-03-29 Thread Nigel Gamble
On Tue, 20 Mar 2001, Nigel Gamble wrote: > On Tue, 20 Mar 2001, Rusty Russell wrote: > > Thoughts? > > Perhaps synchronize_kernel() could take the run_queue lock, mark all the > tasks on it and count them. Any task marked when it calls schedule() > voluntarily (but not i

Re: Use semaphore for producer/consumer case...

2001-03-23 Thread Nigel Gamble
r completion */ > down(&sem); > } Then consumer could be: consumer() { int i; start_producers(); /* Wait for 10 items to be produced */ for (i = 0; i < 10; i++) dow

Re: [PATCH for 2.5] preemptible kernel

2001-03-23 Thread Nigel Gamble
documentation) it will become widely understood, as > it offers scalability and efficiency. Actually, I agree with you now that I've had a chance to think about this some more. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA.

lock_kernel() usage and sync_*() functions

2001-03-21 Thread Nigel Gamble
preemptible kernel, I'm hoping it would be OK to replace them with a semaphore. Please let me know if this is not the case. Thanks! Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ MontaVista Sof

Re: [PATCH for 2.5] preemptible kernel

2001-03-21 Thread Nigel Gamble
others in pgalloc.h. If you know of any other similar problems on uniprocessors, please let me know. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ MontaVista Software [EMAIL PRO

Re: [PATCH for 2.5] preemptible kernel

2001-03-21 Thread Nigel Gamble
nt CPU for the duration that the value of smp_processor_id() is used. Or, if the critical region is very short, to disable interrupts on the local CPU. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ Mont

Re: [PATCH for 2.5] preemptible kernel

2001-03-20 Thread Nigel Gamble
hat has been preempted is on the run queue and can be rescheduled on a different CPU, so I can't see how a per-CPU counter would work. It seems to me that you would need a per run queue counter, like the example I gave in a previous posting. Nigel Gamble

Re: [PATCH for 2.5] preemptible kernel

2001-03-20 Thread Nigel Gamble
f() only increments current->preempt_count for the preempted task - the higher priority preempting task that is about to be scheduled will have a preempt_count of 0. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA.

Re: [PATCH for 2.5] preemptible kernel

2001-03-20 Thread Nigel Gamble
te current cpu, reschedule */ > while ((current->cpus_allowed &= ~(1 << smp_processor_id())) != 0) > schedule(); > > /* Back to normal. */ > current->cpus_allowed = cpus_allowed; > current->policy = policy; > current-

Re: [PATCH for 2.5] preemptible kernel

2001-03-20 Thread Nigel Gamble
ed the generated code) The other cases are not very common, as they only happen if a task is preempted during the short time that it is running while in the process of changing state while going to sleep or waking up, so the default case is probably OK for them; and I'd

Re: [PATCH for 2.5] preemptible kernel

2001-03-19 Thread Nigel Gamble
e need to enter the page fault handler with interrupts disabled to protect the cr2 register. The interrupt state is restored immediately after cr2 has been saved. Otherwise, an interrupt could cause the faulting thread to be preempted, and the new thread could also fault,

Locking question (was: [CHECKER] 9 potential copy_*_user bugs in2.4.1)

2001-03-16 Thread Nigel Gamble
the down and up calls are made by different threads. The former use is a "lock", while the latter down() use is a "potentially blocking function" in terms of your question. I don't know how easy it would be for your analysis tools to distinguish between them. Nigel G

[PATCH for 2.5] preemptible kernel

2001-03-14 Thread Nigel Gamble
o move them into sched.h, like d_path(), as I don't want to make it more difficult to apply kernel patches to my kernel source tree.) Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ diff -Nur 2.4.2/CRED

Re: spinlock help

2001-03-06 Thread Nigel Gamble
sequence valid? > spin_lock_irqsave(a,b); > spin_lock_irqsave(c,d); Yes, as long as it is followed by: spin_unlock_irqrestore(c, d); spin_unlock_irqrestore(a, b); Nigel Gamble[EMAIL PROTECTED] Mountai

Re: [linux-audio-dev] low-latency scheduling patch for 2.4.0

2001-01-21 Thread Nigel Gamble
latency, we should just use his so-called "RTLinux" environment for low-latency tasks. RTLinux is not Linux, it is a separate environment with a separate, limited set of APIs. You can't run XMMS, or any other existing Linux audio app in RTLinux. I want a low-latency Linux, not just anothe

Re: [linux-audio-dev] low-latency scheduling patch for 2.4.0

2001-01-21 Thread Nigel Gamble
rcial axe to grind in his continual bad-mouthing of IRIX, the internals of which he knows nothing about. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ - To unsubscribe from this list: send the line "unsu

Re: Latency: allowing resheduling while holding spin_locks

2001-01-13 Thread Nigel Gamble
occurred, since we won't see the interrupt until it's safe to do the preemptive resched. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ - To unsubscribe from this list: send the line "unsubscrib

Re: [linux-audio-dev] low-latency scheduling patch for 2.4.0

2001-01-12 Thread Nigel Gamble
On Sat, 13 Jan 2001, Andrew Morton wrote: > Nigel Gamble wrote: > > Spinlocks should not be held for lots of time. This adversely affects > > SMP scalability as well as latency. That's why MontaVista's kernel > > preemption patch uses sleeping mutex locks instea

Re: [linux-audio-dev] low-latency scheduling patch for 2.4.0

2001-01-12 Thread Nigel Gamble
> > If so, it's no great surprise that performance dropped given that we replaced > a spinlock (albeit one guarding somewhat more than the critical section) with > a semaphore. > > Tim > > -- > Tim Wright - [EMAIL PROTECTED] or [EMAIL PROTECTED] or [EMAIL PROT

Re: [linux-audio-dev] low-latency scheduling patch for 2.4.0

2001-01-11 Thread Nigel Gamble
n the running process sleeps (voluntarily or when it has to wait for something) or exits. This is the case in both of the fully preemptible kernels which I've worked on (IRIX and REAL/IX). Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA.

Re: [PATCH] 2.4.0-prerelease: preemptive kernel.

2001-01-04 Thread Nigel Gamble
bably between 1% and 10% of the total context switches per second. And it's certainly interesting to me that I can listen to MP3s without interruption now, while doing a kernel build! Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA.

Re: [PATCH] 2.4.0-prerelease: preemptive kernel.

2001-01-04 Thread Nigel Gamble
On Thu, 4 Jan 2001, Andi Kleen wrote: > On Thu, Jan 04, 2001 at 01:39:57PM -0800, Nigel Gamble wrote: > > Experience has shown that adaptive spinlocks are not worth the extra > > overhead (if you mean the type that spin for a short time > > and then decide to sleep).

Re: [PATCH] 2.4.0-prerelease: preemptive kernel.

2001-01-04 Thread Nigel Gamble
orking on a new implementation that also does priority inheritance, to avoid the priority inversion problem, and that does the minimum necessary context switches. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/

Re: [PATCH] 2.4.0-prerelease: preemptive kernel.

2001-01-04 Thread Nigel Gamble
by definition, disables kernel preemption without the need to set a no-preempt flag) to protect regions where the lock is held for a maximum of around 100us, and to use a sleeping mutex lock for longer regions. This is what I'm working towards. Nigel Gamble

Re: [PATCH] 2.4.0-prerelease: preemptive kernel.

2001-01-04 Thread Nigel Gamble
od enough for most audio apps. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED]

Re: [PATCH] 2.4.0-prerelease: preemptive kernel.

2001-01-04 Thread Nigel Gamble
, I didn't realise you were still working on this. Did you know that I am also? Our most recent version is at: ftp://ftp.mvista.com/pub/Area51/preemptible_kernel/ although I have yet to put up a 2.4.0-prerelease patch (coming soon). We should probably pool our efforts on this for 2.5.

Re: [RFC] Semaphores used for daemon wakeup

2000-12-18 Thread Nigel Gamble
ot of operating systems already use. Nigel Gamble[EMAIL PROTECTED] Mountain View, CA, USA. http://www.nrg.org/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMA

[PATCH] Latest preemptible kernel (low latency) patch available

2000-11-22 Thread Nigel Gamble
aths are now dominated by the big kernel lock, which we hope can be completely eliminated in 2.5 by finer grained locks. (I will be at the Linux Real-Time Workshop in Orlando next week, and may not be able to access my work email address ([EMAIL PROTECTED]), which is why I'm posting this fr

Locking problem in autofs4_expire(), 2.4.0-test10

2000-11-03 Thread Nigel Gamble
@@ mntput(p); return dentry; } + spin_unlock(&dcache_lock); dput(d); mntput(p); + spin_lock(&dcache_lock); } spin_unlock(&dcache_lock); Nigel Gamble MontaVista Software - To unsu

Re: Weightless process class

2000-10-04 Thread Nigel Gamble
ment priority inheritance, until this type of starvation scenario occured! I'm working on making the linux kernel fully preemptible (as I did for IRIX when I used to work at SGI), and will need priority inheritance mutexes to enable real-time behavior for SCHED_FIFO and SCHED_RR tasks. So someon

Re: Interrupt/Sleep deadlock

2000-09-28 Thread Nigel Gamble
You could use a semaphore for this. Initialize it to 0, then call down() from the ioctl, and up() from the interrupt handler. If the up() happens before the down(), the down() won't go to sleep. Nigel - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a me