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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241104121443.86468-1-yaoma@linux.alibaba.com>
Date: Mon,  4 Nov 2024 20:14:43 +0800
From: Bitao Hu <yaoma@...ux.alibaba.com>
To: mingo@...hat.com,
	peterz@...radead.org,
	juri.lelli@...hat.com,
	vincent.guittot@...aro.org
Cc: linux-kernel@...r.kernel.org,
	yaoma@...ux.alibaba.com
Subject: [PATCH] sched: Remove unnecessary initialization in init_cfs_bandwidth() function

The root task group is statically defined, and non-root task groups
are allocated memory using kmem_cache_alloc() with the __GFP_ZERO
flag. In both cases, the corresponding 'struct cfs_bandwidth' is a
block of all-zero memory. Therefore, it is unnecessary to explicitly
set zeros in the init_cfs_bandwidth() function.

Signed-off-by: Bitao Hu <yaoma@...ux.alibaba.com>
---
 kernel/sched/fair.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 2d16c8545c71..2fd96641164f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6573,10 +6573,8 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer)
 void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b, struct cfs_bandwidth *parent)
 {
 	raw_spin_lock_init(&cfs_b->lock);
-	cfs_b->runtime = 0;
 	cfs_b->quota = RUNTIME_INF;
 	cfs_b->period = ns_to_ktime(default_cfs_period());
-	cfs_b->burst = 0;
 	cfs_b->hierarchical_quota = parent ? parent->hierarchical_quota : RUNTIME_INF;
 
 	INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq);
-- 
2.46.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ