[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m2sjmj572m.fsf@firstfloor.org>
Date: Sun, 23 Oct 2011 21:47:45 -0700
From: Andi Kleen <andi@...stfloor.org>
To: Eial Czerwacki <eial@...lemp.com>
Cc: linux-kernel@...r.kernel.org,
"Shai Fultheim \(Shai\@ScaleMP.com\)" <Shai@...lemp.com>
Subject: Re: [PATCH] Move mostly read variables to __read_mostly section.
Eial Czerwacki <eial@...lemp.com> writes:
> * Once the number of bh's in the machine exceeds this level, we start
> --- a/kernel/time/timekeeping.c 2010-05-12 14:59:32.000000000 -0700
> +++ b/kernel/time/timekeeping.c 2010-05-24 11:56:32.000000000 -0700
> @@ -154,7 +154,7 @@ __cacheline_aligned_in_smp DEFINE_SEQLOC
> * used instead.
> */
> static struct timespec xtime __attribute__ ((aligned (16)));
> -static struct timespec wall_to_monotonic __attribute__ ((aligned (16)));
> +static struct timespec wall_to_monotonic __attribute__ ((aligned
> (16))) __read_mostly;
That means that a common time fetch/update call will usually have to fetch two
cachelines now instead of one, because it needs xtime and
wall_to_monotonic. Usually those end up nearby.
On the other hand it's rare to fetch wall_to_monotonic without xtime.
So if anything all those variables should be grouped together in a
single cacheline, but definitely not split like you do.
The other changes in your patch are fine for me.
-Andi
--
ak@...ux.intel.com -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists