From: Muchun Song <muchun.song@linux.dev>
To: Christoph Hellwig <hch@lst.de>
Cc: "Huan Yang" <link@vivo.com>,
bingbu.cao@linux.intel.com,
"Matthew Wilcox" <willy@infradead.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Vivek Kasireddy" <vivek.kasireddy@intel.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Uladzislau Rezki" <urezki@gmail.com>,
"Shuah Khan" <shuah@kernel.org>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
opensource.kernel@vivo.com
Subject: Re: CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is broken, was Re: [RFC PATCH 0/6] Deep talk about folio vmap
Date: Mon, 7 Apr 2025 17:48:27 +0800 [thread overview]
Message-ID: <3DC6E604-3CE9-49E3-A688-DC7F424382DA@linux.dev> (raw)
In-Reply-To: <20250407085943.GA27481@lst.de>
> On Apr 7, 2025, at 16:59, Christoph Hellwig <hch@lst.de> wrote:
>
> On Mon, Apr 07, 2025 at 02:43:20PM +0800, Muchun Song wrote:
>> By the way, in case you truly struggle to comprehend the fundamental
>> aspects of HVO, I would like to summarize for you the user-visible
>> behaviors in comparison to the situation where HVO is disabled.
>>
>> HVO Status Tail Page Structures Head Page Structures
>> Enabled Read-Only (RO) Read-Write (RW)
>> Disabled Read-Write (RW) Read-Write (RW)
>>
>> The sole distinction between the two scenarios lies in whether the
>> tail page structures are allowed to be written or not. Please refrain
>> from getting bogged down in the details of the implementation of HVO.
>
> This feels extremely fragile to me. I doubt many people know what
> operations needs read vs write access to tail pages. Or for higher
> level operations if needs access to tail pages at all.
>
A compound page should modify its head page structure (e.g., refcount),
which is why `compound_head()` is widely used. Modifying its tail page
structures is incorrect. Users needn't worry about whether to modify
tail page structures. They should use `compound_head(tail)` to get the
head page structure and update it. All users must follow this rule (I
think folio-infrastructure also requires this). If a user tries to write
to a HugeTLB page's tail page, an exception will be raised as these tail
pages are read-only mapped to catch invalid operations.
prev parent reply other threads:[~2025-04-07 9:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-27 9:28 [RFC PATCH 0/6] Deep talk about folio vmap Huan Yang
2025-03-27 9:28 ` [RFC PATCH 1/6] udmabuf: try fix udmabuf vmap Huan Yang
2025-03-27 9:28 ` [RFC PATCH 2/6] udmabuf: try udmabuf vmap test Huan Yang
2025-03-27 9:28 ` [RFC PATCH 3/6] mm/vmalloc: try add vmap folios range Huan Yang
2025-03-27 9:28 ` [RFC PATCH 4/6] udmabuf: use vmap_range_folios Huan Yang
2025-03-27 9:28 ` [RFC PATCH 5/6] udmabuf: vmap test suit for pages and pfns compare Huan Yang
2025-03-27 9:28 ` [RFC PATCH 6/6] udmabuf: remove no need code Huan Yang
2025-03-28 21:09 ` [RFC PATCH 0/6] Deep talk about folio vmap Vishal Moola (Oracle)
2025-04-04 9:01 ` CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is broken, was " Christoph Hellwig
2025-04-04 9:38 ` Muchun Song
2025-04-04 10:07 ` Muchun Song
2025-04-07 1:59 ` Huan Yang
2025-04-07 2:57 ` Muchun Song
2025-04-07 3:21 ` Huan Yang
2025-04-07 3:37 ` Muchun Song
2025-04-07 6:43 ` Muchun Song
2025-04-07 7:09 ` Huan Yang
2025-04-07 7:22 ` Muchun Song
2025-04-07 8:55 ` Huan Yang
2025-04-07 8:59 ` Christoph Hellwig
2025-04-07 9:48 ` Muchun Song [this message]
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=3DC6E604-3CE9-49E3-A688-DC7F424382DA@linux.dev \
--to=muchun.song@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=bingbu.cao@linux.intel.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hch@lst.de \
--cc=kraxel@redhat.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=link@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=opensource.kernel@vivo.com \
--cc=shuah@kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=urezki@gmail.com \
--cc=vivek.kasireddy@intel.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 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.