The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [linux-kernel]Why there are so many struct rw_semaphore being defined?
@ 2007-07-04  9:07 jidong xiao
  2007-07-04  9:15 ` Oliver Neukum
  0 siblings, 1 reply; 3+ messages in thread
From: jidong xiao @ 2007-07-04  9:07 UTC (permalink / raw)
  To: linux-kernel

I see struct rw_semaphore is defined in
include/linux/rwsem-spinlock.h,in the meanwhile, I also can find it in
include/asm-**/rwsem.h,for
example,include/asm-i386/rwsem.h,include/asm-x86_64/rwsem.h,why?which
one should be used?

Thanks
Jason Xiao

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-kernel]Why there are so many struct rw_semaphore being defined?
  2007-07-04  9:07 [linux-kernel]Why there are so many struct rw_semaphore being defined? jidong xiao
@ 2007-07-04  9:15 ` Oliver Neukum
  2007-07-04 10:34   ` Stefan Richter
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Neukum @ 2007-07-04  9:15 UTC (permalink / raw)
  To: jidong xiao; +Cc: linux-kernel

Am Mittwoch, 4. Juli 2007 schrieb jidong xiao:
> I see struct rw_semaphore is defined in
> include/linux/rwsem-spinlock.h,in the meanwhile, I also can find it in

Quote:

#ifndef _LINUX_RWSEM_H
#error "please don't include linux/rwsem-spinlock.h directly, use linux/rwsem.h instead"
#endif

> include/asm-**/rwsem.h,for
> example,include/asm-i386/rwsem.h,include/asm-x86_64/rwsem.h,why?which
> one should be used?

This structure is so important to performance that some architectures
have version optimized to their features.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-kernel]Why there are so many struct rw_semaphore being defined?
  2007-07-04  9:15 ` Oliver Neukum
@ 2007-07-04 10:34   ` Stefan Richter
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Richter @ 2007-07-04 10:34 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: jidong xiao, linux-kernel

Oliver Neukum wrote:
> Am Mittwoch, 4. Juli 2007 schrieb jidong xiao:
>> I see struct rw_semaphore is defined in
>> include/linux/rwsem-spinlock.h,in the meanwhile, I also can find it in
> 
> Quote:
> 
> #ifndef _LINUX_RWSEM_H
> #error "please don't include linux/rwsem-spinlock.h directly, use linux/rwsem.h instead"
> #endif
> 
>> include/asm-**/rwsem.h,for
>> example,include/asm-i386/rwsem.h,include/asm-x86_64/rwsem.h,why?which
>> one should be used?
> 
> This structure is so important to performance that some architectures
> have version optimized to their features.

...but of course we generally include linux/rwsem.h instead of
architecture-specific header files.  linux/rwsem.h will transparently
pull in the optimized variants for us.  (It's evident from the source.)
-- 
Stefan Richter
-=====-=-=== -=== --=--
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-04 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-04  9:07 [linux-kernel]Why there are so many struct rw_semaphore being defined? jidong xiao
2007-07-04  9:15 ` Oliver Neukum
2007-07-04 10:34   ` Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox