Re: [PATCH] memcg: remove unneeded preempt_disable

James Bottomley
2011-08-25T19:29:10Z

On Thu, 2011-08-25 at 13:46 -0500, Christoph Lameter wrote:
> On Thu, 25 Aug 2011, James Bottomley wrote:
>
> > >Well then what is "really risc"? RISC is an old beaten down marketing
> > >term
> > >AFAICT and ARM claims it too.
> >
> > Reduced Instruction Set Computer. This is why we're unlikely to have
> > complex atomic instructions: the principle of risc is that you build
> > them up from basic ones.
>
> RISC cpus have instruction to construct complex atomic actions by the cpu
> as I have shown before for ARM.
>
> Principles always have exceptions to them.
>
> (That statement in itself is a principle that should have an exception I
> guess. But then language often only makes sense when it contains
> contradictions.)

We seem to be talking at cross purposes. I'm not saying a risc system
can't do this ... of course the risc primitives can build into whatever
you want. To make it atomic, you simply add locking. What I'm saying
is that open coding asm in a macro makes no sense because the compiler
will do it better from C. Plus, since the net purpose of this patch is
to require us to lock around each op instead of doing a global lock (or
in this case preempt disable) then you're making us less efficient at
executing it.

Therefore from the risc point of view, most of the this_cpu_xxx
operations are things that we don't really care about except that the
result would be easier to read in C.

James