Re: [PATCH] __cacheline_aligned_in_smp?

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Mon Jan 13 2003 - 20:10:12 EST


On Sun, 12 Jan 2003 23:35:13 -0800 (PST)
"David S. Miller" <davem@redhat.com> wrote:

> All of the submembers are placed at cacheline boundaries, which
> helps even on UP. If I meant cacheline aligned on SMP I would
> have used the corresponding macro :)

Hmm, you really want to weakly align it: you don't care if something follows it on
the cacheline, (ie. don't make it into an array, but it'd be nice if other
things could share the cacheline) in UP.

I don't think there's a way of doing that short of using asm?

It'd be nice if someone volunteered benchmarks. struct tcp_hashinfo takes
*two* whole cachlines, for example:

> -struct tcp_hashinfo __cacheline_aligned tcp_hashinfo = {
> +struct tcp_hashinfo __cacheline_aligned_in_smp tcp_hashinfo = {
>
> This definitely too.

The decl already puts the non-read-heavy members __cacheline_aligned:

extern struct tcp_hashinfo {
        ...
        rwlock_t __tcp_lhash_lock ____cacheline_aligned;

*This* should probably be ____cacheline_aligned_in_smp, yes?

Thanks for the reply!
Rusty.

-- 
   there are those who do and those who hang on and you don't see too
   many doers quoting their contemporaries.  -- Larry McVoy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 22:00:48 EST