* [PATCH] net: wrong test in inet_ehash_locks_alloc()
@ 2009-01-27 14:42 Eric Dumazet
2009-01-28 1:45 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2009-01-27 14:42 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
In commit 9db66bdcc83749affe61c61eb8ff3cf08f42afec
(net: convert TCP/DCCP ehash rwlocks to spinlocks), I forgot to change
one occurrence of rwlock_t to spinlock_t
I believe sizeof(raw_spinlock_t) might be > 0 on !CONFIG_SMP if CONFIG_DEBUG_SPINLOCK
while sizeof(raw_rwlock_t) should be 0 in this case.
Fortunatly, CONFIG_DEBUG_SPINLOCK adds fields to both spinlock_t and rwlock_t,
but at this might change in the future (being able to debug spinlocks but not rwlocks for
example), better to be safe.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index f44bb5c..d0a0431 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -182,7 +182,7 @@ static inline int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo)
size = 2048;
if (nr_pcpus >= 32)
size = 4096;
- if (sizeof(rwlock_t) != 0) {
+ if (sizeof(spinlock_t) != 0) {
#ifdef CONFIG_NUMA
if (size * sizeof(spinlock_t) > PAGE_SIZE)
hashinfo->ehash_locks = vmalloc(size * sizeof(spinlock_t));
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: wrong test in inet_ehash_locks_alloc()
2009-01-27 14:42 [PATCH] net: wrong test in inet_ehash_locks_alloc() Eric Dumazet
@ 2009-01-28 1:45 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-01-28 1:45 UTC (permalink / raw)
To: dada1; +Cc: netdev
From: Eric Dumazet <dada1@cosmosbay.com>
Date: Tue, 27 Jan 2009 15:42:14 +0100
> In commit 9db66bdcc83749affe61c61eb8ff3cf08f42afec
> (net: convert TCP/DCCP ehash rwlocks to spinlocks), I forgot to change
> one occurrence of rwlock_t to spinlock_t
>
> I believe sizeof(raw_spinlock_t) might be > 0 on !CONFIG_SMP if CONFIG_DEBUG_SPINLOCK
> while sizeof(raw_rwlock_t) should be 0 in this case.
>
> Fortunatly, CONFIG_DEBUG_SPINLOCK adds fields to both spinlock_t and rwlock_t,
> but at this might change in the future (being able to debug spinlocks but not rwlocks for
> example), better to be safe.
>
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Agreed, applied.
Thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-28 1:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-27 14:42 [PATCH] net: wrong test in inet_ehash_locks_alloc() Eric Dumazet
2009-01-28 1:45 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).