diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2016-07-28 18:48:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-28 19:07:41 -0400 |
commit | 7c7fd82556c61113b6327c9696b347a82b215072 (patch) | |
tree | 99499ad717a26aa030d1f7cd6bea0c918f65d363 | |
parent | 91fd8b95d656dcd3f0a4e17b6583e7b0220b0747 (diff) |
mm: hwpoison: remove incorrect comments
dequeue_hwpoisoned_huge_page() can be called without page lock hold, so
let's remove incorrect comment.
The reason why the page lock is not really needed is that
dequeue_hwpoisoned_huge_page() checks page_huge_active() inside
hugetlb_lock, which allows us to avoid trying to dequeue a hugepage that
are just allocated but not linked to active list yet, even without
taking page lock.
Link: http://lkml.kernel.org/r/20160720092901.GA15995@www9186uo.sakura.ne.jp
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reported-by: Zhan Chen <zhanc1@andrew.cmu.edu>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/hugetlb.c | 1 | ||||
-rw-r--r-- | mm/memory-failure.c | 2 |
2 files changed, 0 insertions, 3 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index abc1c5fb7222..213ff90903a6 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -4391,7 +4391,6 @@ follow_huge_pud(struct mm_struct *mm, unsigned long address, | |||
4391 | 4391 | ||
4392 | /* | 4392 | /* |
4393 | * This function is called from memory failure code. | 4393 | * This function is called from memory failure code. |
4394 | * Assume the caller holds page lock of the head page. | ||
4395 | */ | 4394 | */ |
4396 | int dequeue_hwpoisoned_huge_page(struct page *hpage) | 4395 | int dequeue_hwpoisoned_huge_page(struct page *hpage) |
4397 | { | 4396 | { |
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 11de752ccaf5..de88f33519c0 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -741,8 +741,6 @@ static int me_huge_page(struct page *p, unsigned long pfn) | |||
741 | * page->lru because it can be used in other hugepage operations, | 741 | * page->lru because it can be used in other hugepage operations, |
742 | * such as __unmap_hugepage_range() and gather_surplus_pages(). | 742 | * such as __unmap_hugepage_range() and gather_surplus_pages(). |
743 | * So instead we use page_mapping() and PageAnon(). | 743 | * So instead we use page_mapping() and PageAnon(). |
744 | * We assume that this function is called with page lock held, | ||
745 | * so there is no race between isolation and mapping/unmapping. | ||
746 | */ | 744 | */ |
747 | if (!(page_mapping(hpage) || PageAnon(hpage))) { | 745 | if (!(page_mapping(hpage) || PageAnon(hpage))) { |
748 | res = dequeue_hwpoisoned_huge_page(hpage); | 746 | res = dequeue_hwpoisoned_huge_page(hpage); |