From nobody Mon Feb 9 13:04:06 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 600EC29ACC6 for ; Thu, 15 Jan 2026 10:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768472653; cv=none; b=M3ZO2Uj4qD8f6Hf8kcoryM53Suv/1GS0y+zKqhlkLq7EXmpmhFxyXOqEyE7slSdZPU9y/RwSbDRFnMVoHH4wh52JbTMNdkRrzubm1n0kCWAalwG7dnysQdF5MhqXhNQ6DrEhUl7qAGgg49UfX4tt7dZ9709HuSmYCe0DyIyt6jo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768472653; c=relaxed/simple; bh=1SNlfQt892UyZKmk3U3M+UTVzKyuH1m/w9Mwi1UQIuE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=HA80dyeKZsrMjZpmlR9F+nIizQzHFMJhixCH4m0/94ZdyLn+aJFMGeEW3WKjZRxhq5jtIaZej0FExGVc2ZAAvq/MklJghbFkWwnGFz9YAUsbRLNB/sQscRSeWvHvzX7yaBIAENbn94sLUkgN0MeQ+jbRtmJWyvxp7AGLFBovbUw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 4ddd7ceaf1fc11f0a38c85956e01ac42-20260115 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.6,REQID:b0cc0523-adc3-4728-8f0c-93399e15040d,IP:0,UR L:0,TC:0,Content:0,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:25 X-CID-META: VersionHash:a9d874c,CLOUDID:b1dad03c079d2b8cd1a91dbdb009520a,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|850|898,TC:nil,Content:0|15|50,EDM:5 ,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV :0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 4ddd7ceaf1fc11f0a38c85956e01ac42-20260115 X-User: zenghongling@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1395415646; Thu, 15 Jan 2026 18:23:58 +0800 From: zenghongling To: mingo@redhat.com, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, zhongling0719@126.com, zenghongling Subject: [PATCH] sched: Realign struct rt_bandwidth to remove holes and improve access efficiency Date: Thu, 15 Jan 2026 18:23:54 +0800 Message-Id: <20260115102354.197601-1-zenghongling@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Realign struct rt_bandwidth to reduce its size by 8 bytes. Total size is now 88 bytes and remove holes,rt_runtime_lock and rt_period_activeare frequently accessed together,Placing them in the same cache line can improve access efficiency. pahole output before: struct rt_bandwidth { raw_spinlock_t rt_runtime_lock; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ ktime_t rt_period; /* 8 8 */ u64 rt_runtime; /* 16 8 */ struct hrtimer rt_period_timer; /* 24 64 */ /* --- cacheline 1 boundary (64 bytes) was 24 bytes ago --- */ unsigned int rt_period_active; /* 88 4 */ /* size: 96, cachelines: 2, members: 5 */ /* sum members: 88, holes: 1, sum holes: 4 */ /* last cacheline: 32 bytes */ } after: struct rt_bandwidth { raw_spinlock_t rt_runtime_lock; /* 0 4 */ unsigned int rt_period_active; /* 4 4 */ u64 rt_runtime; /* 8 8 */ ktime_t rt_period; /* 16 8 */ struct hrtimer rt_period_timer; /* 24 64 */ /* size: 88, cachelines: 2, members: 5 */ /* last cacheline: 24 bytes */ } Signed-off-by: zenghongling --- kernel/sched/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index f2773e91438a..a7c49f54e063 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -313,10 +313,10 @@ struct rt_prio_array { struct rt_bandwidth { /* nests inside the rq lock: */ raw_spinlock_t rt_runtime_lock; + unsigned int rt_period_active; ktime_t rt_period; u64 rt_runtime; struct hrtimer rt_period_timer; - unsigned int rt_period_active; }; =20 static inline int dl_bandwidth_enabled(void) --=20 2.25.1