어느 spinlock이 더 좋을까요?

hanaban의 이미지

커널 소스를 보면 spinlock.h 가 두개가 있습니다.

include/linux/spinlock.h
include/asm/spinlock.h

어느게 성능이 더 나을 까요?

flyduck의 이미지

include/linux/spinlock.h

include/linux와 include/asm에 같은 이름의 헤더가 있으면 보통 linux밑에 있는 것을 사용합니다. linux에 있는 것이 asm에 있는 것을 include하고 있을 것입니다.

Freedom is another word for nothing left to lose,
Nothing doesn't mean nothing if it ain't free.

hanaban의 이미지

커널 소스를 보면 linux와 asm의 spinlock.h가 각각의 펑션을 따로 정의하고 있습니다.

한쪽이 한쪽을 include하진 않고 있구요..
둘다 assembly 소스가 나오는데 제가 어셈블리어를 잘 몰라서..
어느게 성능이 나은지 알수가 없네요.. -_-;

flyduck의 이미지

include/linux/spinlock.h :

#ifdef CONFIG_SMP
#include <asm/spinlock.h>
#else

Freedom is another word for nothing left to lose,
Nothing doesn't mean nothing if it ain't free.