Re: [for-next][PATCH 1/4] ring-buffer: Replace this_cpu_*() with __this_cpu_*()

From: Steven Rostedt
Date: Mon Mar 30 2015 - 09:37:29 EST


On Mon, 30 Mar 2015 07:44:30 -0500 (CDT)
Christoph Lameter <cl@xxxxxxxxx> wrote:


> > >
> > > or more compact
> > >
> > > unsigned int val = __this_cpu_read(current_context);
> > >
> > > __this_cpu_write(current_context, val & (val - 1));
> >
> > Maybe I'll just use your compact version.
>
> Hmmm... It could even be more compact
>
> __this_cpu_and(current_context, __this_cpu_read(current_context) - 1);

Hmm, I didn't realize there was an "and" version. I'm guessing this
would bring down the instruction count even more?

/me tries it.

I just finished testing my previous version. If this does prove to be
more compact, I'll have to replace that one with this one.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/