Re: [patch 04/41] cpu ops: Core piece for generic atomic per cpu operations

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rusty Russell
Date: Thursday, June 5, 2008 - 4:59 pm

On Thursday 05 June 2008 04:18:19 Mike Travis wrote:

Yes.  Because the only true per-cpu vars are the static ones, cpu_local_inc() 
only works on identifiers, not arbitrary pointers.  Once this is fixed, we 
should be enhancing the infrastructure to allow that (AFAICT it's not too 
hard, but we should add an __percpu marker for sparse).


I think the latter: __get_cpu_ptr() perhaps?


Indeed.


Yes, this should be fixed.  I thought i386 had optimized versions pre-merge, 
but I was wrong (%gs for per-cpu came later, and noone cleaned up these naive 
versions).  Did you want me to write them?

I actually think that using local_t == atomic_t is better than 
preempt_disable/enable for most archs which can't do atomic deref-and-inc.


You might be right, but note that local_t is 64 bit on 64-bit platforms.  And 
speculation of possible use cases isn't a good reason to rip out working 
infrastructure :)

Cheers,
Rusty.




--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 04/41] cpu ops: Core piece for generic atomic per c ..., Christoph Lameter, (Thu May 29, 8:56 pm)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Thu May 29, 10:17 pm)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Thu May 29, 11:12 pm)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Fri May 30, 11:00 am)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Rusty Russell, (Thu Jun 5, 4:59 pm)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Mon Jun 9, 12:00 pm)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Tue Jun 10, 10:42 am)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Tue Jun 10, 5:15 pm)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Wed Jun 11, 4:39 pm)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Thu Jun 12, 10:19 am)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Thu Jun 12, 7:27 pm)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Mon Jun 16, 7:52 am)
Re: [patch 04/41] cpu ops: Core piece for generic atomic p ..., Christoph Lameter, (Mon Jun 16, 7:29 pm)