All of lore.kernel.org
 help / color / mirror / Atom feed
* [to-be-updated] tmpfs-implement-numa-node-interleaving.patch removed from -mm tree
@ 2012-07-11 22:33 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2012-07-11 22:33 UTC (permalink / raw)
  To: nzimmer, cl, hughd, lee.schermerhorn, npiggin, riel, mm-commits


The patch titled
     Subject: tmpfs: implement NUMA node interleaving
has been removed from the -mm tree.  Its filename was
     tmpfs-implement-numa-node-interleaving.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Nathan Zimmer <nzimmer@sgi.com>
Subject: tmpfs: implement NUMA node interleaving

When tmpfs has the memory policy interleaved it always starts allocating
at each file at node 0.  When there are many small files the lower nodes
fill up disproportionately.

This patch attempts to spread out node usage by starting files at nodes
other then 0.  I disturbed the addr parameter since alloc_pages_vma will
only use it when the policy is MPOL_INTERLEAVE.  Random was picked over
using another variable which would require some sort of contention
management.

[akpm@linux-foundation.org: add comment]
Signed-off-by: Nathan T Zimmer <nzimmer@sgi.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Nick Piggin <npiggin@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/shmem_fs.h |    1 +
 mm/shmem.c               |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff -puN include/linux/shmem_fs.h~tmpfs-implement-numa-node-interleaving include/linux/shmem_fs.h
--- a/include/linux/shmem_fs.h~tmpfs-implement-numa-node-interleaving
+++ a/include/linux/shmem_fs.h
@@ -17,6 +17,7 @@ struct shmem_inode_info {
 		char		*symlink;	/* unswappable short symlink */
 	};
 	struct shared_policy	policy;		/* NUMA memory alloc policy */
+	unsigned long           node_offset;	/* bias for interleaved nodes */
 	struct list_head	swaplist;	/* chain of maybes on swap */
 	struct list_head	xattr_list;	/* list of shmem_xattr */
 	struct inode		vfs_inode;
diff -puN mm/shmem.c~tmpfs-implement-numa-node-interleaving mm/shmem.c
--- a/mm/shmem.c~tmpfs-implement-numa-node-interleaving
+++ a/mm/shmem.c
@@ -947,9 +947,12 @@ static struct page *shmem_alloc_page(gfp
 	pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, index);
 
 	/*
-	 * alloc_page_vma() will drop the shared policy reference
+	 * alloc_page_vma() will drop the shared policy reference.
+	 *
+	 * To avoid allocating all tmpfs pages on node 0, we fake up a virtual
+	 * address based on this file's predetermined preferred node.
 	 */
-	return alloc_page_vma(gfp, &pvma, 0);
+	return alloc_page_vma(gfp, &pvma, info->node_offset << PAGE_SHIFT);
 }
 #else /* !CONFIG_NUMA */
 #ifdef CONFIG_TMPFS
@@ -1389,6 +1392,7 @@ static struct inode *shmem_get_inode(str
 			inode->i_fop = &shmem_file_operations;
 			mpol_shared_policy_init(&info->policy,
 						 shmem_get_sbmpol(sbinfo));
+			info->node_offset = node_random(&node_online_map);
 			break;
 		case S_IFDIR:
 			inc_nlink(inode);
_

Patches currently in -mm which might be from nzimmer@sgi.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-11 22:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11 22:33 [to-be-updated] tmpfs-implement-numa-node-interleaving.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.