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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]