All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: Fushuai Wang <fushuai.wang@linux.dev>,
	muchun.song@linux.dev, osalvador@suse.de
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, wangfushuai@baidu.com
Subject: Re: [PATCH] hugetlb: Add guard support
Date: Fri, 28 Nov 2025 12:06:14 +0100	[thread overview]
Message-ID: <9cb0a602-69ca-400f-890c-e9dd5b44f53b@kernel.org> (raw)
In-Reply-To: <20251128110241.78580-1-fushuai.wang@linux.dev>

On 11/28/25 12:02, Fushuai Wang wrote:
> Introduce guard support to simplify the usage of the
> hugetlb_vma_{lock,unlock}_{read,write}.
> 
> Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
> ---
>   include/linux/hugetlb.h | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index 8e63e46b8e1f..f97cb2f123a3 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -15,6 +15,7 @@
>   #include <linux/gfp.h>
>   #include <linux/userfaultfd_k.h>
>   #include <linux/nodemask.h>
> +#include <linux/cleanup.h>
>   
>   struct ctl_table;
>   struct user_struct;
> @@ -468,6 +469,13 @@ static inline void hugetlb_split(struct vm_area_struct *vma, unsigned long addr)
>   
>   #endif /* !CONFIG_HUGETLB_PAGE */
>   
> +DEFINE_GUARD(hugetlb_vma_read, struct vm_area_struct *,
> +	     hugetlb_vma_lock_read(_T), hugetlb_vma_unlock_read(_T))
> +
> +DEFINE_GUARD(hugetlb_vma_write, struct vm_area_struct *,
> +	     hugetlb_vma_lock_write(_T), hugetlb_vma_unlock_write(_T))
> +DEFINE_GUARD_COND(hugetlb_vma_write, _try, hugetlb_vma_trylock_write(_T))

Do I understand correctly that the code you are introducing does not 
have any users?

-- 
Cheers

David


  reply	other threads:[~2025-11-28 11:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-28 11:02 [PATCH] hugetlb: Add guard support Fushuai Wang
2025-11-28 11:06 ` David Hildenbrand (Red Hat) [this message]
2025-11-28 11:23   ` Fushuai Wang
2025-11-28 11:26     ` David Hildenbrand (Red Hat)

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=9cb0a602-69ca-400f-890c-e9dd5b44f53b@kernel.org \
    --to=david@kernel.org \
    --cc=fushuai.wang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=osalvador@suse.de \
    --cc=wangfushuai@baidu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.