From: Naoya Horiguchi <nao.horiguchi@gmail.com>
To: Mel Gorman <mgorman@suse.de>,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
David Rientjes <rientjes@google.com>,
Rik van Riel <riel@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] mm: hugetlb: add stub-like do_hugetlb_numa()
Date: Mon, 30 Mar 2015 19:42:13 +0900 [thread overview]
Message-ID: <55192885.5010608@gmail.com> (raw)
In-Reply-To: <20150330102802.GQ4701@suse.de>
On 03/30/2015 07:28 PM, Mel Gorman wrote:
> On Mon, Mar 30, 2015 at 09:40:54AM +0000, Naoya Horiguchi wrote:
>> hugetlb doesn't support NUMA balancing now, but that doesn't mean that we
>> don't have to make hugetlb code prepared for PROTNONE entry properly.
>> In the current kernel, when a process accesses to hugetlb range protected
>> with PROTNONE, it causes unexpected COWs, which finally put hugetlb subsystem
>> into broken/uncontrollable state, where for example h->resv_huge_pages is
>> subtracted too much and wrapped around to a very large number, and free
>> hugepage pool is no longer maintainable.
>>
>
> Ouch!
>
>> This patch simply clears PROTNONE when it's caught out. Real NUMA balancing
>> code for hugetlb is not implemented yet (not sure how much it's worth doing.)
>>
>
> It's not worth doing at all. Furthermore, an application that took the
> effort to allocate and use hugetlb pages is not going to appreciate the
> minor faults incurred by automatic balancing for no gain.
OK,
> Why not something
> like the following untested patch?
I'll test this tomorrow.
Thank you very much for the comment.
Naoya Horiguchi
> It simply avoids doing protection updates
> on hugetlb VMAs. If it works for you, feel free to take it and reuse most
> of the same changelog for it. I'll only be intermittently online for the
> next few days and would rather not unnecessarily delay a fix
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 7ce18f3c097a..74bfde50fd4e 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -2161,8 +2161,10 @@ void task_numa_work(struct callback_head *work)
> vma = mm->mmap;
> }
> for (; vma; vma = vma->vm_next) {
> - if (!vma_migratable(vma) || !vma_policy_mof(vma))
> + if (!vma_migratable(vma) || !vma_policy_mof(vma) ||
> + is_vm_hugetlb_page(vma)) {
> continue;
> + }
>
> /*
> * Shared library pages mapped by multiple processes are not
>
> --
> 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/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-03-30 10:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 9:40 [RFC][PATCH] mm: hugetlb: add stub-like do_hugetlb_numa() Naoya Horiguchi
2015-03-30 10:28 ` Mel Gorman
2015-03-30 10:42 ` Naoya Horiguchi [this message]
2015-03-30 11:59 ` Mel Gorman
2015-03-31 1:45 ` [PATCH] mm: numa: disable change protection for vma(VM_HUGETLB) Naoya Horiguchi
2015-03-31 21:35 ` Andrew Morton
2015-04-01 4:14 ` Naoya Horiguchi
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=55192885.5010608@gmail.com \
--to=nao.horiguchi@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
/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).