From mboxrd@z Thu Jan 1 00:00:00 1970 From: cl@linux.com (Christoph Lameter) Date: Thu, 30 Apr 2009 09:38:14 -0400 (EDT) Subject: [ltt-dev] [PATCH] Fix dirty page accounting in redirty_page_for_writepage() In-Reply-To: <20090430065055.GA16277@elte.hu> References: <20090429232546.GB15782@Krystal> <20090430024303.GB19875@Krystal> <20090430062140.GA9559@elte.hu> <20090430063306.GA27431@Krystal> <20090430065055.GA16277@elte.hu> Message-ID: On Thu, 30 Apr 2009, Ingo Molnar wrote: > > I see however that it's only guaranteed to be atomic wrt preemption. > > That's really only true for the non-x86 fallback defines. If we so > decide, we could make the fallbacks in asm-generic/percpu.h irq-safe The fallbacks have different semantics and therefore we cannot rely on irq safeness in the core code when using the x86 cpu ops. > nmi-safe isnt a big issue (we have no NMI code that interacts with > MM counters) - and we could make them irq-safe by fixing the > wrapper. (and on x86 they are NMI-safe too.) There are also context in which you alrady are preempt safe and where the per cpu ops do not need to go through the prremption hoops. This means it would be best to have 3 variants for 3 different contexts in the core code: 1. Need irq safety 2. Need preempt safety 3. We know the operation is safe due to preemption already having been disabled or irqs are not enabled. The 3 variants on x86 generate the same instructions. On other platforms they would need to be able to fallback in various way depending on the availability of instructions that are atomic vs. preempt or irqs. http://thread.gmane.org/gmane.linux.kernel.cross-arch/1124 http://lwn.net/Articles/284526/