lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <de64f686-fccb-4d33-99d8-b8b44dc534fa@redhat.com>
Date: Sun, 25 Aug 2024 13:25:57 -0400
From: Waiman Long <longman@...hat.com>
To: Chen Ridong <chenridong@...wei.com>, tj@...nel.org,
 lizefan.x@...edance.com, hannes@...xchg.org, mkoutny@...e.com
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 -next 10/11] cgroup/cpuset: guard cpuset-v1 code under
 CONFIG_CPUSETS_V1

On 8/23/24 06:01, Chen Ridong wrote:
> This patch introduces CONFIG_CPUSETS_V1 and guard cpuset-v1 code under
> CONFIG_CPUSETS_V1. The default value of CONFIG_CPUSETS_V1 is N, so that
> user who adopted v2 don't have 'pay' for cpuset v1.
> Besides, to make code succinct, rename '__cpuset_memory_pressure_bump()'
> to 'cpuset_memory_pressure_bump()', and expose it to the world, which
> takes place of the old mocro 'cpuset_memory_pressure_bump'.
>
> Signed-off-by: Chen Ridong <chenridong@...wei.com>
> ---
>   include/linux/cpuset.h          |  8 +-------
>   init/Kconfig                    | 13 +++++++++++++
>   kernel/cgroup/Makefile          |  3 ++-
>   kernel/cgroup/cpuset-internal.h | 15 +++++++++++++++
>   kernel/cgroup/cpuset-v1.c       | 10 ++++++----
>   kernel/cgroup/cpuset.c          |  2 ++
>   6 files changed, 39 insertions(+), 12 deletions(-)
>
> diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
> index 2a6981eeebf8..f91f1f61f482 100644
> --- a/include/linux/cpuset.h
> +++ b/include/linux/cpuset.h
> @@ -99,13 +99,7 @@ static inline bool cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask)
>   extern int cpuset_mems_allowed_intersects(const struct task_struct *tsk1,
>   					  const struct task_struct *tsk2);
>   
> -#define cpuset_memory_pressure_bump() 				\
> -	do {							\
> -		if (cpuset_memory_pressure_enabled)		\
> -			__cpuset_memory_pressure_bump();	\
> -	} while (0)
> -extern int cpuset_memory_pressure_enabled;
> -extern void __cpuset_memory_pressure_bump(void);
> +extern void cpuset_memory_pressure_bump(void);
>   
>   extern void cpuset_task_status_allowed(struct seq_file *m,
>   					struct task_struct *task);

As you are introducing a new CONFIG_CPUSET_V1 kconfig option, you can 
use it to eliminate a useless function call if cgroup v1 isn't enabled. 
Not just this function, all the v1 specific functions should have a 
!CONFIG_CPUSET_V1 version that can be optimized out.

Cheers,
Longman


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ