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


Groups > linux.kernel > #1566833

Re: [PATCH 01/12] uprobes: split THPs before trying replace them

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH 01/12] uprobes: split THPs before trying replace them
Date 2017-01-25 19:40 +0100
Message-ID <t3AEa-5hX-29@gated-at.bofh.it> (permalink)
References <t3c8O-6zx-3@gated-at.bofh.it> <t3cit-6CQ-15@gated-at.bofh.it> <t3gP8-13N-33@gated-at.bofh.it> <t3hLd-1N5-37@gated-at.bofh.it> <t3z5o-4dK-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jan 25, 2017 at 08:55:22AM -0800, Srikar Dronamraju wrote:
> > > 
> > > > For THPs page_check_address() always fails. It's better to split them
> > > > first before trying to replace.
> > > 
> > > So what does this mean.  uprobes simply fails to work when trying to
> > > place a probe into a THP memory region?
> > 
> > Looks like we can end up with endless retry loop in uprobe_write_opcode().
> > 
> > > How come nobody noticed (and reported) this when using the feature?
> > 
> > I guess it's not often used for anon memory.
> > 
> 
> The first time the breakpoint is hit on a page, it replaces the text
> page with anon page.  Now lets assume we insert breakpoints in all the
> pages in a range. Here each page is individually replaced by a non THP
> anonpage. (since we dont have bulk breakpoint insertion support,
> breakpoint insertion happens one at a time). Now the only interesting
> case may be when each of these replaced pages happen to be physically
> contiguous so that THP kicks in to replace all of these pages with one
> THP page. Can happen in practice?
> 
> Are there any other cases that I have missed?

We use a hack in our applications where we open /proc/self/maps, copy
text segments to a staging area, then create overlay anon mappings on
top and copy the text back into them. Now we have THP-backed text and
very little iTLB pressure :-)

That said, we haven't run into the uprobes issue yet.

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


Thread

[PATCH 00/12] Fix few rmap-related THP bugs "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-01-24 17:30 +0100
  [PATCH 11/12] mm: drop page_check_address{,_transhuge} "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-01-24 17:30 +0100
  [PATCH 12/12] mm: convert remove_migration_pte() to page_check_walk() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-01-24 17:30 +0100
    Re: [PATCH 12/12] mm: convert remove_migration_pte() to  page_check_walk() kbuild test robot <lkp@intel.com> - 2017-01-25 02:50 +0100
  [PATCH 01/12] uprobes: split THPs before trying replace them "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-01-24 17:40 +0100
    Re: [PATCH 01/12] uprobes: split THPs before trying replace them Rik van Riel <riel@redhat.com> - 2017-01-24 19:10 +0100
    Re: [PATCH 01/12] uprobes: split THPs before trying replace them Andrew Morton <akpm@linux-foundation.org> - 2017-01-24 22:30 +0100
      Re: [PATCH 01/12] uprobes: split THPs before trying replace them "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-01-24 23:30 +0100
        Re: [PATCH 01/12] uprobes: split THPs before trying replace them Andrew Morton <akpm@linux-foundation.org> - 2017-01-24 23:40 +0100
          Re: [PATCH 01/12] uprobes: split THPs before trying replace them "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-01-25 00:00 +0100
        Re: [PATCH 01/12] uprobes: split THPs before trying replace them Srikar Dronamraju <srikar@linux.vnet.ibm.com> - 2017-01-25 18:00 +0100
          Re: [PATCH 01/12] uprobes: split THPs before trying replace them Rik van Riel <riel@redhat.com> - 2017-01-25 18:50 +0100
          Re: [PATCH 01/12] uprobes: split THPs before trying replace them "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-01-25 18:50 +0100
          Re: [PATCH 01/12] uprobes: split THPs before trying replace them Johannes Weiner <hannes@cmpxchg.org> - 2017-01-25 19:40 +0100
            Re: [PATCH 01/12] uprobes: split THPs before trying replace them "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-01-25 19:40 +0100
            Re: [PATCH 01/12] uprobes: split THPs before trying replace them Srikar Dronamraju <srikar@linux.vnet.ibm.com> - 2017-01-26 04:00 +0100
    Re: [PATCH 01/12] uprobes: split THPs before trying replace them Johannes Weiner <hannes@cmpxchg.org> - 2017-01-25 19:30 +0100
  [PATCH 04/12] mm: fix handling PTE-mapped THPs in page_idle_clear_pte_refs() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-01-24 17:40 +0100
  [PATCH 05/12] mm, rmap: check all VMAs that PTE-mapped THP can be part of "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-01-24 17:40 +0100
  [PATCH 02/12] mm: introduce page_check_walk() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-01-24 17:40 +0100
    Re: [PATCH 02/12] mm: introduce page_check_walk() Andrew Morton <akpm@linux-foundation.org> - 2017-01-24 22:50 +0100
      Re: [PATCH 02/12] mm: introduce page_check_walk() Andrew Morton <akpm@linux-foundation.org> - 2017-01-25 00:00 +0100
        Re: [PATCH 02/12] mm: introduce page_check_walk() "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-01-25 19:00 +0100
      Re: [PATCH 02/12] mm: introduce page_check_walk() "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-01-25 00:00 +0100
    Re: [PATCH 02/12] mm: introduce page_check_walk() kbuild test robot <lkp@intel.com> - 2017-01-25 02:30 +0100
    Re: [PATCH 02/12] mm: introduce page_check_walk() kbuild test robot <lkp@intel.com> - 2017-01-25 03:10 +0100
  [PATCH 09/12] mm, uprobes: convert __replace_page() to page_check_walk() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-01-24 17:40 +0100
    Re: [PATCH 09/12] mm, uprobes: convert __replace_page() to  page_check_walk() Srikar Dronamraju <srikar@linux.vnet.ibm.com> - 2017-01-26 04:10 +0100

csiph-web