linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Nathan Zimmer <nzimmer@sgi.com>,
	hughd@google.com, npiggin@gmail.com, cl@linux.com,
	lee.schermerhorn@hp.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, stable@vger.kernel.org, riel@redhat.com
Subject: Re: [PATCH v2] tmpfs not interleaving properly
Date: Thu, 31 May 2012 13:25:15 -0700	[thread overview]
Message-ID: <20120531132515.6af60152.akpm@linux-foundation.org> (raw)
In-Reply-To: <4FC7CFEB.5040009@gmail.com>

On Thu, 31 May 2012 16:09:15 -0400
KOSAKI Motohiro <kosaki.motohiro@gmail.com> wrote:

> > --- a/mm/shmem.c
> > +++ b/mm/shmem.c
> > @@ -929,7 +929,7 @@ static struct page *shmem_alloc_page(gfp_t gfp,
> >   	/*
> >   	 * alloc_page_vma() will drop the shared policy reference
> >   	 */
> > -	return alloc_page_vma(gfp,&pvma, 0);
> > +	return alloc_page_vma(gfp,&pvma, info->node_offset<<  PAGE_SHIFT );
> 
> 3rd argument of alloc_page_vma() is an address. This is type error.

Well, it's an unsigned long...

But yes, it is conceptually wrong and *looks* weird.  I think we can
address that by overcoming our peculair aversion to documenting our
code, sigh.  This?

--- a/mm/shmem.c~tmpfs-implement-numa-node-interleaving-fix
+++ a/mm/shmem.c
@@ -927,9 +927,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, info->node_offset << PAGE_SHIFT );
+	return alloc_page_vma(gfp, &pvma, info->node_offset << PAGE_SHIFT);
 }
 #else /* !CONFIG_NUMA */
 #ifdef CONFIG_TMPFS
_


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

  reply	other threads:[~2012-05-31 20:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 14:39 [PATCH v2] tmpfs not interleaving properly Nathan Zimmer
2012-05-31 19:28 ` Andrew Morton
2012-05-31 20:09 ` KOSAKI Motohiro
2012-05-31 20:25   ` Andrew Morton [this message]
2012-05-31 20:35     ` KOSAKI Motohiro
2012-06-01 14:24       ` Nathan Zimmer
2012-06-01 17:22         ` KOSAKI Motohiro
2012-06-19 23:21           ` Nathan Zimmer
2012-06-20  4:02             ` KOSAKI Motohiro

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=20120531132515.6af60152.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=hughd@google.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=lee.schermerhorn@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@gmail.com \
    --cc=nzimmer@sgi.com \
    --cc=riel@redhat.com \
    --cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).