From: Hillf Danton <dhillf@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>,
Michal Hocko <mhocko@suse.cz>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH] mm: hugetlb: bail out unmapping after serving reference page
Date: Thu, 22 Mar 2012 21:21:22 +0800 [thread overview]
Message-ID: <CAJd=RBC9wN_M6T=vxmw+HxwxJF8Me1pq+UwZGEGoxto+HmG-3Q@mail.gmail.com> (raw)
In-Reply-To: <20120321140019.9ca39a31.akpm@linux-foundation.org>
On Thu, Mar 22, 2012 at 5:00 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Thu, 23 Feb 2012 12:12:38 -0800
> Andrew Morton <akpm@linux-foundation.org> wrote:
>
>> On Thu, 23 Feb 2012 21:05:41 +0800
>> Hillf Danton <dhillf@gmail.com> wrote:
>>
>> > and a follow-up cleanup also attached.
>>
>> Please, never put more than one patches in an email - it is rather a
>> pain to manually unpick everything.
>>
>> > When unmapping given VM range, a couple of code duplicate, such as pte_page()
>> > and huge_pte_none(), so a cleanup needed to compact them together.
>> >
>> > Signed-off-by: Hillf Danton <dhillf@gmail.com>
>> > ---
>> >
>> > --- a/mm/hugetlb.c Thu Feb 23 20:13:06 2012
>> > +++ b/mm/hugetlb.c Thu Feb 23 20:30:16 2012
>> > @@ -2245,16 +2245,23 @@ void __unmap_hugepage_range(struct vm_ar
>> > if (huge_pmd_unshare(mm, &address, ptep))
>> > continue;
>> >
>> > + pte = huge_ptep_get(ptep);
>> > + if (huge_pte_none(pte))
>> > + continue;
>> > +
>> > + /*
>> > + * HWPoisoned hugepage is already unmapped and dropped reference
>> > + */
>> > + if (unlikely(is_hugetlb_entry_hwpoisoned(pte)))
>> > + continue;
>> > +
>> > + page = pte_page(pte);
>> > /*
>> > * If a reference page is supplied, it is because a specific
>> > * page is being unmapped, not a range. Ensure the page we
>> > * are about to unmap is the actual page of interest.
>> > */
>> > if (ref_page) {
>> > - pte = huge_ptep_get(ptep);
>> > - if (huge_pte_none(pte))
>> > - continue;
>> > - page = pte_page(pte);
>> > if (page != ref_page)
>> > continue;
>> >
>> > @@ -2267,16 +2274,6 @@ void __unmap_hugepage_range(struct vm_ar
>> > }
>> >
>> > pte = huge_ptep_get_and_clear(mm, address, ptep);
>> > - if (huge_pte_none(pte))
>> > - continue;
>> > -
>> > - /*
>> > - * HWPoisoned hugepage is already unmapped and dropped reference
>> > - */
>> > - if (unlikely(is_hugetlb_entry_hwpoisoned(pte)))
>> > - continue;
>> > -
>> > - page = pte_page(pte);
>> > if (pte_dirty(pte))
>> > set_page_dirty(page);
>> > list_add(&page->lru, &page_list);
>>
>> This changes behaviour when ref_page refers to a hwpoisoned page.
>
> Respond, please?
First say sorry to you, Andrew.
The comment says, HWPoisoned hugepage is already unmapped;
and even if ref_page == HWPoisoned page, it is not added onto
page_list and no page_remove_rmap() is issued for it, so we end
up with no behavior change.
Thanks
-hd
--
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>
prev parent reply other threads:[~2012-03-22 13:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 12:35 Hillf Danton
2012-02-22 21:06 ` Andrew Morton
2012-02-23 13:05 ` Hillf Danton
2012-02-23 20:12 ` Andrew Morton
2012-03-21 21:00 ` Andrew Morton
2012-03-22 13:21 ` Hillf Danton [this message]
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='CAJd=RBC9wN_M6T=vxmw+HxwxJF8Me1pq+UwZGEGoxto+HmG-3Q@mail.gmail.com' \
--to=dhillf@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
/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