[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cbee126b-5a3b-4f03-a049-2d8b86b4e5f9@kernel.org>
Date: Mon, 3 Nov 2025 17:28:54 +0100
From: "David Hildenbrand (Red Hat)" <david@...nel.org>
To: Hui Zhu <hui.zhu@...ux.dev>, Andrew Morton <akpm@...ux-foundation.org>,
Muchun Song <muchun.song@...ux.dev>, Oscar Salvador <osalvador@...e.de>,
David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Cc: Geliang Tang <geliang@...nel.org>, Hui Zhu <zhuhui@...inos.cn>
Subject: Re: [PATCH 1/2] mm/hugetlb: extract sysfs into hugetlb_sysfs.c
On 03.11.25 09:22, Hui Zhu wrote:
> From: Geliang Tang <geliang@...nel.org>
>
> Currently, hugetlb.c contains both core management logic and sysfs
> interface implementations, making it difficult to maintain. This patch
> extracts the sysfs-related code into a dedicated file to improve code
> organization.
>
> The following components are moved to mm/hugetlb_sysfs.c:
> - hugetlb page demote functions (demote_free_hugetlb_folios,
> demote_pool_huge_page)
> - sysfs attribute definitions and handlers
> - sysfs kobject management functions
> - NUMA per-node hstate attribute registration
>
> Several inline helper functions and macros are moved to
> mm/hugetlb_internal.h:
> - hstate_is_gigantic_no_runtime()
> - next_node_allowed()
> - get_valid_node_allowed()
> - hstate_next_node_to_alloc()
> - hstate_next_node_to_free()
> - for_each_node_mask_to_alloc/to_free macros
>
> To support code sharing, these functions are changed from static to
> exported symbols:
> - remove_hugetlb_folio()
> - add_hugetlb_folio()
> - init_new_hugetlb_folio()
> - prep_and_add_allocated_folios()
> - __nr_hugepages_store_common()
>
> The Makefile is updated to compile hugetlb_sysfs.o when
> CONFIG_HUGETLBFS is enabled. This maintains all existing functionality
> while improving maintainability by separating concerns.
>
> Signed-off-by: Geliang Tang <geliang@...nel.org>
> Signed-off-by: Hui Zhu <zhuhui@...inos.cn>
> ---
[...]
> index 000000000000..63ab13cfb072
> --- /dev/null
> +++ b/mm/hugetlb_internal.h
> @@ -0,0 +1,110 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Internal HugeTLB definitions.
> + *
> + * Copyright (C) 2025 KylinSoft Corporation.
> + * Author: Geliang Tang <geliang@...nel.org>
> + */
So, you move some code and suddenly have copyright and authored that code.
Especially given the cove letter says "The code is moved
as-is, with only minor formatting adjustments for code style
consistency."
?
--
Cheers
David
Powered by blists - more mailing lists