[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 03/14] xen/grant-table: stop setting PG_private on pages for grant mapping
- To: "David Hildenbrand (Arm)" <david@xxxxxxxxxx>, "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx>, "Andrew Morton" <akpm@xxxxxxxxxxxxxxxxxxxx>, "Muchun Song" <muchun.song@xxxxxxxxx>, "Lorenzo Stoakes" <ljs@xxxxxxxxxx>, "Liam R. Howlett" <liam@xxxxxxxxxxxxx>, "Vlastimil Babka" <vbabka@xxxxxxxxxx>, "Mike Rapoport" <rppt@xxxxxxxxxx>, "Suren Baghdasaryan" <surenb@xxxxxxxxxx>, "Michal Hocko" <mhocko@xxxxxxxx>, "Baolin Wang" <baolin.wang@xxxxxxxxxxxxxxxxx>, "Nico Pache" <nico.pache@xxxxxxxxx>, "Ryan Roberts" <ryan.roberts@xxxxxxx>, "Dev Jain" <dev.jain@xxxxxxx>, "Barry Song" <baohua@xxxxxxxxxx>, "Lance Yang" <lance.yang@xxxxxxxxx>, "Usama Arif" <usama.arif@xxxxxxxxx>, "Gregory Price" <gourry@xxxxxxxxxx>, "Ying Huang" <ying.huang@xxxxxxxxxxxxxxxxx>, "Alistair Popple" <apopple@xxxxxxxxxx>, "Johannes Weiner" <hannes@xxxxxxxxxxx>, "Qi Zheng" <qi.zheng@xxxxxxxxx>, "Shakeel Butt" <shakeel.butt@xxxxxxxxx>, "Kairui Song" <kasong@xxxxxxxxxxx>
- From: "Zi Yan" <ziy@xxxxxxxxxx>
- Date: Tue, 08 Sep 2026 11:44:46 -0400
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wUonv+1fXdqRVR64AjAKSh8fzS4K5yeQQGpHI4+sTZ8=; b=PikpR45oEYt7MOJrMl878COZoD2IIZKHqiCAwU58mVam3iieo2TBvGtCh/j9um5cL1A2iMlsqPQgLVZwEQua7eA9S9omvpF6t1V3OCx4Mgztnm7AaLNbw0BfjhZsaAYaFADhkaZyeLC+6n4/Nm3qCyw3ewxvpFS8Oz0+LncaaO14l3spbkJWmM/tFP9jCHoJ8J8O1Lvi0ZWDc4L54MCSLAA/qE//ge7iFLRVkV+LiH/QL129zXUPD221WRuRtjvV83Q1RlbYUYJIrbBqsSV+6srlsuFiVfETaAS5WS6Pywl0QJNH9gYXo0ENyLzrZ0NpVt7s7JcTaFMcm2qZtma4ZA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XNXTeJn3wAg9WXnadc23COLow0t+fVtyrSLdBMioSg5aXICV5bD0aB1n3v39op2ITN6V93hppovIIPHIo5pRlumrqSHEI+ea/kevee/IT8UhCPUEsHmKkJ3mldz8BUGhQFkOKIhnuU+5dzAeMHXChSYWnx1wzVI8YtvxQXedsdGOLpMznnnFdC3PSbxZTDnbT0q2phGAf4VOiNRHMUsx0yfwwccG4NMp+sP6YPQhl7nTlH7z/6gBnKLwHt9JDV2cRwt4PUajH8ySLywTgqKbCK/CyUDqHyr4ueNvyUHJ0r4g5oos9Zhm3Wzk/L32ldFSKpDkNo6kB5sP36NhVPkBJg==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com;
- Cc: <linux-mm@xxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, "Juergen Gross" <jgross@xxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, "Oleksandr Tyshchenko" <oleksandr_tyshchenko@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 08 Sep 2026 15:45:01 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue Sep 8, 2026 at 11:16 AM EDT, David Hildenbrand (Arm) wrote:
> On 9/8/26 04:56, Zi Yan wrote:
>> gnttab_alloc_pages() stores xen_page_foreign in page->private. On 32-bit, a
>> pointer to an allocated xen_page_foreign is stored; on 64-bit,
>> xen_page_foreign is stored inline. Checking page->private != NULL is enough
>> to tell whether a xen_page_foreign needs to be freed on 32-bit and
>> page->private is zeroed unconditionally on 64-bit.
>>
>> It prepares for a future commit that remove PG_private.
>>
>> No functional change intended.
>>
>> Assisted-by: Claude:claude-opus-4-8
>> Assisted-by: Codex:gpt-5
>> Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
>> To: Juergen Gross <jgross@xxxxxxxx>
>> To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>> Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
>> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
>> Cc: linux-kernel@xxxxxxxxxxxxxxx
>> ---
>> drivers/xen/balloon.c | 5 +++++
>> drivers/xen/grant-table.c | 11 +++++------
>> 2 files changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
>> index e7f74ea7cd5eb..fdb18348cfdfe 100644
>> --- a/drivers/xen/balloon.c
>> +++ b/drivers/xen/balloon.c
>> @@ -182,6 +182,11 @@ static struct page *balloon_retrieve(bool
>> require_lowmem)
>>
>> __ClearPageOffline(page);
>> dec_node_page_state(page, NR_BALLOON_PAGES);
>> + /*
>> + * clear page->private before giving it out, since it might be used to
>> + * store xen_page_foreign info.
>> + */
>> + set_page_private(page, 0);
>
> Who would have set it to != 0 in the first place?
No one else, except
>
> e.g., gnttab_free_pages() resets it to 0 now before calling
> xen_free_unpopulated_pages().
After reading more, I agree with you that the above change is unnecesary
and will remove it in the next version. Thanks.
--
Best Regards,
Yan, Zi
|