lkml.org 
[lkml]   [2003]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] revert to static = {0} + comment
Please revert to static zero initialization of a const: when thus
initialized it's linked into a readonly cacheline shared between cpus;
otherwise it's linked into bss, likely to be in a dirty cacheline
bouncing between cpus.

On 5 Aug 2003, Arjan van de Ven wrote:
> how about adding a big fat comment here that says this?
> Otherwise this keeps happening all the time...
and others concurred.

Okay, by popular request, here it is with a small thin comment.

--- 2.6.0-test2-bk/mm/shmem.c Tue Aug 5 15:57:31 2003
+++ linux/mm/shmem.c Tue Aug 5 19:29:16 2003
@@ -296,7 +296,8 @@
struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
struct page *page = NULL;
swp_entry_t *entry;
- static const swp_entry_t unswapped;
+ static const swp_entry_t unswapped = {0};
+ /* = {0} to go in readonly data, to avoid bss cacheline bounce */

if (sgp != SGP_WRITE &&
((loff_t) index << PAGE_CACHE_SHIFT) >= i_size_read(inode))
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.073 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site