[PATCH v7 47/49] fs/resctrl: Remove unnecessary includes

James Morse posted 49 patches 11 months, 2 weeks ago
There is a newer version of this series
[PATCH v7 47/49] fs/resctrl: Remove unnecessary includes
Posted by James Morse 11 months, 2 weeks ago
When splitting and moving the resctrl code to live in fs/resctrl and
arch/x86, some code was duplicated. This was done to keep the parser
in the script that does the moving simple. These extra includes are
harmless on x86.

Remove them to allow other architectures to start using fs/resctrl.

Signed-off-by: James Morse <james.morse@arm.com>
---
Changes since v6:
 * This patch is new.
---
 fs/resctrl/monitor.c     | 2 --
 fs/resctrl/pseudo_lock.c | 1 -
 2 files changed, 3 deletions(-)

diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
index d37324f9f95f..3fe21dcf0fde 100644
--- a/fs/resctrl/monitor.c
+++ b/fs/resctrl/monitor.c
@@ -23,8 +23,6 @@
 #include <linux/sizes.h>
 #include <linux/slab.h>
 
-#include <asm/cpu_device_id.h>
-
 #include "internal.h"
 
 #define CREATE_TRACE_POINTS
diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c
index d26cc1a2a84a..3bee26b8c07d 100644
--- a/fs/resctrl/pseudo_lock.c
+++ b/fs/resctrl/pseudo_lock.c
@@ -27,7 +27,6 @@
 #include <asm/cpu_device_id.h>
 #include <asm/perf_event.h>
 
-#include "../../events/perf_event.h" /* For X86_CONFIG() */
 #include "internal.h"
 
 /*
-- 
2.39.5
Re: [PATCH v7 47/49] fs/resctrl: Remove unnecessary includes
Posted by Reinette Chatre 11 months, 1 week ago
Hi James,

On 2/28/25 11:59 AM, James Morse wrote:
> When splitting and moving the resctrl code to live in fs/resctrl and
> arch/x86, some code was duplicated. This was done to keep the parser
> in the script that does the moving simple. These extra includes are
> harmless on x86.
> 
> Remove them to allow other architectures to start using fs/resctrl.
> 
> Signed-off-by: James Morse <james.morse@arm.com>
> ---

I think it is going to take more digging to find all the
unnecessary includes. For example, one that was easy to spot is the
include of linux/kthread.h in arch/x86/kernel/cpu/resctrl/pseudo_lock.c

Reinette
Re: [PATCH v7 47/49] fs/resctrl: Remove unnecessary includes
Posted by Fenghua Yu 11 months, 1 week ago
Hi, James,

On 2/28/25 11:59, James Morse wrote:
> When splitting and moving the resctrl code to live in fs/resctrl and
> arch/x86, some code was duplicated. This was done to keep the parser
> in the script that does the moving simple. These extra includes are

As for "parser in the script", my concern is people may forget or don't 
know the context of the python script in the future and get confused 
when reading this patch.

Is it possible to merge this patch into patch 45 which introduces the 
macros? It simplify the patch set and avoid future confuse?

> harmless on x86.
>
> Remove them to allow other architectures to start using fs/resctrl.
>
> Signed-off-by: James Morse <james.morse@arm.com>
> ---
> Changes since v6:
>   * This patch is new.
> ---
>   fs/resctrl/monitor.c     | 2 --
>   fs/resctrl/pseudo_lock.c | 1 -
>   2 files changed, 3 deletions(-)
>
> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
> index d37324f9f95f..3fe21dcf0fde 100644
> --- a/fs/resctrl/monitor.c
> +++ b/fs/resctrl/monitor.c
> @@ -23,8 +23,6 @@
>   #include <linux/sizes.h>
>   #include <linux/slab.h>
>   
> -#include <asm/cpu_device_id.h>
> -
>   #include "internal.h"
>   
>   #define CREATE_TRACE_POINTS
> diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c
> index d26cc1a2a84a..3bee26b8c07d 100644
> --- a/fs/resctrl/pseudo_lock.c
> +++ b/fs/resctrl/pseudo_lock.c
> @@ -27,7 +27,6 @@
>   #include <asm/cpu_device_id.h>
>   #include <asm/perf_event.h>
>   
> -#include "../../events/perf_event.h" /* For X86_CONFIG() */
>   #include "internal.h"
>   
>   /*

Thanks.

-Fenghua
Re: [PATCH v7 47/49] fs/resctrl: Remove unnecessary includes
Posted by James Morse 11 months ago
Hi Fenghua,

On 07/03/2025 02:37, Fenghua Yu wrote:
> On 2/28/25 11:59, James Morse wrote:
>> When splitting and moving the resctrl code to live in fs/resctrl and
>> arch/x86, some code was duplicated. This was done to keep the parser
>> in the script that does the moving simple. These extra includes are

> As for "parser in the script", my concern is people may forget or don't know the context
> of the python script in the future and get confused when reading this patch.

> Is it possible to merge this patch into patch 45 which introduces the macros? It simplify
> the patch set and avoid future confuse?

The plan would be for these patches to get merged together by the person that applies them.


Thanks,

James