From: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andrea Arcangeli <aarcange@redhat.com>,
Michel Lespinasse <walken@google.com>,
David Rientjes <rientjes@google.com>,
LKML <linux-kernel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH 09/12] thp: introduce khugepaged_prealloc_page and khugepaged_alloc_page
Date: Wed, 12 Sep 2012 10:35:38 +0800 [thread overview]
Message-ID: <504FF4FA.80409@linux.vnet.ibm.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1209111807030.21798@eggly.anvils>
On 09/12/2012 10:03 AM, Hugh Dickins wrote:
> On Mon, 13 Aug 2012, Xiao Guangrong wrote:
>
>> They are used to abstract the difference between NUMA enabled and NUMA disabled
>> to make the code more readable
>>
>> Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
>> ---
>> mm/huge_memory.c | 166 ++++++++++++++++++++++++++++++++----------------------
>> 1 files changed, 98 insertions(+), 68 deletions(-)
>
> Hmm, that in itself is not necessarily an improvement.
>
> I'm a bit sceptical about this patch,
> thp-introduce-khugepaged_prealloc_page-and-khugepaged_alloc_page.patch
> in last Thursday's mmotm 2012-09-06-16-46.
>
> What brought me to look at it was hitting "BUG at mm/huge_memory.c:1842!"
> running tmpfs kbuild swapping load (with memcg's memory.limit_in_bytes
> forcing out to swap), while I happened to have CONFIG_NUMA=y.
>
> That's the VM_BUG_ON(*hpage) on entry to khugepaged_alloc_page().
I will look into it, thanks for your point it out.
>
> (If I'm honest, I'll admit I have Michel's "interval trees for anon rmap"
> patches in on top, and so the line number was actually shifted to 1839:
> but I don't believe his patches were in any way involved here, and
> indeed I've not yet found a problem with them: they look very good.)
>
> I expect the BUG could quite easily be fixed up by making another call
> to khugepaged_prealloc_page() from somewhere to free up the hpage;
> but forgive me if I dislike using "prealloc" to free.
>
> I do agree with you that the several CONFIG_NUMA ifdefs dotted around
> mm/huge_memory.c are regrettable, but I'm not at all sure that you're
> improving the situation with this patch, which gives misleading names
> to functions and moves the mmap_sem upping out of line.
>
> I think you need to revisit it: maybe not go so far (leaving a few
> CONFIG_NUMAs behind, if they're not too bad), or maybe go further
> (add a separate function for freeing in the NUMA case, instead of
> using "prealloc"). I don't know what's best: have a play and see.
Sorry for that, i will find a better way to do this.
>
> That's what I was intending to write yesterday. But overnight I
> was running with this 9/12 backed out (I think 10,11,12 should be
> independent), and found "BUG at mm/huge_memory.c:1835!" this morning.
>
> That's the VM_BUG_ON(*hpage) below #else in collapse_huge_page()
> when 9/12 is reverted.
>
> So maybe 9/12 is just obscuring what was already a BUG, either earlier
> in your series or elsewhere in mmotm (I've never seen it on 3.6-rc or
> earlier releases, nor without CONFIG_NUMA). I've not spent any time
> looking for it, maybe it's obvious - can you spot and fix it?
Sure, will fix it as soon as possible. Thanks!
--
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:[~2012-09-12 2:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-13 11:12 [PATCH 00/12] thp: optimize use of khugepaged_mutex and dependence of CONFIG_NUMA Xiao Guangrong
2012-08-13 11:13 ` [PATCH 01/12] thp: fix the count of THP_COLLAPSE_ALLOC Xiao Guangrong
2012-08-13 11:19 ` Kirill A. Shutemov
2012-08-13 11:13 ` [PATCH 02/12] thp: remove unnecessary check in start_khugepaged Xiao Guangrong
2012-08-13 11:14 ` [PATCH 03/12] thp: move khugepaged_mutex out of khugepaged Xiao Guangrong
2012-08-13 11:14 ` [PATCH 04/12] thp: remove unnecessary khugepaged_thread check Xiao Guangrong
2012-08-13 11:14 ` [PATCH 05/12] thp: remove wake_up_interruptible in the exit path Xiao Guangrong
2012-08-13 11:15 ` [PATCH 06/12] thp: remove some code depend on CONFIG_NUMA Xiao Guangrong
2012-08-13 11:15 ` [PATCH 07/12] thp: merge page pre-alloc in khugepaged_loop into khugepaged_do_scan Xiao Guangrong
2012-08-13 11:16 ` [PATCH 08/12] thp: release page in page pre-alloc path Xiao Guangrong
2012-08-13 11:16 ` [PATCH 09/12] thp: introduce khugepaged_prealloc_page and khugepaged_alloc_page Xiao Guangrong
2012-09-12 2:03 ` Hugh Dickins
2012-09-12 2:35 ` Xiao Guangrong [this message]
2012-09-12 3:37 ` Xiao Guangrong
2012-09-13 6:27 ` Hugh Dickins
2012-09-13 6:33 ` Hugh Dickins
2012-09-13 9:26 ` Xiao Guangrong
2012-08-13 11:16 ` [PATCH 10/12] thp: remove khugepaged_loop Xiao Guangrong
2012-08-13 11:17 ` [PATCH 11/12] thp: use khugepaged_enabled to remove duplicate code Xiao Guangrong
2012-08-13 11:17 ` [PATCH 12/12] thp: remove unnecessary set_recommended_min_free_kbytes Xiao Guangrong
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=504FF4FA.80409@linux.vnet.ibm.com \
--to=xiaoguangrong@linux.vnet.ibm.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=walken@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).