Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1648022

Re: [PATCH v3 1/6] mm, gup: Remove broken VM_BUG_ON_PAGE compound check for hugepages

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [PATCH v3 1/6] mm, gup: Remove broken VM_BUG_ON_PAGE compound check for hugepages
Date 2017-05-23 15:20 +0200
Message-ID <tKhTb-3GR-13@gated-at.bofh.it> (permalink)
References <tJVIZ-6iD-3@gated-at.bofh.it> <tJVJ0-6iD-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, May 22, 2017 at 02:35:59PM +0100, Punit Agrawal wrote:
> From: Will Deacon <will.deacon@arm.com>
> 
> When operating on hugepages with DEBUG_VM enabled, the GUP code checks the
> compound head for each tail page prior to calling page_cache_add_speculative.
> This is broken, because on the fast-GUP path (where we don't hold any page
> table locks) we can be racing with a concurrent invocation of
> split_huge_page_to_list.
> 
> split_huge_page_to_list deals with this race by using page_ref_freeze to
> freeze the page and force concurrent GUPs to fail whilst the component
> pages are modified. This modification includes clearing the compound_head
> field for the tail pages, so checking this prior to a successful call
> to page_cache_add_speculative can lead to false positives: In fact,
> page_cache_add_speculative *already* has this check once the page refcount
> has been successfully updated, so we can simply remove the broken calls
> to VM_BUG_ON_PAGE.
> 
> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> Acked-by: Steve Capper <steve.capper@arm.com>
> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>

Looks reasonable to me:

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

-- 
 Kirill A. Shutemov

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/6] Support for contiguous pte hugepages Punit Agrawal <punit.agrawal@arm.com> - 2017-05-22 15:40 +0200
  [PATCH v3 1/6] mm, gup: Remove broken VM_BUG_ON_PAGE compound check for hugepages Punit Agrawal <punit.agrawal@arm.com> - 2017-05-22 15:40 +0200
    Re: [PATCH v3 1/6] mm, gup: Remove broken VM_BUG_ON_PAGE compound  check for hugepages "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-05-23 15:20 +0200
  [PATCH v3 6/6] mm: rmap: Use correct helper when poisoning hugepages Punit Agrawal <punit.agrawal@arm.com> - 2017-05-22 15:40 +0200
  [PATCH v3 2/6] mm, gup: Ensure real head page is ref-counted when using hugepages Punit Agrawal <punit.agrawal@arm.com> - 2017-05-22 15:40 +0200
    Re: [PATCH v3 2/6] mm, gup: Ensure real head page is ref-counted  when using hugepages "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-05-23 15:30 +0200
      Re: [PATCH v3 2/6] mm, gup: Ensure real head page is ref-counted when using hugepages Punit Agrawal <punit.agrawal@arm.com> - 2017-05-23 17:50 +0200
  [PATCH v3 5/6] mm/hugetlb: Introduce set_huge_swap_pte_at() helper Punit Agrawal <punit.agrawal@arm.com> - 2017-05-22 15:40 +0200
    [PATCH v3.1 5/6] mm/hugetlb: Introduce set_huge_swap_pte_at() helper Punit Agrawal <punit.agrawal@arm.com> - 2017-05-22 18:40 +0200

csiph-web