mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: christoph <christoph@scalex86.org>
To: ak@suse.de
Cc: linux-kernel@vger.kernel.org, shai@scalex86.org
Subject: [PATCH] Move some variables into the "most_readonly" section??
Date: Tue, 7 Jun 2005 12:58:38 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.62.0506071253020.2850@ScMPusgw> (raw)

These variables cause false sharing in some circumstances. However, they 
are just small pointers and 4 byte ints. So this patch would result in 
some wastage of memory since each of those pointers then would occupy a 
whole cache line.

Do we have any provisions for this situation? Or do we need a new section 
for mostly_readonly?
 
Signed-off-by: Alok N Kataria <alokk@calsoftinc.com>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Christoph Lameter <christoph@scalex86.org>

Index: linux-2.6.12-rc6-mm1/arch/i386/kernel/time.c
===================================================================
--- linux-2.6.12-rc6-mm1.orig/arch/i386/kernel/time.c	2005-06-07 11:15:43.000000000 -0700
+++ linux-2.6.12-rc6-mm1/arch/i386/kernel/time.c	2005-06-07 11:27:57.000000000 -0700
@@ -88,7 +88,7 @@ EXPORT_SYMBOL(rtc_lock);
 DEFINE_SPINLOCK(i8253_lock);
 EXPORT_SYMBOL(i8253_lock);
 
-struct timer_opts *cur_timer = &timer_none;
+struct timer_opts *cur_timer __cacheline_aligned_mostly_readonly = &timer_none;
 
 /*
  * This is a special lock that is owned by the CPU and holds the index
Index: linux-2.6.12-rc6-mm1/arch/i386/kernel/timers/timer_hpet.c
===================================================================
--- linux-2.6.12-rc6-mm1.orig/arch/i386/kernel/timers/timer_hpet.c	2005-06-07 11:26:36.000000000 -0700
+++ linux-2.6.12-rc6-mm1/arch/i386/kernel/timers/timer_hpet.c	2005-06-07 11:27:57.000000000 -0700
@@ -18,7 +18,9 @@
 #include "mach_timer.h"
 #include <asm/hpet.h>
 
-static unsigned long hpet_usec_quotient;	/* convert hpet clks to usec */
+static unsigned long hpet_usec_quotient __cacheline_aligned_mostly_readonly;
+			/* convert hpet clks to usec */
+
 static unsigned long tsc_hpet_quotient;		/* convert tsc to hpet clks */
 static unsigned long hpet_last; 	/* hpet counter value at last tick*/
 static unsigned long last_tsc_low;	/* lsb 32 bits of Time Stamp Counter */
Index: linux-2.6.12-rc6-mm1/drivers/char/random.c
===================================================================
--- linux-2.6.12-rc6-mm1.orig/drivers/char/random.c	2005-06-07 11:13:41.000000000 -0700
+++ linux-2.6.12-rc6-mm1/drivers/char/random.c	2005-06-07 11:27:57.000000000 -0700
@@ -271,7 +271,8 @@ static int random_write_wakeup_thresh = 
  * samples to avoid wasting CPU time and reduce lock contention.
  */
 
-static int trickle_thresh = INPUT_POOL_WORDS * 28;
+static int trickle_thresh __cacheline_aligned_mostly_readonly =
+			INPUT_POOL_WORDS * 28;
 
 static DEFINE_PER_CPU(int, trickle_count) = 0;
 

             reply	other threads:[~2005-06-07 19:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-07 19:58 christoph [this message]
2005-06-08 13:18 ` Andi Kleen
2005-06-14 22:54   ` christoph
2005-06-14 23:04     ` Andi Kleen
2005-06-14 23:17       ` Christoph Lameter
2005-06-14 23:19         ` Andi Kleen
2005-06-14 23:27           ` Christoph Lameter
2005-06-14 23:54             ` Andi Kleen
2005-06-14 23:23     ` Andrew Morton
2005-06-14 23:46       ` christoph
2005-06-14 23:58         ` Andrew Morton
2005-06-15  0:05           ` christoph
2005-06-15  0:16             ` Andrew Morton
2005-06-15  0:41               ` Andi Kleen
2005-06-17 13:55                 ` Anton Blanchard
2005-06-27 23:17                   ` christoph
2005-06-15  0:18           ` Nick Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.62.0506071253020.2850@ScMPusgw \
    --to=christoph@scalex86.org \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shai@scalex86.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®