lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120531132515.6af60152.akpm@linux-foundation.org>
Date:	Thu, 31 May 2012 13:25:15 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	KOSAKI Motohiro <kosaki.motohiro@...il.com>
Cc:	Nathan Zimmer <nzimmer@....com>, hughd@...gle.com,
	npiggin@...il.com, cl@...ux.com, lee.schermerhorn@...com,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	stable@...r.kernel.org, riel@...hat.com
Subject: Re: [PATCH v2] tmpfs not interleaving properly

On Thu, 31 May 2012 16:09:15 -0400
KOSAKI Motohiro <kosaki.motohiro@...il.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ