From: Rik van Riel <riel@surriel.com>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: 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: Fri, 22 Sep 2023 14:31:14 -0400 [thread overview]
Message-ID: <f79d6f2f4660c400ed309008033c773b2c542c9c.camel@surriel.com> (raw)
In-Reply-To: <20230922164408.GA224968@monkey>
On Fri, 2023-09-22 at 09:44 -0700, Mike Kravetz wrote:
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index f906c5fa4d09..8f3d5895fffc 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -372,6 +372,11 @@ static void
> __hugetlb_vma_unlock_write_free(struct vm_area_struct *vma)
> struct hugetlb_vma_lock *vma_lock = vma-
> >vm_private_data;
>
> __hugetlb_vma_unlock_write_put(vma_lock);
> + } else if (__vma_private_lock(vma)) {
> + struct resv_map *resv_map = vma_resv_map(vma);
> +
> + /* no free for anon vmas, but still need to unlock */
> + up_write(&resv_map->rw_sema);
> }
> }
>
That did the trick. The libhugetlbfs tests pass now, with
lockdep and KASAN enabled. Breno's MADV_DONTNEED test case
for hugetlbfs still passes, too.
--
All Rights Reversed.
next prev parent reply other threads:[~2023-09-22 18:31 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
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 [this message]
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=f79d6f2f4660c400ed309008033c773b2c542c9c.camel@surriel.com \
--to=riel@surriel.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=mike.kravetz@oracle.com \
--cc=muchun.song@linux.dev \
/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