Re: [PATCH] memcg: remove unneeded preempt_disable
From: James Bottomley <James.bottomley@HansenPartnership.com>
Date: 2011-08-25 16:34:25
Also in:
linux-arch, lkml
Christoph Lameter [off-list ref] wrote:
On Thu, 25 Aug 2011, James Bottomley wrote:quoted
On Thu, 2011-08-25 at 10:11 -0500, Christoph Lameter wrote:quoted
On Thu, 25 Aug 2011, Peter Zijlstra wrote:quoted
On Thu, 2011-08-18 at 14:40 -0700, Andrew Morton wrote:quoted
I think I'll apply it, as the call frequency is low (correct?)and thequoted
quoted
quoted
quoted
problem will correct itself as other architectures implementtheirquoted
quoted
quoted
quoted
atomic this_cpu_foo() operations.Which leads me to wonder, can anything but x86 implement thatthis_cpu_*quoted
quoted
quoted
muck? I doubt any of the risk chips can actually do all this. Maybe Itanic, but then that seems to be dying fast.The cpu needs to have an RMW instruction that does something to a variable relative to a register that points to the per cpu base. Thats generally possible. The problem is how expensive the RMW isgoing toquoted
quoted
be.Risc systems generally don't have a single instruction for this,that'squoted
correct. Obviously we can do it as a non atomic sequence: read variable, compute relative, read, modify, write ... but there's absolutely no point hand crafting that in asm since the compiler can usually work it out nicely. And, of course, to have this atomic, we have to use locks, which ends up being very expensive.ARM seems to have these LDREX/STREX instructions for that purpose which seem to be used for generating atomic instructions without lockes. I guess other RISC architectures have similar means of doing it?
Arm isn't really risc. Most don't. However even with ldrex/strex you need two instructions for rmw. James -- Sent from my Android phone with K-9 Mail. Please excuse my brevity and top posting. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>