[patch] preempt-smp.patch, 2.6.8-rc3-mm2
From: Ingo Molnar (mingo_at_elte.hu)
Date: 08/09/04
- Previous message: Jose Luis Domingo Lopez: "Re: Disabling route cache"
- In reply to: Ingo Molnar: "Re: [patch] inode-lock-break.patch, 2.6.8-rc3-mm2"
- Next in thread: Peter Zijlstra: "Re: [patch] preempt-smp.patch, 2.6.8-rc3-mm2"
- Reply: Peter Zijlstra: "Re: [patch] preempt-smp.patch, 2.6.8-rc3-mm2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 9 Aug 2004 16:01:03 +0200 To: Andrew Morton <akpm@osdl.org>
* Ingo Molnar <mingo@elte.hu> wrote:
> i believe we should 'ignore' SMP spinlock starvation for now: it will
> be fixed in a natural way with the most-spinlocks-are-mutexes
> solution, with that approach all preemption wishes of other CPUs are
> properly expressed in terms of need_resched().
>
> alternatively the 'release the lock every 128 iterations and do a
> cpu_relax()' hack could be used - but i think that doesnt solve the
> SMP issues in a sufficient way.
i've attached preempt-smp.patch (against 2.6.8-rc3-mm) which cleans up
most of these scheduling issues. It does the loop counting within
cond_resched_lock(). [and uninlines those functions for smaller
footprint.]
[ the loop counter is free-running so the counts of different loops get
concatenated - this is not a big issue and i dont think we want to touch
the loop counter every time we disable preemption (or enter a loop). ]
this patch in essence recognizes the fact that the current preemption
design is broken on SMP. It works the issue around by adding the polling
component to need_resched_lock(). These loop-checks used to be
open-coded in quite ugly ways.
the patch shows all the variants that occur typically: locked loop that
can be broken without state worries, and locked loops that need to
modify state to preempt safely.
the patch also fixes all the open-coded paths that did either
loop-counting or need-resched-checking and fixes a number of bugs that
occur with such open-coding: either the loop-counting or the
need-resched checking was missing.
once the need_resched() problem is solved cleanly by using mutexes for
all exclusion activity on SMP, this polling component can be removed.
i've tested the patch on x86 UP and SMP. (CONFIG_PREEMPT enabled.)
Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- text/plain attachment: preempt-smp.patch
- Previous message: Jose Luis Domingo Lopez: "Re: Disabling route cache"
- In reply to: Ingo Molnar: "Re: [patch] inode-lock-break.patch, 2.6.8-rc3-mm2"
- Next in thread: Peter Zijlstra: "Re: [patch] preempt-smp.patch, 2.6.8-rc3-mm2"
- Reply: Peter Zijlstra: "Re: [patch] preempt-smp.patch, 2.6.8-rc3-mm2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|