mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nathan Zimmer <nzimmer@sgi.com>
To: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Nathan Zimmer <nzimmer@sgi.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	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: Tue, 19 Jun 2012 18:21:02 -0500	[thread overview]
Message-ID: <20120619232102.GA5698@gulag1.americas.sgi.com> (raw)
In-Reply-To: <4FC8FA47.70001@gmail.com>

On Fri, Jun 01, 2012 at 01:22:15PM -0400, KOSAKI Motohiro wrote:
> (6/1/12 10:24 AM), Nathan Zimmer wrote:
>> On Thu, May 31, 2012 at 04:35:53PM -0400, KOSAKI Motohiro wrote:
>>> (5/31/12 4:25 PM), Andrew Morton wrote:
>>>> 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?
>>>
>>> Sorry, no.
>>>
>>> addr agrument of alloc_pages_vma() have two meanings.
>>>
>>> 1) interleave node seed
>>> 2) look-up key of shmem policy
>>>
>>> I think this patch break (2). shmem_get_policy(pol, addr) assume caller honor to
>>> pass correct address.
>>
>> But the pseudo vma we generated in shmem_alloc_page the vm_ops are set to NULL.
>> So get_vma_policy will return the policy provided by the pseudo vma and not reach
>> the shmem_get_policy.
>
> yes, and it is bug source. we may need to change soon. I guess the right way is
> to make vm_ops->interleave and interleave_nid uses it if povided.
>

If we provide vm_ops then won't shmem_get_policy get called?
That would be an issue since shmem_get_policy assumes vm_file is non NULL.

> btw, I don't think node_random() is good idea. it is random(pid + jiffies + cycle).
> current->cpuset_mem_spread_rotor is per-thread value. but you now need per-inode
> interleave offset. maybe, just inode addition is enough. Why do you need randomness?
>

I don't really need the randomness, the rotor should be good enough.
The correct way to get that is cpuset_mem_spread_node(), yes?

Also apologies for such a delay in my response.

  reply	other threads:[~2012-06-19 23:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 14:39 Nathan Zimmer
2012-05-31 19:28 ` Andrew Morton
2012-05-31 20:09 ` KOSAKI Motohiro
2012-05-31 20:25   ` Andrew Morton
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 [this message]
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=20120619232102.GA5698@gulag1.americas.sgi.com \
    --to=nzimmer@sgi.com \
    --cc=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=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

all inboxes | Powered by JetHome®