* [d-kernel] info [немного недопонял, - В kernel 2.6.16 теперь ждущие блокировки spinlock() не работают?]
@ 2006-06-17 10:36 gosha
2006-06-17 16:31 ` Sergey Vlasov
0 siblings, 1 reply; 2+ messages in thread
From: gosha @ 2006-06-17 10:36 UTC (permalink / raw)
To: devel-kernel
Здравствуйте.
Проблема с kernel 2.6.16.18/20.- Пробовал пересобрать (портировать) kernel 2.6.16.18:
static spinlock_t lock;
spin_lock_init(&lock);
for(ir=0;ir<128;ir++)
{spin_lock(&lock);
printk("%s %s %d spinlock=%ld,%p\r\n", __FILE__, __FUNCTION__, __LINE__, ir, lock.raw_lock);
}
так она ни на одном мутексе не останавливается...
И в include/linux/spinlock*.h ничего похожего на разблокировку/ блокировку ....
---
include/linux/spinlock-up.h
#define __raw_write_unlock(lock) do { (void)(lock); } while (0)
#else /* DEBUG_SPINLOCK */
#define __raw_spin_is_locked(lock) ((void)(lock), 0)
/* for sched.c and kernel_lock.c: */
# define __raw_spin_lock(lock) do { (void)(lock); } while (0)
# define __raw_spin_unlock(lock) do { (void)(lock); } while (0)
# define __raw_spin_trylock(lock) ({ (void)(lock); 1; })
#endif /* DEBUG_SPINLOCK */
#define __raw_read_can_lock(lock) (((void)(lock), 1))
#define __raw_write_can_lock(lock) (((void)(lock), 1))
#define __raw_spin_unlock_wait(lock) \
do { cpu_relax(); } while (__raw_spin_is_locked(lock))
#endif /* __LINUX_SPINLOCK_UP_H */
Спасибо.
----
--
С Уважением,
gosha
mailto:embedded@nm.ru
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [d-kernel] info [немного недопонял, - В kernel 2.6.16 теперь ждущие блокировки spinlock() не работают?]
2006-06-17 10:36 [d-kernel] info [немного недопонял, - В kernel 2.6.16 теперь ждущие блокировки spinlock() не работают?] gosha
@ 2006-06-17 16:31 ` Sergey Vlasov
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Vlasov @ 2006-06-17 16:31 UTC (permalink / raw)
To: gosha, ALT Linux kernel packages development
[-- Attachment #1: Type: text/plain, Size: 899 bytes --]
On Sat, Jun 17, 2006 at 10:36:58AM +0000, gosha wrote:
> Проблема с kernel 2.6.16.18/20.- Пробовал пересобрать (портировать) kernel 2.6.16.18:
> static spinlock_t lock;
> spin_lock_init(&lock);
> for(ir=0;ir<128;ir++)
> {spin_lock(&lock);
> printk("%s %s %d spinlock=%ld,%p\r\n", __FILE__, __FUNCTION__, __LINE__, ir, lock.raw_lock);
> }
> так она ни на одном мутексе не останавливается...
Значит, этот тест был выполнен на ядре *-up, где spin_lock()
действительно ничего не делает. Spinlock используются только на SMP
для синхронизации между несколькими процессорами. Код, пытающийся
рекурсивно захватить один и тот же spinlock на одном процессоре,
недопустим - это гарантированный deadlock.
> И в include/linux/spinlock*.h ничего похожего на разблокировку/ блокировку ....
Все реализации spinlock архитектурно-зависимые, и поэтому лежат в
include/asm-*.
[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-17 16:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-17 10:36 [d-kernel] info [немного недопонял, - В kernel 2.6.16 теперь ждущие блокировки spinlock() не работают?] gosha
2006-06-17 16:31 ` Sergey Vlasov
ALT Linux kernel packages development
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
public-inbox-index devel-kernel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git