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


Groups > linux.kernel > #1395657

Re: [BUG] vfio device assignment regression with THP ref counting redesign

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [BUG] vfio device assignment regression with THP ref counting redesign
Date 2016-05-06 09:30 +0200
Message-ID <rvImZ-P0-9@gated-at.bofh.it> (permalink)
References (5 earlier) <ruqsa-8kk-21@gated-at.bofh.it> <rvg7o-6Ic-5@gated-at.bofh.it> <rvsBA-1D1-9@gated-at.bofh.it> <rvtei-2h4-19@gated-at.bofh.it> <rvtnY-2lG-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, May 05, 2016 at 05:24:06PM +0200, Andrea Arcangeli wrote:
> On Thu, May 05, 2016 at 06:11:10PM +0300, Kirill A. Shutemov wrote:
> > Hm. How total_mapcount equal to NULL wouldn't lead to NULL-pointer
> > dereference inside page_trans_huge_mapcount()?
> 
> Sorry for the confusion, this was still work in progress and then I've
> seen the email from Alex and I sent the last version I had committed
> right away. An earlier version of course had the proper checks for
> NULL but they got wiped as I transitioned from one model to another
> and back.
> 
> > > +				page_move_anon_rmap(old_page, vma, address);
> > 
> > compound_head() is missing, I believe.
> 
> Oh yes, fixed that too.
> 
> 			if (total_mapcount == 1) {
> 				/*
> 				 * The page is all ours. Move it to
> 				 * our anon_vma so the rmap code will
> 				 * not search our parent or siblings.
> 				 * Protected against the rmap code by
> 				 * the page lock.
> 				 */
> 				page_move_anon_rmap(compound_head(old_page),
> 						    vma, address);
> 			}
> 
> 
> If there's no other issue I can git send-email.

I don't see any.

> Then we should look into calling page_move_anon_rmap from THP COWs
> too, hugetlbfs calls it too. I think we probably need to make
> page_move_anon_rmap smarter and optionally let it take the lock for us
> after reading page->mapping first to be sure it's really moving it.
> 
> The question is then if trylock or lock_page should be used, my
> preference would be just trylock.

trylock is probably fine. It's not big deal if we wouldn't move the page
to new anon_vma, just nice-to-have.

-- 
 Kirill A. Shutemov

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


Thread

[BUG] vfio device assignment regression with THP ref counting  redesign Alex Williamson <alex.williamson@redhat.com> - 2016-04-28 18:30 +0200
  Re: [BUG] vfio device assignment regression with THP ref counting  redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-04-28 20:20 +0200
    Re: [BUG] vfio device assignment regression with THP ref counting  redesign Alex Williamson <alex.williamson@redhat.com> - 2016-04-28 21:00 +0200
      Re: [BUG] vfio device assignment regression with THP ref counting  redesign Andrea Arcangeli <aarcange@redhat.com> - 2016-04-29 01:30 +0200
        Re: [BUG] vfio device assignment regression with THP ref counting  redesign Alex Williamson <alex.williamson@redhat.com> - 2016-04-29 02:50 +0200
        Re: [BUG] vfio device assignment regression with THP ref counting  redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-04-29 03:00 +0200
          Re: [BUG] vfio device assignment regression with THP ref counting  redesign Alex Williamson <alex.williamson@redhat.com> - 2016-04-29 04:50 +0200
            Re: [BUG] vfio device assignment regression with THP ref counting  redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-04-29 09:10 +0200
              Re: [BUG] vfio device assignment regression with THP ref counting  redesign Alex Williamson <alex.williamson@redhat.com> - 2016-04-29 17:20 +0200
              Re: [BUG] vfio device assignment regression with THP ref counting  redesign Andrea Arcangeli <aarcange@redhat.com> - 2016-04-29 18:40 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign Alex Williamson <alex.williamson@redhat.com> - 2016-04-30 00:40 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-05-02 12:50 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign Jerome Glisse <j.glisse@gmail.com> - 2016-05-02 13:20 +0200
                GUP guarantees wrt to userspace mappings redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-05-02 14:20 +0200
                Re: GUP guarantees wrt to userspace mappings redesign Jerome Glisse <j.glisse@gmail.com> - 2016-05-02 15:40 +0200
                Re: GUP guarantees wrt to userspace mappings "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-05-02 17:10 +0200
                Re: GUP guarantees wrt to userspace mappings Jerome Glisse <j.glisse@gmail.com> - 2016-05-02 17:30 +0200
                Re: GUP guarantees wrt to userspace mappings "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-05-02 18:20 +0200
                Re: GUP guarantees wrt to userspace mappings Andrea Arcangeli <aarcange@redhat.com> - 2016-05-02 21:20 +0200
                Re: GUP guarantees wrt to userspace mappings Andrea Arcangeli <aarcange@redhat.com> - 2016-05-02 21:20 +0200
                Re: GUP guarantees wrt to userspace mappings Andrea Arcangeli <aarcange@redhat.com> - 2016-05-02 21:10 +0200
                Re: GUP guarantees wrt to userspace mappings redesign Oleg Nesterov <oleg@redhat.com> - 2016-05-02 17:20 +0200
                Re: GUP guarantees wrt to userspace mappings redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-05-02 18:30 +0200
                Re: GUP guarantees wrt to userspace mappings redesign Oleg Nesterov <oleg@redhat.com> - 2016-05-02 19:30 +0200
                Re: GUP guarantees wrt to userspace mappings redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-05-02 20:10 +0200
                Re: GUP guarantees wrt to userspace mappings redesign Oleg Nesterov <oleg@redhat.com> - 2016-05-02 20:50 +0200
                Re: GUP guarantees wrt to userspace mappings redesign Andrea Arcangeli <aarcange@redhat.com> - 2016-05-02 21:00 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign Andrea Arcangeli <aarcange@redhat.com> - 2016-05-02 17:30 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-05-02 18:10 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign Andrea Arcangeli <aarcange@redhat.com> - 2016-05-02 20:10 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign Alex Williamson <alex.williamson@redhat.com> - 2016-05-05 03:20 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign Andrea Arcangeli <aarcange@redhat.com> - 2016-05-05 16:40 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign Andrea Arcangeli <aarcange@redhat.com> - 2016-05-05 17:10 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-05-05 17:20 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign Andrea Arcangeli <aarcange@redhat.com> - 2016-05-05 17:30 +0200
                Re: [BUG] vfio device assignment regression with THP ref counting  redesign "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-05-06 09:30 +0200

csiph-web