On Fri, 20 May 2011 06:19:55 +0200 Eric Dumazet <[email protected]> wrote:
> Le lundi 16 mai 2011 à 12:37 -0700, [email protected] a écrit : > > The patch titled > > seqlock: don't smp_rmb in seqlock reader spin loop > > has been removed from the -mm tree. Its filename was > > seqlock-dont-smp_rmb-in-seqlock-reader-spin-loop.patch > > > > This patch was dropped because it was merged into mainline or a subsystem > > tree > > > > The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ > > > > ------------------------------------------------------ > > Subject: seqlock: don't smp_rmb in seqlock reader spin loop > > From: Milton Miller <[email protected]> > > > > Hi ! > > I dont see this patch in 2.6.39 or current Linus tree. > > In which subsystem tree can I find it ? > linux-next: z:/usr/src/git26> git whatchanged include/linux/seqlock.h commit 5db1256a5131d3b133946fa02ac9770a784e6eb2 Author: Milton Miller <[email protected]> Date: Thu May 12 04:13:54 2011 -0500 seqlock: Don't smp_rmb in seqlock reader spin loop Move the smp_rmb after cpu_relax loop in read_seqlock and add ACCESS_ONCE to make sure the test and return are consistent. A multi-threaded core in the lab didn't like the update from 2.6.35 to 2.6.36, to the point it would hang during boot when multiple threads were active. Bisection showed af5ab277ded04bd9bc6b048c5a2f0e7d70ef0867 (clockevents: Remove the per cpu tick skew) as the culprit and it is supported with stack traces showing xtime_lock waits including tick_do_update_jiffies64 and/or update_vsyscall. Experimentation showed the combination of cpu_relax and smp_rmb was significantly slowing the progress of other threads sharing the core, and this patch is effective in avoiding the hang. A theory is the rmb is affecting the whole core while the cpu_relax is causing a resource rebalance flush, together they cause an interfernce cadance that is unbroken when the seqlock reader has interrupts disabled. At first I was confused why the refactor in 3c22cd5709e8143444a6d08682a87f4c57902df3 (kernel: optimise seqlock) didn't affect this patch application, but after some study that affected seqcount not seqlock. The new seqcount was not factored back into the seqlock. I defer that the future. While the removal of the timer interrupt offset created contention for the xtime lock while a cpu does the additonal work to update the system clock, the seqlock implementation with the tight rmb spin loop goes back much further, and is just waiting for the right trigger. Cc: <[email protected]> Signed-off-by: Milton Miller <[email protected]> Cc: <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Paul McKenney <[email protected]> Acked-by: Eric Dumazet <[email protected]> Link: http://lkml.kernel.org/r/%3Cseqlock-rmb%40mdm.bga.com%3E Signed-off-by: Thomas Gleixner <[email protected]> It seems that tglx picked it up. _______________________________________________ stable mailing list [email protected] http://linux.kernel.org/mailman/listinfo/stable
