[PATCH 0/2] mm/hugetlb: refactor sysfs/sysctl interfaces

Hui Zhu posted 2 patches 3 months ago
There is a newer version of this series
mm/Makefile           |   2 +-
mm/hugetlb.c          | 852 +-----------------------------------------
mm/hugetlb_internal.h | 116 ++++++
mm/hugetlb_sysctl.c   | 136 +++++++
mm/hugetlb_sysfs.c    | 632 +++++++++++++++++++++++++++++++
5 files changed, 894 insertions(+), 844 deletions(-)
create mode 100644 mm/hugetlb_internal.h
create mode 100644 mm/hugetlb_sysctl.c
create mode 100644 mm/hugetlb_sysfs.c
[PATCH 0/2] mm/hugetlb: refactor sysfs/sysctl interfaces
Posted by Hui Zhu 3 months ago
From: Hui Zhu <zhuhui@kylinos.cn>

The hugetlb.c file has grown significantly and become difficult to
maintain. This patch series extracts the sysfs and sysctl interface
code into separate dedicated files to improve code organization.

The refactoring includes:
- Patch 1: Extract sysfs interface into mm/hugetlb_sysfs.c
- Patch 2: Extract sysctl interface into mm/hugetlb_sysctl.c

No functional changes are introduced in this series. The code is moved
as-is, with only minor formatting adjustments for code style
consistency. This should make future maintenance and enhancements to
the hugetlb subsystem easier.

Testing: The patch series has been compile-tested and maintains the
same functionality as the original code.

Geliang Tang (1):
  mm/hugetlb: extract sysfs into hugetlb_sysfs.c

Hui Zhu (1):
  mm/hugetlb: extract sysctl into hugetlb_sysctl.c

 mm/Makefile           |   2 +-
 mm/hugetlb.c          | 852 +-----------------------------------------
 mm/hugetlb_internal.h | 116 ++++++
 mm/hugetlb_sysctl.c   | 136 +++++++
 mm/hugetlb_sysfs.c    | 632 +++++++++++++++++++++++++++++++
 5 files changed, 894 insertions(+), 844 deletions(-)
 create mode 100644 mm/hugetlb_internal.h
 create mode 100644 mm/hugetlb_sysctl.c
 create mode 100644 mm/hugetlb_sysfs.c

-- 
2.43.0
Re: [PATCH 0/2] mm/hugetlb: refactor sysfs/sysctl interfaces
Posted by SeongJae Park 3 months ago
On Mon,  3 Nov 2025 16:22:07 +0800 Hui Zhu <hui.zhu@linux.dev> wrote:

> From: Hui Zhu <zhuhui@kylinos.cn>
> 
> The hugetlb.c file has grown significantly and become difficult to
> maintain. This patch series extracts the sysfs and sysctl interface
> code into separate dedicated files to improve code organization.
> 
> The refactoring includes:
> - Patch 1: Extract sysfs interface into mm/hugetlb_sysfs.c
> - Patch 2: Extract sysctl interface into mm/hugetlb_sysctl.c
> 
> No functional changes are introduced in this series. The code is moved
> as-is, with only minor formatting adjustments for code style
> consistency. This should make future maintenance and enhancements to
> the hugetlb subsystem easier.
> 
> Testing: The patch series has been compile-tested and maintains the
> same functionality as the original code.
> 
> Geliang Tang (1):
>   mm/hugetlb: extract sysfs into hugetlb_sysfs.c
> 
> Hui Zhu (1):
>   mm/hugetlb: extract sysctl into hugetlb_sysctl.c
> 
>  mm/Makefile           |   2 +-
>  mm/hugetlb.c          | 852 +-----------------------------------------
>  mm/hugetlb_internal.h | 116 ++++++
>  mm/hugetlb_sysctl.c   | 136 +++++++
>  mm/hugetlb_sysfs.c    | 632 +++++++++++++++++++++++++++++++
>  5 files changed, 894 insertions(+), 844 deletions(-)
>  create mode 100644 mm/hugetlb_internal.h
>  create mode 100644 mm/hugetlb_sysctl.c
>  create mode 100644 mm/hugetlb_sysfs.c

I think MAINTAINERS file should also be updated for the newly added files.


Thanks,
SJ

[...]
Re: [PATCH 0/2] mm/hugetlb: refactor sysfs/sysctl interfaces
Posted by hui.zhu@linux.dev 3 months ago
2025年11月4日 12:43, "SeongJae Park" <sj@kernel.org mailto:sj@kernel.org?to=%22SeongJae%20Park%22%20%3Csj%40kernel.org%3E > 写到:


> 
> On Mon, 3 Nov 2025 16:22:07 +0800 Hui Zhu <hui.zhu@linux.dev> wrote:
> 
> > 
> > From: Hui Zhu <zhuhui@kylinos.cn>
> >  
> >  The hugetlb.c file has grown significantly and become difficult to
> >  maintain. This patch series extracts the sysfs and sysctl interface
> >  code into separate dedicated files to improve code organization.
> >  
> >  The refactoring includes:
> >  - Patch 1: Extract sysfs interface into mm/hugetlb_sysfs.c
> >  - Patch 2: Extract sysctl interface into mm/hugetlb_sysctl.c
> >  
> >  No functional changes are introduced in this series. The code is moved
> >  as-is, with only minor formatting adjustments for code style
> >  consistency. This should make future maintenance and enhancements to
> >  the hugetlb subsystem easier.
> >  
> >  Testing: The patch series has been compile-tested and maintains the
> >  same functionality as the original code.
> >  
> >  Geliang Tang (1):
> >  mm/hugetlb: extract sysfs into hugetlb_sysfs.c
> >  
> >  Hui Zhu (1):
> >  mm/hugetlb: extract sysctl into hugetlb_sysctl.c
> >  
> >  mm/Makefile | 2 +-
> >  mm/hugetlb.c | 852 +-----------------------------------------
> >  mm/hugetlb_internal.h | 116 ++++++
> >  mm/hugetlb_sysctl.c | 136 +++++++
> >  mm/hugetlb_sysfs.c | 632 +++++++++++++++++++++++++++++++
> >  5 files changed, 894 insertions(+), 844 deletions(-)
> >  create mode 100644 mm/hugetlb_internal.h
> >  create mode 100644 mm/hugetlb_sysctl.c
> >  create mode 100644 mm/hugetlb_sysfs.c
> > 
> I think MAINTAINERS file should also be updated for the newly added files.
> 

Updated MAINTAINERS to v3 version according your comments.

Best,
Hui

> Thanks,
> SJ
> 
> [...]
>