On Mon, 30 Mar 2015 07:44:30 -0500 (CDT)
Christoph Lameter <c...@linux.com> 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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to