linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] cache align vm_stat
@ 2011-10-27  8:50 Mel Gorman
  2011-10-27 12:51 ` Dimitri Sivanich
  2011-10-27 14:29 ` Mel Gorman
  0 siblings, 2 replies; 8+ messages in thread
From: Mel Gorman @ 2011-10-27  8:50 UTC (permalink / raw)
  To: Dimitri Sivanich
  Cc: linux-kernel, linux-mm, Andrew Morton, Christoph Lameter,
	David Rientjes, Andi Kleen

On Mon, Oct 24, 2011 at 11:10:35AM -0500, Dimitri Sivanich wrote:
> Avoid false sharing of the vm_stat array.
> 
> This was found to adversely affect tmpfs I/O performance.
> 

I think this fix is overly simplistic. It is moving each counter into
its own cache line. While I accept that this will help the preformance
of the tmpfs-based workload, it will adversely affect workloads that
touch a lot of counters because of the increased cache footprint.

1. Is it possible to rearrange the vmstat array such that two hot
   counters do not share a cache line?
2. Has Andrew's suggestion to alter the per-cpu threshold based on the
   value of the global counter to reduce conflicts been tried?

(I'm at Linux Con at the moment so will be even slower to respond than
usual)

-- 
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH] cache align vm_stat
@ 2011-10-24 16:10 Dimitri Sivanich
  2011-10-27  2:31 ` Christoph Lameter
  0 siblings, 1 reply; 8+ messages in thread
From: Dimitri Sivanich @ 2011-10-24 16:10 UTC (permalink / raw)
  To: linux-kernel, linux-mm
  Cc: Andrew Morton, Christoph Lameter, David Rientjes, Andi Kleen,
	Mel Gorman

Avoid false sharing of the vm_stat array.

This was found to adversely affect tmpfs I/O performance.

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
---
 mm/vmstat.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/mm/vmstat.c
===================================================================
--- linux.orig/mm/vmstat.c
+++ linux/mm/vmstat.c
@@ -78,7 +78,7 @@ void vm_events_fold_cpu(int cpu)
  *
  * vm_stat contains the global counters
  */
-atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
+atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS] __cacheline_aligned_in_smp;
 EXPORT_SYMBOL(vm_stat);
 
 #ifdef CONFIG_SMP

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-31 13:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27  8:50 [PATCH] cache align vm_stat Mel Gorman
2011-10-27 12:51 ` Dimitri Sivanich
2011-10-27 14:29 ` Mel Gorman
  -- strict thread matches above, loose matches on Subject: below --
2011-10-24 16:10 Dimitri Sivanich
2011-10-27  2:31 ` Christoph Lameter
2011-10-28 22:54   ` Andrew Morton
2011-10-29  5:22     ` Christoph Lameter
2011-10-31 13:37     ` Dimitri Sivanich

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).