Messages in this thread | | | Date | Thu, 24 Feb 2005 08:56:57 -0500 | From | john cooper <> | Subject | Re: PPC RT Patch.. |
| |
Frank Rowand wrote: > john cooper wrote: >> ... There is also a bug fix >> contained for tlb_gather_mmu() which was causing debug >> assertions to be generated in a path which attempted to >> sleep with a non-zero preempt count. > > > Manish Lachwani mentioned to me that he faced the same issue > with the MIPS RT support and that when he discussed > it with Ingo that the solution was for include/asm-ppc/tlb.h > to include/asm-generic/tlb-simple.h when PREEMPT_RT is turned on. > The patch does this for the #ifdef CONFIG_PPC_STD_MMU case, > but not for the #else case. I don't know which case is used > for the Ampro board.
It appeared to me a generic issue though I believe a number of solutions are possible. asm-generic/tlb.h:tlb_gather_mmu() expands to linux/percpu.h:get_cpu_var() which does a preempt_disable() and __get_cpu_var(). This caused the debug assertion to kick when __page_cache_release() and to a lesser extent activate_page() attempted to block on a mutex (though other paths may well exist). My approach was to replace the outer layer preempt_disable/enable calls with a mutex-spinlock.
The fix was fairly easy once it was known from where the gratuitous call to preempt_disable() existed. I cobbled together a logging mechanism which detected the problem. As it wasn't very general I removed it from the patch. I didn't see an alternate means of diagnosing such a scenario so I'll likely address generalizing the code.
-john
-- john.cooper@timesys.com - 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/
| |