Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5447507rwj; Wed, 21 Dec 2022 02:49:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXs2fj7Iq7ary4GOLynt7AhnVfcE21usIdsfkMR1dDzYigirKs9asnNaYPPuBghxetUGt5mJ X-Received: by 2002:a05:6a21:6da2:b0:b2:56ba:63ee with SMTP id wl34-20020a056a216da200b000b256ba63eemr2427826pzb.24.1671619779629; Wed, 21 Dec 2022 02:49:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671619779; cv=none; d=google.com; s=arc-20160816; b=SaJKIVUB3ikLkAWDaZded0RrwIm7ck4EEoRYRCYu4MoyU93VXmWCkdUHWQUyjcf85a lktcIyhp4hCylfcUv9HPe0/5p2/O2IjlEMeXfYFDr5eflpbah8D/LaGgomytA8iiNDZY jHlPD8eWqSb/SsLGWO2IG/PdjdZZrDJr33rVW/TWVsfIzB3RvyEQzB7VqmhX27f9CrXB ypkjTJb01n8iOt/N6kSXgDXjoqOxx3ljVTMD1E1afvjTedbXPal+T5WHeu/ajTXWtSAx mkeYGsj3xmo4iPOvFp8kOuVntOprV5Ie0arcM1erdTHMO7B5rUvqZgL6sTOi9J5M7xD2 L6gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I3FWXRhkqI86UYIbfzkI889goztF0SJR3RpDIZtOdTA=; b=EuZNdGh1sPC1zK+VZCKwLKw75OaJFBtje+YzlzZCcIsN2J1DzcSwjcPl8UEREz+8Yh QDJElLX+T5Kt195F5Nfcxy3UdcZGJ1MGkhS3ixqXK68iEM8ehTM7HfbtLVFDYhLyQGV/ bAZLqrkDYTyvbHQPK65Z64exWiL5BGgz1VPUz7zVyVffvxi/yxXyj2gkf8xcA4o5DB0s NMcf9mNCeS64u5UP43p2H8Omu88RCAQS5xwBY4B/AzT2LBvXYEsYxRPpXjctN2lR0FCB 2l5R+e+WhiX9/4f12Yd0/PqPqYue3WXhPjI95hbk8U6/rbzljE2HIrBDQCE7tFoFmBQK fo3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=pHgTzbOy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 185-20020a6301c2000000b00491f8d42b05si2174178pgb.369.2022.12.21.02.49.30; Wed, 21 Dec 2022 02:49:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=pHgTzbOy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234636AbiLUKbY (ORCPT + 70 others); Wed, 21 Dec 2022 05:31:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234643AbiLUKaM (ORCPT ); Wed, 21 Dec 2022 05:30:12 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02900140EE; Wed, 21 Dec 2022 02:27:15 -0800 (PST) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BLACXDN025919; Wed, 21 Dec 2022 10:24:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=I3FWXRhkqI86UYIbfzkI889goztF0SJR3RpDIZtOdTA=; b=pHgTzbOy9Hu37ogtHdb6eCqaSqwKeatYtwFw1rxgft57CJX4PcDLM5vNB8LqGLs80lpK vBw7yNY6+eWQfm8zs6aijgrX811OXlsbmUzakuneXpk6Jdi/N0IsYPFBgx7+CsJx5KvU /OKwNLpnVjU8aIokWwsRnCRD4dmSXSgo4hYAOD2pIIvDeFlepsMFHWM081uuaMGYdpVj BP4Uc6ZkImzBp+fFrBmHdvlD2vQzEOFnTClZRfE8QhCr4/zWyBP5DNER2ufmDG5hA2RW 31QoWmB8ZM9KOC2Q8/YphhWrsdaVqEreep5sy9+M5UmID+EW/PCFQhUDl8eKiZXp0i1k Qw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mm06brbw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:24:47 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2BLAFsag040107; Wed, 21 Dec 2022 10:24:46 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mm06brbum-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:24:46 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 2BL10jZS000918; Wed, 21 Dec 2022 10:11:29 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3mh6ywnc8a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 10:11:29 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2BLABRXF44302610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Dec 2022 10:11:27 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 204572004D; Wed, 21 Dec 2022 10:11:27 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0EFC920043; Wed, 21 Dec 2022 10:11:26 +0000 (GMT) Received: from li-4a3a4a4c-28e5-11b2-a85c-a8d192c6f089.ibm.com (unknown [9.179.0.69]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTPS; Wed, 21 Dec 2022 10:11:22 +0000 (GMT) Date: Wed, 21 Dec 2022 11:11:21 +0100 From: Alexander Gordeev To: Nicholas Piggin Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Peter Zijlstra , Rik van Riel , Thomas Gleixner , Frederic Weisbecker , Sven Schnelle , Arnd Bergmann , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org Subject: Re: [PATCH] cputime: remove cputime_to_nsecs fallback Message-ID: References: <20221220070705.2958959-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221220070705.2958959-1-npiggin@gmail.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: PuVTAINCMh-EUApWfEIbkdGOqDUmnm8F X-Proofpoint-ORIG-GUID: RrTDL3OMTTRfuc4moqR5PWXUcp4V74lz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-21_04,2022-12-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 mlxscore=0 suspectscore=0 bulkscore=0 phishscore=0 clxscore=1011 priorityscore=1501 adultscore=0 spamscore=0 mlxlogscore=918 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212210081 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 20, 2022 at 05:07:05PM +1000, Nicholas Piggin wrote: > The archs that use cputime_to_nsecs() internally provide their own > definition and don't need the fallback. cputime_to_usecs() unused except > in this fallback, and is not defined anywhere. > > This removes the final remnant of the cputime_t code from the kernel. > > Cc: Peter Zijlstra > Cc: Rik van Riel > Cc: Thomas Gleixner > Cc: Frederic Weisbecker > Cc: Sven Schnelle > Cc: Arnd Bergmann > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-s390@vger.kernel.org > Signed-off-by: Nicholas Piggin > --- > This required a couple of tweaks to s390 includes so we're not pulling > asm/cputime.h into the core header unnecessarily. In that case maybe > this can go via s390 tree because the patch should be otherwise quite > trivial. Could it get an ack or two from a core maintainer to support > that? > > Thanks, > Nick > > arch/s390/kernel/idle.c | 2 +- > arch/s390/kernel/vtime.c | 2 +- > include/linux/sched/cputime.h | 9 --------- > kernel/sched/cputime.c | 4 ++++ > 4 files changed, 6 insertions(+), 11 deletions(-) > > diff --git a/arch/s390/kernel/idle.c b/arch/s390/kernel/idle.c > index 4bf1ee293f2b..a6bbceaf7616 100644 > --- a/arch/s390/kernel/idle.c > +++ b/arch/s390/kernel/idle.c > @@ -12,9 +12,9 @@ > #include > #include > #include > -#include > #include > #include > +#include > #include > #include > #include "entry.h" > diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c > index 9436f3053b88..e0a88dcaf5cb 100644 > --- a/arch/s390/kernel/vtime.c > +++ b/arch/s390/kernel/vtime.c > @@ -7,13 +7,13 @@ > */ > > #include > -#include > #include > #include > #include > #include > #include > #include > +#include > #include > #include > #include > diff --git a/include/linux/sched/cputime.h b/include/linux/sched/cputime.h > index ce3c58286062..5f8fd5b24a2e 100644 > --- a/include/linux/sched/cputime.h > +++ b/include/linux/sched/cputime.h > @@ -8,15 +8,6 @@ > * cputime accounting APIs: > */ > > -#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE > -#include > - > -#ifndef cputime_to_nsecs > -# define cputime_to_nsecs(__ct) \ > - (cputime_to_usecs(__ct) * NSEC_PER_USEC) > -#endif > -#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ > - > #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN > extern bool task_cputime(struct task_struct *t, > u64 *utime, u64 *stime); > diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c > index 95fc77853743..af7952f12e6c 100644 > --- a/kernel/sched/cputime.c > +++ b/kernel/sched/cputime.c > @@ -3,6 +3,10 @@ > * Simple CPU accounting cgroup controller > */ > > +#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE > + #include > +#endif > + > #ifdef CONFIG_IRQ_TIME_ACCOUNTING > > /* For s390: Acked-by: Alexander Gordeev