From nobody Fri Apr 3 08:06:55 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 55E8D332916; Wed, 18 Feb 2026 14:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424422; cv=none; b=rF9v1Z1AoUJNcAM++aUEa3U6bZpDw7p/U2m/PRys3Grf6nvSj3CJ9BJET+2i7GSDb37ZbkHyFzJacGdb4Sr2U20ixsEsHU4DDfVnItQ7MfQKBWEi/RjmKPrybu9LY/KqWSiQKwTwggrUoN566tTJlBzmvNORFPGpp+AiVQtjgm0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424422; c=relaxed/simple; bh=wk2ap9Grs5gRzDrhu8Ml9L9h7l13iyGVUQ1PmeDrbls=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UNPcp6I2GV3eDtW2Ha0wzb3yzMGCt+o/f0o9d2tIfTYvGq5LWUs2B3L7N350VE7Z5jIZ+zoyIUD5ZlvJd4zYW1jLKnhoucxlBUFTaDvEYEF09YOF7HdPIdBr9qAoSzzs79saC7ERFHMYuS6fF8HFtRSqWXjHkF7xDycLbmahy6o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=QtYh2JXV; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="QtYh2JXV" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61I6fbBQ1907189; Wed, 18 Feb 2026 14:20:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=nXSj0IMrvKeHEYN+c vFjboEYcPAfBZS6jWD4fK/MDI0=; b=QtYh2JXVPWz3rLOpuqg/LetPr2UBna+vk YDKdSMzVbmcDciI/XiFxR2cR8p4gqR9ki08uaycxoYIbTifjnsfIBMGUeN5Pvn13 3sbCuBur3CWu2z/Jg6WhRoxk/0mtwCUBGxQDmpB0OikxLAdoRWm4kUh1vi9yTP+p f2HbMUTEIdtuRjsceT1Z3xQEshBZHTXk/4LVU/kaq8Rb/6K4N7ThiGRl1LggI0cv fhVwr0NFpLS1r4SpbMdBfclTS4JXvOWEd5EMzhTNnJLs62LAJl5wJtOhf5Mrcty9 qEENSIoBeLotAyr3EnAHUvd1eUa2/XICJ8m32RrIKVW29CgsqEeUA== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4caj4kgdt4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61IDIvlN011965; Wed, 18 Feb 2026 14:20:17 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4ccb2704s1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:17 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61IEKDGL38601110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Feb 2026 14:20:13 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77CA820043; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5602D2004B; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) From: Heiko Carstens To: Frederic Weisbecker , Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 1/9] s390/idle: Fix cpu idle exit cpu time accounting Date: Wed, 18 Feb 2026 15:20:04 +0100 Message-ID: <20260218142012.863464-2-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260218142012.863464-1-hca@linux.ibm.com> References: <20260218142012.863464-1-hca@linux.ibm.com> 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 X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE4MDEyMCBTYWx0ZWRfX+/x8b4Myc4By TbmXYV7pCqhPPIIy/AN4pJZbobNJASEN9sVY5/hvGq2s+g9CcVnexmdvJFYR8SmJlTADh18kueB nUIfSQxnTnEmEdz9baaVu9mP4UqvBYV4wyuzuFmuCzCrLgqfNmi426PbvMgq7lUzENSqi+2ZOko g//TMzBRjMICE9Se0Ngy2N3H7vbUZ5D4Ue1u/+9HVMuu70Tc661Sozt9YlGq/3WQRFTjJALnBxz oUDX691TLAbmmdxCI+njoNtqGQxVpqyD/PTpwcC0GmgzBdIY+b4ISoi3kolCJkjpxZJsdu+rS9y ZsmsguMn3aHLjYmW1nkPHs5RJAJUDEfQ/n/2kiTVhEKy9tIZaEwHVh8ZU7TNeMlxSev/nrwTcmk bW6RAkxovTuiVX5WVew1P0ENZyvYMsAL9woGVr2yepQHUun8T+S3z/zzDDObeHjLN/LCvMBd3ja +ABn01D5amJsMXRZc7w== X-Proofpoint-ORIG-GUID: iFt_RmT3fC08_UWYQmKWkSuzefsQXLN_ X-Proofpoint-GUID: iFt_RmT3fC08_UWYQmKWkSuzefsQXLN_ X-Authority-Analysis: v=2.4 cv=M7hA6iws c=1 sm=1 tr=0 ts=6995caa2 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=80vVb9OYCQLWou6ImFEA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-18_02,2026-02-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602180120 Content-Type: text/plain; charset="utf-8" With the conversion to generic entry [1] cpu idle exit cpu time accounting was converted from assembly to C. This introduced an reversed order of cpu time accounting. On cpu idle exit the current accounting happens with the following call chain: -> do_io_irq()/do_ext_irq() -> irq_enter_rcu() -> account_hardirq_enter() -> vtime_account_irq() -> vtime_account_kernel() vtime_account_kernel() accounts the passed cpu time since last_update_timer as system time, and updates last_update_timer to the current cpu timer value. However the subsequent call of -> account_idle_time_irq() will incorrectly subtract passed cpu time from timer_idle_enter to the updated last_update_timer value from system_timer. Then last_update_timer is updated to a sys_enter_timer, which means that last_update_timer goes back in time. Subsequently account_hardirq_exit() will account too much cpu time as hardirq time. The sum of all accounted cpu times is still correct, however some cpu time which was previously accounted as system time is now accounted as hardirq time, plus there is the oddity that last_update_timer goes back in time. Restore previous behavior by extracting cpu time accounting code from account_idle_time_irq() into a new update_timer_idle() function and call it before irq_enter_rcu(). Fixes: 56e62a737028 ("s390: convert to generic entry") [1] Signed-off-by: Heiko Carstens Reviewed-by: Frederic Weisbecker Reviewed-by: Sven Schnelle --- arch/s390/include/asm/idle.h | 1 + arch/s390/kernel/idle.c | 13 +++++++++---- arch/s390/kernel/irq.c | 10 ++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/arch/s390/include/asm/idle.h b/arch/s390/include/asm/idle.h index 09f763b9eb40..133059d9a949 100644 --- a/arch/s390/include/asm/idle.h +++ b/arch/s390/include/asm/idle.h @@ -23,5 +23,6 @@ extern struct device_attribute dev_attr_idle_count; extern struct device_attribute dev_attr_idle_time_us; =20 void psw_idle(struct s390_idle_data *data, unsigned long psw_mask); +void update_timer_idle(void); =20 #endif /* _S390_IDLE_H */ diff --git a/arch/s390/kernel/idle.c b/arch/s390/kernel/idle.c index 39cb8d0ae348..0f9e53f0a068 100644 --- a/arch/s390/kernel/idle.c +++ b/arch/s390/kernel/idle.c @@ -21,11 +21,10 @@ =20 static DEFINE_PER_CPU(struct s390_idle_data, s390_idle); =20 -void account_idle_time_irq(void) +void update_timer_idle(void) { struct s390_idle_data *idle =3D this_cpu_ptr(&s390_idle); struct lowcore *lc =3D get_lowcore(); - unsigned long idle_time; u64 cycles_new[8]; int i; =20 @@ -35,13 +34,19 @@ void account_idle_time_irq(void) this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]); } =20 - idle_time =3D lc->int_clock - idle->clock_idle_enter; - lc->steal_timer +=3D idle->clock_idle_enter - lc->last_update_clock; lc->last_update_clock =3D lc->int_clock; =20 lc->system_timer +=3D lc->last_update_timer - idle->timer_idle_enter; lc->last_update_timer =3D lc->sys_enter_timer; +} + +void account_idle_time_irq(void) +{ + struct s390_idle_data *idle =3D this_cpu_ptr(&s390_idle); + unsigned long idle_time; + + idle_time =3D get_lowcore()->int_clock - idle->clock_idle_enter; =20 /* Account time spent with enabled wait psw loaded as idle time. */ WRITE_ONCE(idle->idle_time, READ_ONCE(idle->idle_time) + idle_time); diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index bdf9c7cb5685..080e9285b337 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c @@ -146,6 +146,10 @@ void noinstr do_io_irq(struct pt_regs *regs) struct pt_regs *old_regs =3D set_irq_regs(regs); bool from_idle; =20 + from_idle =3D test_and_clear_cpu_flag(CIF_ENABLED_WAIT); + if (from_idle) + update_timer_idle(); + irq_enter_rcu(); =20 if (user_mode(regs)) { @@ -154,7 +158,6 @@ void noinstr do_io_irq(struct pt_regs *regs) current->thread.last_break =3D regs->last_break; } =20 - from_idle =3D test_and_clear_cpu_flag(CIF_ENABLED_WAIT); if (from_idle) account_idle_time_irq(); =20 @@ -182,6 +185,10 @@ void noinstr do_ext_irq(struct pt_regs *regs) struct pt_regs *old_regs =3D set_irq_regs(regs); bool from_idle; =20 + from_idle =3D test_and_clear_cpu_flag(CIF_ENABLED_WAIT); + if (from_idle) + update_timer_idle(); + irq_enter_rcu(); =20 if (user_mode(regs)) { @@ -194,7 +201,6 @@ void noinstr do_ext_irq(struct pt_regs *regs) regs->int_parm =3D get_lowcore()->ext_params; regs->int_parm_long =3D get_lowcore()->ext_params2; =20 - from_idle =3D test_and_clear_cpu_flag(CIF_ENABLED_WAIT); if (from_idle) account_idle_time_irq(); =20 --=20 2.51.0 From nobody Fri Apr 3 08:06:55 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 55F0A333420; Wed, 18 Feb 2026 14:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424422; cv=none; b=S+D0Vhsr1bgXGbBEx8YRc5ltvyrJDhkNCjsvda/34vSecFuqV1Qv77vr3LTu2lpD1ctSf694pWxb35mVdNZQ/Sl/NPXL6+q7LSzj78+UkorGiY9x373v+2CCwrufbZtX18wtijnk7zFhtpf957buJ3nm18Z8oj+VjZ68NHXSF+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424422; c=relaxed/simple; bh=n2TPzx4LU+5jcuS/l1EQyFwihwVyQtwTZDsXVjLlGXw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pIx0A44YqH73ojhl0eo7/0ftzr3Sq9o8f6heQ7j8MSWu3XDruO/gQ5wf2GNUnkR3L9Nyrha2LPe1GDDhTDq1bDItOC0yD0pl6e6CZhLiVM2u7G4+oGKxBvbxG9ywZtLih15qbBYvNAoTB4DK9dYEWo0n3DirAkFBffiHp+bPVps= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=LJHpQgcO; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="LJHpQgcO" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61I2FoTi1821639; Wed, 18 Feb 2026 14:20:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=X5xLP7BqbUHolIUTT AWZNmVcbnTprmY/D3KyNtaohtQ=; b=LJHpQgcOgZ23upXG048QYVIv6B9DZYsZ8 jiI8WRTA0Sxbh6/9Uc7jwTLG8bO6xR9W7oUlCQSvV/TyKJkHeOkDn7E3GP5qihd1 E8vq8CPQL5hVcwQ2TD/4Evb4+WQjf+hbJ0/ni7CyRVnwH8XZwG+HpvXE1VwBY5Kx JVizNsaFlHuag8x8Lst3wYifip6jCXQBBmQXIKRue2nhGyGRCZzPcwlcONqM9cdZ aXjQSotoxbVTqoRhU5tAwWGOfG1foRgfWp7/h86SilzbIKwJukTP6fxH4Gl0X7eJ rkutvFCUDmZQUfeSUegZFDQDvLlsDPZKzOWAJkEvk2gOPmf1HK7LA== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4caj648ey2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61IDTt3K023899; Wed, 18 Feb 2026 14:20:17 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4ccb4583b0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:17 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61IEKDIW33947968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Feb 2026 14:20:13 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F9602004B; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7CE312004E; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) From: Heiko Carstens To: Frederic Weisbecker , Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 2/9] s390/vtime: Fix virtual timer forwarding Date: Wed, 18 Feb 2026 15:20:05 +0100 Message-ID: <20260218142012.863464-3-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260218142012.863464-1-hca@linux.ibm.com> References: <20260218142012.863464-1-hca@linux.ibm.com> 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 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: _0EnLTnb0f7uY-O_2ADZcf7xjBH9tkn5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE4MDEyMCBTYWx0ZWRfX6L/1GYAC5g0v LMfrZhE45pcah0d3ILiETKyE2HMzbyECGuGqbroHAe5Lu1xxIlUUGq1zVjll/HeREzbp1JRwHmJ iaxhUg6Uj70XSPzZweafuOqZXRCDuGM47wZ7OtYBjHDo97AxeMhQm6Ij0V4+MeaOlu8XSc/cwDO JeJJy6Ph1c64ZAjU/+JfSBE/rKhA5X+OBkqVvF9AfeTH2gOmn7jDQH/PGYhOVNJ/Gba1/9RUfn1 esnimb4DM/OlE+IYIB87Q9H6+hXRaEPxogqs4fXvAJVP53sV9oPS+g+mpbj8NZGjSesK3X2J2pk agaptc59bQP4XQOP2pifz2nTAr805vNJIYvqGXdyfTojJFzdf7/SqSgYMY3O66jyLt6F1b/DADW jlU/NXcNErb7NV3QdhfeuF0o9ShHDT573a0FTp2s/AM0BW5vrfcp65v/M8Tez5fYrVPnhyn2TKP nzZIhIb06Gr6YELf7hg== X-Proofpoint-GUID: _0EnLTnb0f7uY-O_2ADZcf7xjBH9tkn5 X-Authority-Analysis: v=2.4 cv=U+mfzOru c=1 sm=1 tr=0 ts=6995caa2 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=O0ay5dtW3tVG4uawZmwA:9 a=0bXxn9q0MV6snEgNplNhOjQmxlI=:19 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-18_02,2026-02-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 impostorscore=0 malwarescore=0 spamscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602180120 Content-Type: text/plain; charset="utf-8" Since delayed accounting of system time [1] the virtual timer is forwarded by do_account_vtime() but also vtime_account_kernel(), vtime_account_softirq(), and vtime_account_hardirq(). This leads to double accounting of system, guest, softirq, and hardirq time. Remove accounting from the vtime_account*() family to restore old behavior. There is only one user of the vtimer interface, which might explain why nobody noticed this so far. Fixes: b7394a5f4ce9 ("sched/cputime, s390: Implement delayed accounting of = system time") [1] Signed-off-by: Heiko Carstens Reviewed-by: Frederic Weisbecker Reviewed-by: Sven Schnelle --- arch/s390/kernel/vtime.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 234a0ba30510..122d30b10440 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -225,10 +225,6 @@ static u64 vtime_delta(void) return timer - lc->last_update_timer; } =20 -/* - * Update process times based on virtual cpu times stored by entry.S - * to the lowcore fields user_timer, system_timer & steal_clock. - */ void vtime_account_kernel(struct task_struct *tsk) { struct lowcore *lc =3D get_lowcore(); @@ -238,27 +234,17 @@ void vtime_account_kernel(struct task_struct *tsk) lc->guest_timer +=3D delta; else lc->system_timer +=3D delta; - - virt_timer_forward(delta); } EXPORT_SYMBOL_GPL(vtime_account_kernel); =20 void vtime_account_softirq(struct task_struct *tsk) { - u64 delta =3D vtime_delta(); - - get_lowcore()->softirq_timer +=3D delta; - - virt_timer_forward(delta); + get_lowcore()->softirq_timer +=3D vtime_delta(); } =20 void vtime_account_hardirq(struct task_struct *tsk) { - u64 delta =3D vtime_delta(); - - get_lowcore()->hardirq_timer +=3D delta; - - virt_timer_forward(delta); + get_lowcore()->hardirq_timer +=3D vtime_delta(); } =20 /* --=20 2.51.0 From nobody Fri Apr 3 08:06:55 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 55E0D32FA00; Wed, 18 Feb 2026 14:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424422; cv=none; b=QP5+zxExXDWbwhZDgRWvEeDr72/bAn/bq6CFxKxiy0PIIpMx10Wnkq16r/huZ5EQAh6jaH3E5K2rxo7vZ8F0rPLho98Phn7tgblLWrMVvVqaY8agszlz/Vrr69W0Rpr8Qm4QLyMZrqG8ta6AHYuvITOZgnoEBGdZqzWfcLVcO7s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424422; c=relaxed/simple; bh=wQd1/GlJbhrQGcsmPRyXCDBuRblJ6DrdnJfOyv9ytrQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JKR6TtSG43EcU4ncT33ntDmv31AvS+lQ46JjEI0CvNFHnFHsH6d20rWiRFUVw+zAcVsGX5zj1YYC/jr1xiRozHTZ1AtTJCpQvwmQ1tdFn0ehn3ChIR9RwsvT3CFVSetczzWpP5Tp0NoJSQue5ey8bqHqquuANMQ5vSDjlpd/uE8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=qQQ/Fx15; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="qQQ/Fx15" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61I3gtLJ2301761; Wed, 18 Feb 2026 14:20:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=rfaKktZX0rgmOILbT OClBEUylYCktdaj1x7BupczWcU=; b=qQQ/Fx15FTaIONn+pob35V7JREOMk5jGl tpXp0XxIEtAd9tlHOm140kNKLr+ycyOAd8crenUrdJmhyle9briSMLJ5ONet2wWp yJRDsgZUwPG1mgEdb1ANaG0MVmTlcZk8g3nZsmUQbVK8CGTluh99+vR7X3wm554i e6tc0m0m6hYxJLlZxCs2wAN8LfOhsvaQPxgpjY99R9pTQlftOnu1ENh1GHwM9C+v 2A91ISvrZ8EgLa+ZIeJhRcprogFAezW4wtm8m2zSBmMQHl3xjVNIgM63LnWotNNZ vrdZT77eBGct9K7oJiLu9c6yCUS+0SrPb4SdflYqCG4hhlJl4BTkQ== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4caj648ey3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61IDb4PK001432; Wed, 18 Feb 2026 14:20:17 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4ccb2bg31n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:17 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61IEKDck33947970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Feb 2026 14:20:13 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C241D20043; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A2B3E2004D; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) From: Heiko Carstens To: Frederic Weisbecker , Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 3/9] s390/idle: Add comment for non obvious code Date: Wed, 18 Feb 2026 15:20:06 +0100 Message-ID: <20260218142012.863464-4-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260218142012.863464-1-hca@linux.ibm.com> References: <20260218142012.863464-1-hca@linux.ibm.com> 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 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: I8tMsWU0hwDELJTIVg53Rhvv6W2HRaeH X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE4MDEyMCBTYWx0ZWRfX6b+dDX4oZU9Q 2OMopSEulipltFfDLjJ8m/ONR6WiSSKcN0ItQvO0xcy9K4+BCr2XYhnMGiCUNtA59Idit7+LVky 9Y7JYOTRab6saj9Asb+RMty/AzM0XYsdLX6JIVYvcr1LYFJVikzx494sdR5hpEgTyd7ZOnprwwv W83HLejDjZywvkWOt7kkACRnESz4LiGR/AO4iEx8IdWumWOpLjMfOIqSTpfH5/iM1yn82VXsMlb 4OJHSTTxAUPqAqFyhf54tZf/Wt6yAN3uwLphqDBLrMgvLhWCpLqf0qDhWSSJ+YHMiftqwNNgDSh MfrZJgf+1ov9CcHJOnc9AyOjqLhtV9mU6IYVZCloljFPNtU83sdGt4IxNMJbOVhAq2DPv7gvLAt Ymc0acVyWCgyW2ET8VbKTTp9qDNUvrevQ9xpBrgwszjuzycKJIlBHWs8w0IuH6LduNxZMC+iP8v LpqFdt2bxmuuxdjYLtA== X-Proofpoint-GUID: I8tMsWU0hwDELJTIVg53Rhvv6W2HRaeH X-Authority-Analysis: v=2.4 cv=U+mfzOru c=1 sm=1 tr=0 ts=6995caa2 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=OTAgdNo29iS1D3tcfewA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-18_02,2026-02-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 impostorscore=0 malwarescore=0 spamscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602180120 Content-Type: text/plain; charset="utf-8" Add a comment to update_timer_idle() which describes why wall time (not steal time) is added to steal_timer. This is not obvious and was reported by Frederic Weisbecker. Reported-by: Frederic Weisbecker Closes: https://lore.kernel.org/all/aXEVM-04lj0lntMr@localhost.localdomain/ Signed-off-by: Heiko Carstens Reviewed-by: Frederic Weisbecker Reviewed-by: Sven Schnelle --- arch/s390/kernel/idle.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/s390/kernel/idle.c b/arch/s390/kernel/idle.c index 0f9e53f0a068..4e09f126d4fc 100644 --- a/arch/s390/kernel/idle.c +++ b/arch/s390/kernel/idle.c @@ -34,6 +34,15 @@ void update_timer_idle(void) this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]); } =20 + /* + * This is a bit subtle: Forward last_update_clock so it excludes idle + * time. For correct steal time calculation in do_account_vtime() add + * passed wall time before idle_enter to steal_timer: + * During the passed wall time before idle_enter CPU time may have + * been accounted to system, hardirq, softirq, etc. lowcore fields. + * The accounted CPU times will be subtracted again from steal_timer + * when accumulated steal time is calculated in do_account_vtime(). + */ lc->steal_timer +=3D idle->clock_idle_enter - lc->last_update_clock; lc->last_update_clock =3D lc->int_clock; =20 --=20 2.51.0 From nobody Fri Apr 3 08:06:55 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 4873A33373E; Wed, 18 Feb 2026 14:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424423; cv=none; b=J4TwzZ1R7C0uJZAGOuI2Cr1jwa1/Q041Xda6xqgmvdgODAE0tbJ7PGlabkXKkcR7qegLaeXo3GB0H9eRKun0kcBIjhSiBs9y8S0VHuJDyr/Da8pC83P1fUZiCG/DycFGrRiEidoze/kWzdsZKiva4Yph5gXxBSWQnMGOsdyFgkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424423; c=relaxed/simple; bh=pjlpVVFr2BiD+ZGjXcef6bwSS9OyARlWhEoi/H8ud4E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n+fqfElAU1wjYsiArDu/oV79alRNdE5FeOARXRGkqpbzmGb6rICGrcXIe8twnHx7+dCWj02hasGEepvWKa2Yy5hJX3YkvqvYnw8Pq/o5lU2HXwzUl2H0/RbbaClntrDlArIg3ASxrsZVx1EnljKG/WPDkx2P8NGFG5HxOdFAoDE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=mXOyfXSS; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="mXOyfXSS" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61IAaoxZ3664605; Wed, 18 Feb 2026 14:20:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=99NMs+c04KPx5yiuM qz3d3ByldSAeBupn5aZrJ0YMhk=; b=mXOyfXSS3A0tVfLMm9o3rluDX8SlhViqf zL4qV8eKJccXAD23Nlx3UV6INgKPGhH1lIG9PCf+HH4QBeR/SJGELtwt5ZRTyBry 0jz50ZFM15KP1jadu68HMLMAd0IqXlBq88f/fH5b2NC7GclCQXW8v7oOclSdGLGT me1f/jx//0I0FNfk/DIvDAL8zcTTlDQFqG/TmNOS8sy+KJFmgCvnyRiZ6xSo9/7Z Nf03aQItUNS1Jfe43P7D1dhZp9gRo+puHFIS5FD1yh74MSPEVhGG/Wr05piWXXSP fpEMSDCWQ6wT/2zLTatEFUCT/FdWb7n1in80OWqzuHd7yJeCiy+7w== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4cajcjgf3w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61IDTt3L023899; Wed, 18 Feb 2026 14:20:17 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4ccb4583b3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:17 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61IEKEo831588614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Feb 2026 14:20:14 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E9BB22004E; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C756E2004B; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) From: Heiko Carstens To: Frederic Weisbecker , Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 4/9] s390/idle: Slightly optimize idle time accounting Date: Wed, 18 Feb 2026 15:20:07 +0100 Message-ID: <20260218142012.863464-5-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260218142012.863464-1-hca@linux.ibm.com> References: <20260218142012.863464-1-hca@linux.ibm.com> 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 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: NZoYxEUR4PZlpcFVrQmF0DXvNij8lqxd X-Authority-Analysis: v=2.4 cv=Md9hep/f c=1 sm=1 tr=0 ts=6995caa2 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=CLeX8EwWlJziYLe-d84A:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE4MDEyMCBTYWx0ZWRfX4uHih2QlOLd3 X8ay81Zva0xjTu0/wNYVrt2heXBKE1leesYD+WGRYhTf6PmT5jFT9iWuAkga6Zy6ngIOLymbniC wecs2zFoIFGOOGHZ63zrfZiDJ23padRDIeWOv3aWUdqWX6fiuUc6cGTbpwUNLO3LfazxNuUH74j 2R3s6DU8jWCV+nLTfXtjsEHZfAxT3peXJDDYwLVPip/qbibM7Na41YmF1Y0TUs/cDqE2nb4i8zY GloTzzeYLcABoluUL1DepeUbLLfobIKK/oPVW5aVfEennjxUKEYWD2C1j+I1HtQbHweMWtTut1+ QQoYZbZOb6nw+c8w8PreQ7N4W+854MNKnVTSxzzUZki0NGjcw4tf7/lnC58odY+DaYHzAKmBJco Er82rs3FPwys8EDAPTlql1nwrNQPFkulAojPtAozOV8KpqfSfFBRkU604nqxUtBZKNB71KMZodW 9hioro6ZlLu2cS5N31w== X-Proofpoint-GUID: NZoYxEUR4PZlpcFVrQmF0DXvNij8lqxd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-18_02,2026-02-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602180120 Content-Type: text/plain; charset="utf-8" Slightly optimize account_idle_time_irq() and update_timer_idle(): - Use fast single instruction __atomic64() primitives to update per cpu idle_time and idle_count, instead of READ_ONCE() / WRITE_ONCE() pairs - stcctm() is an inline assembly with a full memory barrier. This leads to a not necessary extra dereference of smp_cpu_mtid in update_timer_idle(). Avoid this and read smp_cpu_mtid into a variable - Use __this_cpu_add() instead of this_cpu_add() to avoid disabling / enabling of preemption several times in a loop in update_timer_idle(). Signed-off-by: Heiko Carstens Reviewed-by: Sven Schnelle --- arch/s390/kernel/idle.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/s390/kernel/idle.c b/arch/s390/kernel/idle.c index 4e09f126d4fc..627d82dd900e 100644 --- a/arch/s390/kernel/idle.c +++ b/arch/s390/kernel/idle.c @@ -26,12 +26,13 @@ void update_timer_idle(void) struct s390_idle_data *idle =3D this_cpu_ptr(&s390_idle); struct lowcore *lc =3D get_lowcore(); u64 cycles_new[8]; - int i; + int i, mtid; =20 - if (smp_cpu_mtid) { - stcctm(MT_DIAG, smp_cpu_mtid, cycles_new); - for (i =3D 0; i < smp_cpu_mtid; i++) - this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]); + mtid =3D smp_cpu_mtid; + if (mtid) { + stcctm(MT_DIAG, mtid, cycles_new); + for (i =3D 0; i < mtid; i++) + __this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]); } =20 /* @@ -58,8 +59,8 @@ void account_idle_time_irq(void) idle_time =3D get_lowcore()->int_clock - idle->clock_idle_enter; =20 /* Account time spent with enabled wait psw loaded as idle time. */ - WRITE_ONCE(idle->idle_time, READ_ONCE(idle->idle_time) + idle_time); - WRITE_ONCE(idle->idle_count, READ_ONCE(idle->idle_count) + 1); + __atomic64_add(idle_time, &idle->idle_time); + __atomic64_add_const(1, &idle->idle_count); account_idle_time(cputime_to_nsecs(idle_time)); } =20 --=20 2.51.0 From nobody Fri Apr 3 08:06:55 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 85DB9334C1B; Wed, 18 Feb 2026 14:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424424; cv=none; b=TjL0PUET/BzGN5PgXZCAg8LZHLDdCI5BLqWE3JG6MToXgmpNe5KEiExHqPVxtmnzi0Nsr/V/QamIA23ooMF22fcqnU8rzgDbgDtZP21fiRQVPF3F0ekX2P3YK8d7rRQjWoKNdXrQsNdewHFJI6B/WZSrIaBMM2i3OQj7in2qx3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424424; c=relaxed/simple; bh=ELh00Bb8DK9VFq+/7jcmPhT9fEC9OYKEPjUQyC9jYpY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RJoeCACYtzjQIFP6vdc7j+CAn7bfy63yoYD9taVo/9A3qhu4psY/au6PesL8zmVD1BYCey6aAv6+Ic+O2vEzkmKBWWG2U7dd5EzXxV/Az+9J0DShCenJZLP1Ye9aLu4GIRGp2bAqmeGqM/W/QsrH7p51I7vYKhTygD3nWBVYADo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=iF3UIkWk; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="iF3UIkWk" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61I6ucK62749445; Wed, 18 Feb 2026 14:20:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=gv/ovjkPaQXawhGo7 8gf1fT4H1MiqMsf1/WLRgUf5S8=; b=iF3UIkWk5G49Ngs66PAwejXoJiuU+Qu3R 0s65+KFb6/h5d8QRHdk3UB48xsRwKzebCpetjNsPb1XI9/dp1esdQ8utUlpUKQCC 3masj9+ekCC6P6dPJh9bYz7giHJaXqoFaLoQiaL/FKUc9ACoZUHG2HNsSc0bwmQo aMghFD4Wghnogtm19M0jj1RAO0joBpefUNmvZmEboJeCVFVhloiwokuLOOdDpAV5 WTexOQlmdFwq5aC4RnIz/xH4stM08Rug+eaJPWfe+Zb2cd19Xz9pOchQcTSAmLwQ CYBYaOQtq3KOsDFpqrqKw4j9byH7aTBp5i4+VKrBzSa6d9ZdnWv6A== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4caj4kgdt5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61IDbaqf001375; Wed, 18 Feb 2026 14:20:17 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4ccb2bg31p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:17 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61IEKEDW15204756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Feb 2026 14:20:14 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1946220040; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ED0BD2004F; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Feb 2026 14:20:13 +0000 (GMT) From: Heiko Carstens To: Frederic Weisbecker , Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 5/9] s390/idle: Inline update_timer_idle() Date: Wed, 18 Feb 2026 15:20:08 +0100 Message-ID: <20260218142012.863464-6-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260218142012.863464-1-hca@linux.ibm.com> References: <20260218142012.863464-1-hca@linux.ibm.com> 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 X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE4MDEyMCBTYWx0ZWRfX47uZ8K2yITQB nXwJEKhV/r/ZTN4eL03i13qR2qlSLksZkGwMs6p4iW9maL6XDHBp+01kW+RhU2yrwDPPI0hPc3j tSSoV63Itts1sYSl8Pmqb4tZeE4rHW+10uNda0m61PIWEZ2fpmANnGJZhhlnTQrMLj/8Fg5SzcR JEx9uD2QHigDqiREtl2HimIViHy8cstqC4uRb6ojqVwojh9QMt1ZnBxME4pf3Dg589MnxNOfehW liiA/+hHwVLSAU/zXr0EvoaDHMlNOQiMozAzYwoSlszfYjTGxlvv0MO6L1zwGSn++RLuaneiga4 StD51+sfn3QBAFoXFdjCee46UtvIxHMyoDE7ooAdmKsDVvrjMIZclBCshjKuOt4p98NM8VtBSoZ f74Tb6VeldTDa5glqfjY9i2BoBJY681WScq5UCxsVFR1B2DUzK4QvPYeGZLUHRUPba90kUCdVui wS/9osLr1sVsyp/6dnA== X-Proofpoint-ORIG-GUID: rfyObM6X41IXQG4u93dEXu8jR2DyLPjT X-Proofpoint-GUID: rfyObM6X41IXQG4u93dEXu8jR2DyLPjT X-Authority-Analysis: v=2.4 cv=M7hA6iws c=1 sm=1 tr=0 ts=6995caa2 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=tAyWV0bZ07vegb1XaBYA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-18_02,2026-02-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602180120 Content-Type: text/plain; charset="utf-8" Inline update_timer_idle() again to avoid an extra function call. This way the generated code is close to old assembler version again. Signed-off-by: Heiko Carstens Reviewed-by: Frederic Weisbecker Reviewed-by: Sven Schnelle --- arch/s390/include/asm/idle.h | 3 ++- arch/s390/include/asm/vtime.h | 34 ++++++++++++++++++++++++++++++++++ arch/s390/kernel/entry.h | 2 -- arch/s390/kernel/idle.c | 34 ++-------------------------------- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/arch/s390/include/asm/idle.h b/arch/s390/include/asm/idle.h index 133059d9a949..8c5aa7329461 100644 --- a/arch/s390/include/asm/idle.h +++ b/arch/s390/include/asm/idle.h @@ -19,10 +19,11 @@ struct s390_idle_data { unsigned long mt_cycles_enter[8]; }; =20 +DECLARE_PER_CPU(struct s390_idle_data, s390_idle); + extern struct device_attribute dev_attr_idle_count; extern struct device_attribute dev_attr_idle_time_us; =20 void psw_idle(struct s390_idle_data *data, unsigned long psw_mask); -void update_timer_idle(void); =20 #endif /* _S390_IDLE_H */ diff --git a/arch/s390/include/asm/vtime.h b/arch/s390/include/asm/vtime.h index 9d25fb35a042..b1db75d14e9d 100644 --- a/arch/s390/include/asm/vtime.h +++ b/arch/s390/include/asm/vtime.h @@ -2,6 +2,12 @@ #ifndef _S390_VTIME_H #define _S390_VTIME_H =20 +#include +#include +#include + +DECLARE_PER_CPU(u64, mt_cycles[8]); + static inline void update_timer_sys(void) { struct lowcore *lc =3D get_lowcore(); @@ -20,4 +26,32 @@ static inline void update_timer_mcck(void) lc->last_update_timer =3D lc->mcck_enter_timer; } =20 +static inline void update_timer_idle(void) +{ + struct s390_idle_data *idle =3D this_cpu_ptr(&s390_idle); + struct lowcore *lc =3D get_lowcore(); + u64 cycles_new[8]; + int i, mtid; + + mtid =3D smp_cpu_mtid; + if (mtid) { + stcctm(MT_DIAG, mtid, cycles_new); + for (i =3D 0; i < mtid; i++) + __this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]); + } + /* + * This is a bit subtle: Forward last_update_clock so it excludes idle + * time. For correct steal time calculation in do_account_vtime() add + * passed wall time before idle_enter to steal_timer: + * During the passed wall time before idle_enter CPU time may have + * been accounted to system, hardirq, softirq, etc. lowcore fields. + * The accounted CPU times will be subtracted again from steal_timer + * when accumulated steal time is calculated in do_account_vtime(). + */ + lc->steal_timer +=3D idle->clock_idle_enter - lc->last_update_clock; + lc->last_update_clock =3D lc->int_clock; + lc->system_timer +=3D lc->last_update_timer - idle->timer_idle_enter; + lc->last_update_timer =3D lc->sys_enter_timer; +} + #endif /* _S390_VTIME_H */ diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index dd55cc6bbc28..fb67b4abe68c 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h @@ -56,8 +56,6 @@ long sys_s390_pci_mmio_write(unsigned long, const void __= user *, size_t); long sys_s390_pci_mmio_read(unsigned long, void __user *, size_t); long sys_s390_sthyi(unsigned long function_code, void __user *buffer, u64 = __user *return_code, unsigned long flags); =20 -DECLARE_PER_CPU(u64, mt_cycles[8]); - unsigned long stack_alloc(void); void stack_free(unsigned long stack); =20 diff --git a/arch/s390/kernel/idle.c b/arch/s390/kernel/idle.c index 627d82dd900e..1f1b06b6b4ef 100644 --- a/arch/s390/kernel/idle.c +++ b/arch/s390/kernel/idle.c @@ -15,41 +15,11 @@ #include #include #include +#include #include #include -#include "entry.h" =20 -static DEFINE_PER_CPU(struct s390_idle_data, s390_idle); - -void update_timer_idle(void) -{ - struct s390_idle_data *idle =3D this_cpu_ptr(&s390_idle); - struct lowcore *lc =3D get_lowcore(); - u64 cycles_new[8]; - int i, mtid; - - mtid =3D smp_cpu_mtid; - if (mtid) { - stcctm(MT_DIAG, mtid, cycles_new); - for (i =3D 0; i < mtid; i++) - __this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]); - } - - /* - * This is a bit subtle: Forward last_update_clock so it excludes idle - * time. For correct steal time calculation in do_account_vtime() add - * passed wall time before idle_enter to steal_timer: - * During the passed wall time before idle_enter CPU time may have - * been accounted to system, hardirq, softirq, etc. lowcore fields. - * The accounted CPU times will be subtracted again from steal_timer - * when accumulated steal time is calculated in do_account_vtime(). - */ - lc->steal_timer +=3D idle->clock_idle_enter - lc->last_update_clock; - lc->last_update_clock =3D lc->int_clock; - - lc->system_timer +=3D lc->last_update_timer - idle->timer_idle_enter; - lc->last_update_timer =3D lc->sys_enter_timer; -} +DEFINE_PER_CPU(struct s390_idle_data, s390_idle); =20 void account_idle_time_irq(void) { --=20 2.51.0 From nobody Fri Apr 3 08:06:55 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 3572233372B; Wed, 18 Feb 2026 14:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424423; cv=none; b=dJZcZw92+ZhiPNKm6gC6tghrxn9S5azakXPhoW/nzahk8n6WBW2esj9e4PB4iwDUJtq3HStea63T2zp4MfkdVsVCd8E/bdjXXEKPPa3l8rnxjCQwgftQ4nkmCKg414RyZnYhgZLi+cMYFV1pJgbsg9Fyl/cTv/N2rIlK0zZ3QXI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424423; c=relaxed/simple; bh=fdylgc7cPmNb6dp32O0Wt/EKQhM62YSOB21zcp6moCk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=On1kVzkGSCeD8vfxq5oxEZrIkqHqw7U6ODWrhbF0+yFDbQfKNg4hhY4+RlzxDtSD3xxE2KXE8sqOLroLPlaJ1RewuwnnRXNHOtWpL/Dm9gqW/ncfL88L1MO4qp0xkqwL/iNU7GPGw4E0szQEzcodH+JBo007/9RCzj/SPCaQ3+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=on4jb2XZ; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="on4jb2XZ" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61I7xiLa3527333; Wed, 18 Feb 2026 14:20:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=5+8vwqEQt32wTGT4C 2XxuWjR9AsCRt1IZgG9BstDWCw=; b=on4jb2XZt1fK0qhjZk+AMKTCUAK0x8XZh 0TG8qxJdyiUea73vVzIYCbJqSmt+lgbXXBroTIDKaIXcGTUPhWp8PKjhDCFbtg4n t6rwIXPw96FbKJUSijOmicr1Vzc2wUv1pjDp/xX6Hqo83lf252t09WUmuJNdEGNj LoYA2M8bOSHQAeFDE3HJbPnuJAZac++zsZsyIBPcBCleXcD27oNmJdBA8tkD4Sim q+bGWbN9Rof0rEjMSVPYuSFOsbAXWingL16NxJ1nuI7qMufzO3kEMNsohH8qp6Re RGu/nqgFh5HqWG/0vUKz/Wm8CQpwoHcTUJjH2y8YxVQQqGg+4XCsA== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4cajcjgf3y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61IDZWvJ015846; Wed, 18 Feb 2026 14:20:18 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4ccb4583dy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61IEKEvV15204758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Feb 2026 14:20:14 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DE2F2004B; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1E06920043; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) From: Heiko Carstens To: Frederic Weisbecker , Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 6/9] s390/irq/idle: Remove psw bits early Date: Wed, 18 Feb 2026 15:20:09 +0100 Message-ID: <20260218142012.863464-7-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260218142012.863464-1-hca@linux.ibm.com> References: <20260218142012.863464-1-hca@linux.ibm.com> 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 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: JbEqZMjVj7UpCedg6npI91aB1PN-nyQQ X-Authority-Analysis: v=2.4 cv=Md9hep/f c=1 sm=1 tr=0 ts=6995caa2 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=eQc6JQ773LVZH5CQlr8A:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE4MDEyMCBTYWx0ZWRfXz13rJpevYK6n ugc+Iyk7MEY718fc2+4MaqU5mqFPUt/Z3sfTTBC88vjaRACOTfZclZJvRzEZ4poA8nIEDfjRnto yrUhNRp/dg95o4MYCp8O0azC/nTp9faSNj2LChApxwh7/sl3vjRJ9HTOLnwstGOh3JjXmgX7EPP MN+s8MPQ7T9SQ1+y7X9+Cli231YJK9fb+ld50ue5KTTU2CKfhZFKyH91yV50BecLvmkbNGrJh62 Yv98E73eBWnoTRBF5P+CraHS2V6NaaZ/qkWo/+OEK6aXUmVtnAawblHVSXxsTQGloNA5jrE0Ava Ao7DFiyi26leWRoEob4jR/+v0DErahiWanyWRbp3WIxnniE/4MBLfcege7O5Ny/BRo26vJqer1W Pk3Oc1WCreEhaBYFcbx219yjysIT6ySJuhnaSgmTgMmDIKG7V9BeJsDNgVLUSo/Ga7Tj+0KmY/I VEXNr4JFreaBUrriSDg== X-Proofpoint-GUID: JbEqZMjVj7UpCedg6npI91aB1PN-nyQQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-18_02,2026-02-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602180120 Content-Type: text/plain; charset="utf-8" Remove wait, io, external interrupt bits early in do_io_irq()/do_ext_irq() when previous context was idle. This saves one conditional branch and is closer to the original old assembly code. Signed-off-by: Heiko Carstens Reviewed-by: Sven Schnelle --- arch/s390/kernel/irq.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index 080e9285b337..084919a04e04 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c @@ -147,8 +147,10 @@ void noinstr do_io_irq(struct pt_regs *regs) bool from_idle; =20 from_idle =3D test_and_clear_cpu_flag(CIF_ENABLED_WAIT); - if (from_idle) + if (from_idle) { update_timer_idle(); + regs->psw.mask &=3D ~(PSW_MASK_EXT | PSW_MASK_IO | PSW_MASK_WAIT); + } =20 irq_enter_rcu(); =20 @@ -174,9 +176,6 @@ void noinstr do_io_irq(struct pt_regs *regs) =20 set_irq_regs(old_regs); irqentry_exit(regs, state); - - if (from_idle) - regs->psw.mask &=3D ~(PSW_MASK_EXT | PSW_MASK_IO | PSW_MASK_WAIT); } =20 void noinstr do_ext_irq(struct pt_regs *regs) @@ -186,8 +185,10 @@ void noinstr do_ext_irq(struct pt_regs *regs) bool from_idle; =20 from_idle =3D test_and_clear_cpu_flag(CIF_ENABLED_WAIT); - if (from_idle) + if (from_idle) { update_timer_idle(); + regs->psw.mask &=3D ~(PSW_MASK_EXT | PSW_MASK_IO | PSW_MASK_WAIT); + } =20 irq_enter_rcu(); =20 @@ -209,9 +210,6 @@ void noinstr do_ext_irq(struct pt_regs *regs) irq_exit_rcu(); set_irq_regs(old_regs); irqentry_exit(regs, state); - - if (from_idle) - regs->psw.mask &=3D ~(PSW_MASK_EXT | PSW_MASK_IO | PSW_MASK_WAIT); } =20 static void show_msi_interrupt(struct seq_file *p, int irq) --=20 2.51.0 From nobody Fri Apr 3 08:06:55 2026 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 E303333343A; Wed, 18 Feb 2026 14:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424423; cv=none; b=T1Tjk/MCX0RqNp1Md+qn0Q0y4EyQ7yNYqaUDEkRI+Kio5z59Ho1Al09NlspGN+1dWGs5s1N3ICDn/M/SIaACTeVx9BqnNS+MtsycSZ+F9AWtB6k3VFthAbg2JjWDGAKqgrsXUoNj4D00xZP9ytF+Ntz8GIF/NqG0GDRRosxZpwA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424423; c=relaxed/simple; bh=3EyI4qwTX5gkLNjfJL1ssVGr1xtBB/PQuIexvj9nocc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RpU+0Wd+i2kRVO9rGVcZi3R478Etc2sw69ouGOADG3A9g0ajKR9H3L/ea2ikEwkcXxzDVhDH+g6zGlLpUUdDW02Fpzqh3OrE0WU7i4cNTbHUVb6MjAxxadyoRFR7B4k4S3ibgPL9wMtBdYQROnEoLaLOEmLAyEPwHW4BWRYQiok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=YyfOOxAE; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="YyfOOxAE" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61IDjaFJ1915831; Wed, 18 Feb 2026 14:20:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=pOJ/wADkwVehOiYSV j5J1q4Q/2STW8GSGxc2ha3bLOU=; b=YyfOOxAEA9BW2IqUZ352jRuR+adroPcP9 BVsvdLgdO6axAghjZ6o0H98frwOwpFNMIImJrw6/JuaqLBrK927H0wW3mliF5xt8 HhysUN/xW3VxzGTUKvi1dAD731JYamDplaLEGGCU+iAwQ7JPdpQnSUWIYOrq/2mF hTXSqQTsZK98Ph9L0H5Ol/XoivMXV8QgQSzZ7aGu8fAanEkgT8agwEd6sJcq0ArE 7F4snbkKADWNxNPAAS5hTc0rnra+fX5+n1hqJu7gbV4e8bsQJcAeq/DeAWh5XdFY GCMFOFJQ2ikpTSjopMMJ2MiF1hegShZVv+MDss+SjjMGm/zXwgifw== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4caj6ushd3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61IDUDjn001381; Wed, 18 Feb 2026 14:20:18 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4ccb2bg31q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:17 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61IEKECG15204760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Feb 2026 14:20:14 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 643DE20043; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 43C9D20040; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) From: Heiko Carstens To: Frederic Weisbecker , Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 7/9] s390/vtime: Use __this_cpu_read() / get rid of READ_ONCE() Date: Wed, 18 Feb 2026 15:20:10 +0100 Message-ID: <20260218142012.863464-8-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260218142012.863464-1-hca@linux.ibm.com> References: <20260218142012.863464-1-hca@linux.ibm.com> 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 X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=E+/AZKdl c=1 sm=1 tr=0 ts=6995caa2 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=U-gbc-jHn7uRwbEksAQA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE4MDEyMCBTYWx0ZWRfXwVmiwHADooC5 UUS9zNXESL2NXS/evT7xDmqeARf6DN/OpcvRpfz4VlmrQHJml71FvsBE7o6+eZ9TQeevPYhvZ9d p24wsA2rKMFtJbAg1MM1HIZ1gsDOROb89ft1CNwBZTM3/qU5LNYyBe7XFOKhEgWVxCigqAwVA99 C0m0irldVFC3s8Wein8bAc0R+RAhDLk7tFnYKypFpgRZ0+pjTv40WzS/gPNiOJZJYiNtc11zEhl J4aGVLu1QwZsQJbxBAS5+XW6fTBOKcFIafuSCEynDnY04JlYxz+TLyfhGa7G+xbWRyQP7FSdHiT QimbF4dKtCVEOy4Qd8+5wW/kNlqewr3Sz30kSYbOXfWpERhTnwtFVTQmGEl2jBV0BrpxsgOm0wG wTUxI0Vd2+yVCdFjNn/gp0rP+DreFWd02VLhyvHFeptxfrcht0b2fsFLucMr8up4u3Zic+4ui0Z AthhQyhritcJ9svCncA== X-Proofpoint-ORIG-GUID: ef6QU2xgt0J1G4jBBOP85CrnfxCZuCvC X-Proofpoint-GUID: ef6QU2xgt0J1G4jBBOP85CrnfxCZuCvC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-18_02,2026-02-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 spamscore=0 clxscore=1015 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602180120 Content-Type: text/plain; charset="utf-8" do_account_vtime() runs always with interrupts disabled, therefore use __this_cpu_read() instead of this_cpu_read() to get rid of a pointless preempt_disable() / preempt_enable() pair. Also there are no concurrent writers to the cpu time accounting fields in lowcore. Therefore get rid of READ_ONCE() usages. Signed-off-by: Heiko Carstens Reviewed-by: Frederic Weisbecker Reviewed-by: Sven Schnelle --- arch/s390/kernel/vtime.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 122d30b10440..4111ff4d727c 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -137,23 +137,16 @@ static int do_account_vtime(struct task_struct *tsk) lc->system_timer +=3D timer; =20 /* Update MT utilization calculation */ - if (smp_cpu_mtid && - time_after64(jiffies_64, this_cpu_read(mt_scaling_jiffies))) + if (smp_cpu_mtid && time_after64(jiffies_64, __this_cpu_read(mt_scaling_j= iffies))) update_mt_scaling(); =20 /* Calculate cputime delta */ - user =3D update_tsk_timer(&tsk->thread.user_timer, - READ_ONCE(lc->user_timer)); - guest =3D update_tsk_timer(&tsk->thread.guest_timer, - READ_ONCE(lc->guest_timer)); - system =3D update_tsk_timer(&tsk->thread.system_timer, - READ_ONCE(lc->system_timer)); - hardirq =3D update_tsk_timer(&tsk->thread.hardirq_timer, - READ_ONCE(lc->hardirq_timer)); - softirq =3D update_tsk_timer(&tsk->thread.softirq_timer, - READ_ONCE(lc->softirq_timer)); - lc->steal_timer +=3D - clock - user - guest - system - hardirq - softirq; + user =3D update_tsk_timer(&tsk->thread.user_timer, lc->user_timer); + guest =3D update_tsk_timer(&tsk->thread.guest_timer, lc->guest_timer); + system =3D update_tsk_timer(&tsk->thread.system_timer, lc->system_timer); + hardirq =3D update_tsk_timer(&tsk->thread.hardirq_timer, lc->hardirq_time= r); + softirq =3D update_tsk_timer(&tsk->thread.softirq_timer, lc->softirq_time= r); + lc->steal_timer +=3D clock - user - guest - system - hardirq - softirq; =20 /* Push account value */ if (user) { --=20 2.51.0 From nobody Fri Apr 3 08:06:55 2026 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 83F3D334368; Wed, 18 Feb 2026 14:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424424; cv=none; b=BZU4xuTwoSomDaOmPLCZ6uvQNxZUKPx909Kq4xiRyNDw3ITyznJ3oSI93wpZZPL3lcxSjeixBvCUiDO1BSWyOOQTn7L/0y6XmXVSQBlcIJyfmSD+JjC2TW3wBFrOaHTDu/rsOMifop/CYI7rgxke+pyB4lhNsevchp7jlQdVgYs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424424; c=relaxed/simple; bh=pxlImbyIG7z3s+moWkb9YzYfxIqC6b8tWTVhzecud0U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fnu2coHclTSTMFLxyYprd8kOEWXNay59WoSbyXuNYV8HMnCgYyMSkL1U3W8vF0Y/RIAWITZO+GgjAYIuA+11+40i/2dlnygU9SyXvpua7LRhT4uHoxryGNeOW9+fL2fz3vZTgn7Zup81aqK3qBgT4feQ7RzVybnjTsuFTq/OCfU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=GcmUJHVq; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="GcmUJHVq" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61I1nEVF1674735; Wed, 18 Feb 2026 14:20:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=JiiQ9+9F3+wHfmwhc QzO4Bd3k8oCoI/UAdCTHe4EzUw=; b=GcmUJHVq3Qg6AlYwEmwuvXmpi+ThML82L 6srwKzGVkAokVkVv5Fo8sry75f2JRnOdXWFgNtai8n7688RoI9TqYWaaLZqWDau9 1JiV8m9EY/2Da/fcf9etvhLgfU/3hCdDqVSI59jd39mbrAuk4yXvEgH6FqNZGZUE T5idhp+d5B4gWwV4lkgCfEBc3bfgsq5p+Q4fpe318sNQ/ZnNFi2PsaVIzo9MVS2f 07f6/PrMWHmlA14cJBTMDY20aVQIhdfKMMxCfB+OesFBfsq6fOKQQtCcLCRNtXhF dMPHzlCTKAJaeminygqbN7PPWnI83GCVXq1URRFAD0i6opeEVHbWQ== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4caj6s1h1r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:19 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61ID17L0015721; Wed, 18 Feb 2026 14:20:18 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4ccb4583e0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61IEKEg115204762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Feb 2026 14:20:14 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9352C20040; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 69B502004B; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) From: Heiko Carstens To: Frederic Weisbecker , Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 8/9] s390/vtime: Use lockdep_assert_irqs_disabled() instead of BUG_ON() Date: Wed, 18 Feb 2026 15:20:11 +0100 Message-ID: <20260218142012.863464-9-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260218142012.863464-1-hca@linux.ibm.com> References: <20260218142012.863464-1-hca@linux.ibm.com> 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 X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=dvvWylg4 c=1 sm=1 tr=0 ts=6995caa3 cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=Kc6-FovL7Q0bcOmGwqcA:9 X-Proofpoint-GUID: R_WFhomB0FnOKeopz_wzre5swklkWUdN X-Proofpoint-ORIG-GUID: R_WFhomB0FnOKeopz_wzre5swklkWUdN X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE4MDEyMCBTYWx0ZWRfX/ACCg9fG0mcZ tmAyu6tM85pEC9VQxdpmIu3s400NjAOsaCvGNEvYQFW9/bUeb6wupgq6hQ3eJ6RKrWk9A2yWwjU mH9fbgNrri1zcVrdkI+1Z+GYVXLlGG0BqVH/PdNVKDVBGq4RBuf0xIthDewChD9UZ8hA7cz26rO zvddRshSldY3frq709maErVhN1yli8ZgfxJc4U20iAaHrk7xUjbS5xVM1SJpJ+/4KMs3Sj9rRRx RGmE1rXrlkpyVU7qHDqmhkx5KPHNfSG2rkLEdRmdQx8xReGVcqZF0C1Xzd1mUylLEEbjru0XsVJ Je5N51k+rq8uZTrkj8B+HcxPt7dW8K+fmk/+oSi9haDkM0CIGhdYRhP2ztsJ7gWGHevm+OWazJe VkBy6dgijyBKHOW7BioJr54Vk1wrqtkBA4R3sineiBXAHxRtt425uWB/66FuDobxpSmV7NVmCIk z+3HgUz/FT08iPIyxog== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-18_02,2026-02-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602180120 Content-Type: text/plain; charset="utf-8" Use lockdep_assert_irqs_disabled() instead of BUG_ON(). This avoids crashing the kernel, and generates better code if CONFIG_PROVE_LOCKING is disabled. Signed-off-by: Heiko Carstens Reviewed-by: Frederic Weisbecker Reviewed-by: Sven Schnelle --- arch/s390/kernel/vtime.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 4111ff4d727c..bf48744d0912 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -48,8 +48,7 @@ static inline void set_vtimer(u64 expires) =20 static inline int virt_timer_forward(u64 elapsed) { - BUG_ON(!irqs_disabled()); - + lockdep_assert_irqs_disabled(); if (list_empty(&virt_timer_list)) return 0; elapsed =3D atomic64_add_return(elapsed, &virt_timer_elapsed); --=20 2.51.0 From nobody Fri Apr 3 08:06:55 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 55BAA33375A; Wed, 18 Feb 2026 14:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424423; cv=none; b=csg1NAunbnzbD2XhB5X0yZ+VJfmmgcpufRRhCvPneV9r2KP7xTfw7dIf1WTO0tA2z3Q8iisVeDowCj7PkXjsnNU07rf4p65vYYbmH4occ0hJU8A9boEiC+LQaAizRxBMYky/biR8WpA43vTK0BN2UVVDP1iWoACQT6I41DIKYNw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771424423; c=relaxed/simple; bh=AzO8qn5Es8351c4DVXFkVW86beJOaZUPsL+q9ceLsCs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z65m8XdHR/NM5r3T6Lp0JLAU1g5r6xCkmlhMdMpaZWHDrsXIcljO+fNaYpZXLB9fHSlKaZhA9unXIfP39GT3dZKHi/qVt9w3SLc6MgqWHYw7rUgFQQ+sfM/rNmKLXiEE5DZKQtQ489RKzpu0Maix6U+kTZGrA+xdFia/r1RIpqI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=Cr4xg/TE; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Cr4xg/TE" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61ID0DbX3334363; Wed, 18 Feb 2026 14:20:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=yeGWdE8uNY5P7s+vQ uu05pHnoMk6lEZ85TtCMCLs57E=; b=Cr4xg/TErbyl9aY6Z7xo4kADJVKwd6JYz HPy1N0/X5T+N7f3WwLgmXD4Gbm0XPDkz7MeQQ//aQ2KqD8U7aCWrGZeSzrNcg18B VjMkc9b68ki9lODhU3UeNFhHWIaoyUsXWloAHgamphheaDag8qGEZThOLK+tS740 cZTC1IydKXVQv0xT850eEzB6AE5dg2sYN8WyGyb/s/sfM+EJ/lZpVvU4m0mwYLIU D5Wt4NQ+4GB0DwJJSxi4WDIbAXD6Qv/3jAKFxP6Z9aNLSQTINU/ktyXFbGh770OV XTPQ8y2VI1Q4pcu5E8E9Hc+oYsoHLZw+3ycPQS5IZ7EQpyYKSXE/A== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4caj4kgdt9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:19 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61IDIE42017891; Wed, 18 Feb 2026 14:20:18 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4ccb28g3cy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Feb 2026 14:20:18 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61IEKEYL15204764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Feb 2026 14:20:14 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1C1220040; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9857320043; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Feb 2026 14:20:14 +0000 (GMT) From: Heiko Carstens To: Frederic Weisbecker , Alexander Gordeev , Sven Schnelle , Vasily Gorbik , Christian Borntraeger Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 9/9] s390/idle: Remove psw_idle() prototype Date: Wed, 18 Feb 2026 15:20:12 +0100 Message-ID: <20260218142012.863464-10-hca@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260218142012.863464-1-hca@linux.ibm.com> References: <20260218142012.863464-1-hca@linux.ibm.com> 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 X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjE4MDEyMCBTYWx0ZWRfX+yihf1auqkZm wlfxr8zlV10gnStpMkxy2+QPp9K3PDMxKgH1GO/6QncClz404x4TbGsP3IdNbq/JMOLm/kuXVdY AJpkZBCy7kbS/5goa2lciipu9ompefk1pNMQFGSZwIWBTGDdYD/mNKvJuP56FUsoCfLul9g9heX oqm4Jm27PBnY5LAJsrhoyjdkQArpiZyIZg67UnMoi/VM/OE6BCJsx4CdA+n4OoWenyOLj5r1rsS ENM2G8eXUv4CyJY4fFOVOBhBvuo2jHQEUL/bVaDGlnFy3ErdbGXJQYlJsZlMYQiw8BWeg1xRxRy xBfwWBsUzDdmPcmu8jcM5Sz+BBSIt1po3IwCPyrjGWPJz1noHYCCO9fwWe9EW6dnq28icK4b+t7 n5HPMmd3uC1rswn+LnD71ErJpiFCXlddGbXQ6cvDp0+HNmGWjAo0fg2z1Qa3ks0xxDjx3NFTU7K uXh0dnNV0dOs3qwK6Gw== X-Proofpoint-ORIG-GUID: BUG1jwINBmkA0QlvIMQj6puRGX8UCm1Z X-Proofpoint-GUID: BUG1jwINBmkA0QlvIMQj6puRGX8UCm1Z X-Authority-Analysis: v=2.4 cv=M7hA6iws c=1 sm=1 tr=0 ts=6995caa3 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VnNF1IyMAAAA:8 a=aUtqUClxCCh-7yMeKAEA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-18_02,2026-02-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602180120 Content-Type: text/plain; charset="utf-8" psw_idle() does not exist anymore. Remove its prototype. Signed-off-by: Heiko Carstens Reviewed-by: Frederic Weisbecker Reviewed-by: Sven Schnelle --- arch/s390/include/asm/idle.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/s390/include/asm/idle.h b/arch/s390/include/asm/idle.h index 8c5aa7329461..32536ee34aa0 100644 --- a/arch/s390/include/asm/idle.h +++ b/arch/s390/include/asm/idle.h @@ -24,6 +24,4 @@ DECLARE_PER_CPU(struct s390_idle_data, s390_idle); extern struct device_attribute dev_attr_idle_count; extern struct device_attribute dev_attr_idle_time_us; =20 -void psw_idle(struct s390_idle_data *data, unsigned long psw_mask); - #endif /* _S390_IDLE_H */ --=20 2.51.0