Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1124146pxu; Wed, 2 Dec 2020 11:38:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyO9Z9QKttkFJjt5TxpGfsM/Pr/AYBXpV7G/sqK73fF5DxvnQfQ5bwhyrMWZ9kSLhMMsyRd X-Received: by 2002:a50:d54a:: with SMTP id f10mr1582364edj.356.1606937921868; Wed, 02 Dec 2020 11:38:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606937921; cv=none; d=google.com; s=arc-20160816; b=FGYEAP3RgvVqG0l5IINpuU4kJ1dYvWZWsVaglB6yzQ+1+Kwl+zhLwH3F0jIFXRwp51 rm4ryzx1rszrshWj6DFJl7JzbYhvjJXyKy0rkVYJUuQqRbjap19kF0nNQSaDJU+IH1kL 7TWBl3b/Hfb4XC6qwPKRAwbJ6mjO12uu24hgEzKAFjOSIPN2utyr9/I9RHcEa+wQuT7+ aQ58FiXi7SRXzgR2bEu0+lQAWj/tGmbw6UNzT4WJ31ju4avRlt4JZdzjc0Tx7rpYt9vD GgMomISmbcX7l+H6yIXFu0SaoW3cGqZ0PgXrWGCiYWcACHwjzm3eC/8s6QQlYzVVLyIB m4lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=XIVFvOaZOXM90r2r6ru3t6GuWG7i5inRBsG/IHcgvTA=; b=niOeluS8rrG0U1sQ1BXZ6yS7E/MzeqU5WPdWyoYZMTp+vjZxYyAgxKuq3/4nVkVAs/ HL3AL1m4p3OGz6jcNN8D/MpZbHFv0k5RDgKDxwlPCtMLwuLViM8AoD/jNuf7XiMVy7GK Yh0I4vK+sh4LFyjltfBqCBzIXc55hwUxM7ffHxSCnwt0xVinpG57nRW6/+Rdl2hQb/g7 SsTEIj/TA6ABCMty7Vc0Ca+M731OmiMb3sNV+38B869Sdw3yHNDaGlw3nhblL2r4W3ol 2B9nW5Z/KD0HpePjDm4NApNN10ausbd69Ikj9JYxcYtT/J21R7L74kN6EQzv9vJkMImk JfOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=NdxmUMNu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm7si577397edb.185.2020.12.02.11.38.18; Wed, 02 Dec 2020 11:38:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=NdxmUMNu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731116AbgLBTfL (ORCPT + 99 others); Wed, 2 Dec 2020 14:35:11 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:9494 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731039AbgLBTfL (ORCPT ); Wed, 2 Dec 2020 14:35:11 -0500 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B2JXS7R053552; Wed, 2 Dec 2020 14:34:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=XIVFvOaZOXM90r2r6ru3t6GuWG7i5inRBsG/IHcgvTA=; b=NdxmUMNuKSICGzjCl6ENG48Z++L/i3lV5tj1hSWIyUeF+F9Q5dNmP2hTKFUStLKIOxL2 k1urKfrxK4Fya6oTYeD8F2XkputgNzR+XNuiT150ZPzCFuGryKEvs4tVwTSmpnYAzlLe yOMVL+E7sQJbowFIKf8H9ZCXULzTyy09GD2A9VA10XzM7iSyyuKgi9ggGlXaqR0ClAA0 raLJmXkc7L1Ef0JzGEMO8Y9gcvb7b3LXrEbCX9+N7HwgGDDYV0EJAT61q7cQ2HUz1lgC SA/iPGmjvjfpFLdn1cH7YO39IHLzsmfMRz5LJkN8cDzksqqhQR1DH8kk0AVLQWCgdws3 sA== Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 355sr627ck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2020 14:34:09 -0500 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0B2JVq4w027011; Wed, 2 Dec 2020 19:34:05 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04ams.nl.ibm.com with ESMTP id 35693xgdak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2020 19:34:05 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0B2JY2MH2228908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Dec 2020 19:34:02 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A298C5204E; Wed, 2 Dec 2020 19:34:02 +0000 (GMT) Received: from oc7455500831.ibm.com (unknown [9.171.9.70]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id AA91B52051; Wed, 2 Dec 2020 19:34:01 +0000 (GMT) Subject: Re: [PATCH 2/5] s390/vtime: Use the generic IRQ entry accounting To: Frederic Weisbecker , Thomas Gleixner , Peter Zijlstra Cc: LKML , Tony Luck , Vasily Gorbik , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Fenghua Yu , Heiko Carstens References: <20201202115732.27827-1-frederic@kernel.org> <20201202115732.27827-3-frederic@kernel.org> From: Christian Borntraeger Message-ID: Date: Wed, 2 Dec 2020 20:34:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201202115732.27827-3-frederic@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-12-02_12:2020-11-30,2020-12-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 phishscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012020115 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.12.20 12:57, Frederic Weisbecker wrote: > s390 has its own version of IRQ entry accounting because it doesn't > account the idle time the same way the other architectures do. Only > the actual idle sleep time is accounted as idle time, the rest of the > idle task execution is accounted as system time. > > Make the generic IRQ entry accounting aware of architectures that have > their own way of accounting idle time and convert s390 to use it. > > This prepares s390 to get involved in further consolidations of IRQ > time accounting. > > Signed-off-by: Frederic Weisbecker > Cc: Peter Zijlstra > Cc: Tony Luck > Cc: Fenghua Yu > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Heiko Carstens > Cc: Vasily Gorbik > Cc: Christian Borntraeger As far as I can tel,l this patch should be a no-op for s390 function-wise. Acked-by: Christian Borntraeger > --- > arch/Kconfig | 7 ++++++- > arch/s390/Kconfig | 1 + > arch/s390/include/asm/vtime.h | 1 - > arch/s390/kernel/vtime.c | 4 ---- > kernel/sched/cputime.c | 13 ++----------- > 5 files changed, 9 insertions(+), 17 deletions(-) > > diff --git a/arch/Kconfig b/arch/Kconfig > index 56b6ccc0e32d..0f151b49c7b7 100644 > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -627,6 +627,12 @@ config HAVE_TIF_NOHZ > config HAVE_VIRT_CPU_ACCOUNTING > bool > > +config HAVE_VIRT_CPU_ACCOUNTING_IDLE > + bool > + help > + Architecture has its own way to account idle CPU time and therefore > + doesn't implement vtime_account_idle(). > + > config ARCH_HAS_SCALED_CPUTIME > bool > > @@ -641,7 +647,6 @@ config HAVE_VIRT_CPU_ACCOUNTING_GEN > some 32-bit arches may require multiple accesses, so proper > locking is needed to protect against concurrent accesses. > > - > config HAVE_IRQ_TIME_ACCOUNTING > bool > help > diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig > index 4a2a12be04c9..6f1fdcd3b5db 100644 > --- a/arch/s390/Kconfig > +++ b/arch/s390/Kconfig > @@ -181,6 +181,7 @@ config S390 > select HAVE_RSEQ > select HAVE_SYSCALL_TRACEPOINTS > select HAVE_VIRT_CPU_ACCOUNTING > + select HAVE_VIRT_CPU_ACCOUNTING_IDLE > select IOMMU_HELPER if PCI > select IOMMU_SUPPORT if PCI > select MODULES_USE_ELF_RELA > diff --git a/arch/s390/include/asm/vtime.h b/arch/s390/include/asm/vtime.h > index 3622d4ebc73a..fac6a67988eb 100644 > --- a/arch/s390/include/asm/vtime.h > +++ b/arch/s390/include/asm/vtime.h > @@ -2,7 +2,6 @@ > #ifndef _S390_VTIME_H > #define _S390_VTIME_H > > -#define __ARCH_HAS_VTIME_ACCOUNT > #define __ARCH_HAS_VTIME_TASK_SWITCH > > #endif /* _S390_VTIME_H */ > diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c > index f9f2a11958a5..ebd8e5655789 100644 > --- a/arch/s390/kernel/vtime.c > +++ b/arch/s390/kernel/vtime.c > @@ -247,10 +247,6 @@ void vtime_account_kernel(struct task_struct *tsk) > } > EXPORT_SYMBOL_GPL(vtime_account_kernel); > > -void vtime_account_irq_enter(struct task_struct *tsk) > -__attribute__((alias("vtime_account_kernel"))); > - > - > /* > * Sorted add to a list. List is linear searched until first bigger > * element is found. > diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c > index 61ce9f9bf0a3..2783162542b1 100644 > --- a/kernel/sched/cputime.c > +++ b/kernel/sched/cputime.c > @@ -417,23 +417,14 @@ void vtime_task_switch(struct task_struct *prev) > } > # endif > > -/* > - * Archs that account the whole time spent in the idle task > - * (outside irq) as idle time can rely on this and just implement > - * vtime_account_kernel() and vtime_account_idle(). Archs that > - * have other meaning of the idle time (s390 only includes the > - * time spent by the CPU when it's in low power mode) must override > - * vtime_account(). > - */ > -#ifndef __ARCH_HAS_VTIME_ACCOUNT > void vtime_account_irq_enter(struct task_struct *tsk) > { > - if (!in_interrupt() && is_idle_task(tsk)) > + if (!IS_ENABLED(CONFIG_HAVE_VIRT_CPU_ACCOUNTING_IDLE) && > + !in_interrupt() && is_idle_task(tsk)) > vtime_account_idle(tsk); > else > vtime_account_kernel(tsk); > } > -#endif /* __ARCH_HAS_VTIME_ACCOUNT */ > > void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev, > u64 *ut, u64 *st) >