linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Rik van Riel <riel@surriel.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	linux-kernel@vger.kernel.org, kernel-team@meta.com,
	linux-mm@kvack.org, akpm@linux-foundation.org,
	muchun.song@linux.dev, leit@meta.com
Subject: Re: [PATCH 1/2] hugetlbfs: extend hugetlb_vma_lock to private VMAs
Date: Wed, 20 Sep 2023 09:36:50 -0700	[thread overview]
Message-ID: <20230920163650.GA4065@monkey> (raw)
In-Reply-To: <7ddc6ba18b3fef3ed637dcd9a85e90cf4ca6ca7d.camel@surriel.com>

On 09/20/23 00:09, Rik van Riel wrote:
> On Wed, 2023-09-20 at 04:57 +0100, Matthew Wilcox wrote:
> > On Tue, Sep 19, 2023 at 10:16:09PM -0400, riel@surriel.com wrote:
> > > From: Rik van Riel <riel@surriel.com>
> > > 
> > > Extend the locking scheme used to protect shared hugetlb mappings
> > > from truncate vs page fault races, in order to protect private
> > > hugetlb mappings (with resv_map) against MADV_DONTNEED.
> > > 
> > > Add a read-write semaphore to the resv_map data structure, and
> > > use that from the hugetlb_vma_(un)lock_* functions, in preparation
> > > for closing the race between MADV_DONTNEED and page faults.
> > 
> > This feels an awful lot like the invalidate_lock in struct
> > address_space
> > which was recently added by Jan Kara.
> > 
> Indeed it does.
> 
> It might be even nicer if we could replace the hugetlb_vma_lock
> special logic with the invalidate_lock for hugetlbfs.
> 
> Mike, can you think of any reason why the hugetlb_vma_lock logic
> should not be replaced with the invalidate_lock?
> 
> If not, I'd be happy to implement that.
> 

Sorry Rik,

I have some other things that need immediate attention and have not had a
chance to take a close look here.  I'll take a closer look later (my) today
or tomorrow.
-- 
Mike Kravetz


  reply	other threads:[~2023-09-20 16:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20  2:16 [PATCH 0/2] hugetlbfs: close race between MADV_DONTNEED and page fault riel
2023-09-20  2:16 ` [PATCH 1/2] hugetlbfs: extend hugetlb_vma_lock to private VMAs riel
2023-09-20  3:57   ` Matthew Wilcox
2023-09-20  4:09     ` Rik van Riel
2023-09-20 16:36       ` Mike Kravetz [this message]
2023-09-20 15:23     ` [RFC PATCH 3/3] hugetlbfs: replace hugetlb_vma_lock with invalidate_lock Rik van Riel
2023-09-21 22:42   ` [PATCH 1/2] hugetlbfs: extend hugetlb_vma_lock to private VMAs Mike Kravetz
2023-09-21 23:17     ` Mike Kravetz
2023-09-22  0:37     ` Rik van Riel
2023-09-22 14:37     ` Rik van Riel
2023-09-22 16:44       ` Mike Kravetz
2023-09-22 16:56         ` Rik van Riel
2023-09-22 18:31         ` Rik van Riel
2023-09-20  2:16 ` [PATCH 2/2] hugetlbfs: close race between MADV_DONTNEED and page fault riel
2023-09-21 22:54 ` [PATCH 0/2] " Mike Kravetz

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=20230920163650.GA4065@monkey \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-team@meta.com \
    --cc=leit@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=riel@surriel.com \
    --cc=willy@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).