Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3658759rwj; Mon, 19 Dec 2022 23:27:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf6nukWjNE76CdQdZyrQIYkLqi/IY6YDSPP0xAnxJPTzsfb/KrceDsHsJMGp9P0xDlA0tg+U X-Received: by 2002:a17:906:859a:b0:7c1:4bb2:f62c with SMTP id v26-20020a170906859a00b007c14bb2f62cmr36698270ejx.40.1671521250278; Mon, 19 Dec 2022 23:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671521250; cv=none; d=google.com; s=arc-20160816; b=Eu2y7oJ2j9fEPCkoQdhlUOWRRZr7nUI25twMsi36sfb12bxOeHPvZ+Nz3um6sHYuvC XuZO92frpag1+yyEng33vOGxJxNa5jqmht7NLNKbRniGsE5eb37tiTeYxjmeTSs4lGg+ Agd34z6ORX8GAtBAQ8La5txb+g4aL/R7HAaX7ISsJG/QMKewpRRpx7gYTAtARfYboLFf /GghrUNdzoeoPuQXI3+b3M3kx8+N4+RcG/FWBnfRAZQ5AOGdJNqk9aRzFDyDjfm21nfE qOGje22WDOWUFnwvCR4NRGmo11hoFLAFlaSGJtZKYxFvLxR1znNF5U5HXEeCRyROqwiX A+5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=AwGJvi0Hqvv9JsuJy6Gv715wZTJNC2wfNDuRpG/Z03c=; b=YsVNhq1rthJZRadyWMyQz3ewlJi6UEZy+zcFpocg/W82Z/g50/h0j4e99at9tn2Y+8 MZl6hyJsAVSBc8NhSFK8cc7lCho+Ohk4FkOsQNu5f4+VNpHtsjmiPA0Cytl2f31bJ7pw Kju9kXVR3KBI+wzp4vjtyrmTmW0DarVVFafktcQxtNhaQqWcBwzg8GpwYnkp30XckECL IUQnVhT4Dkga+zumn6Yqi7IaUsMDRlhlVgZ/nWXZVBkJR2Y/5rbnNRDBY++Gqfto1a/5 n9DEgWNgCZLMKKrr0KeTt1Whm3UTGERRii2a4JQj2kPrOJw+S6zhMBg3zACCD2PVbnV8 eG/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eMolG9vH; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp23-20020a1709073e1700b007820aa60dc3si12120435ejc.74.2022.12.19.23.27.13; Mon, 19 Dec 2022 23:27:30 -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=@gmail.com header.s=20210112 header.b=eMolG9vH; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233280AbiLTHO0 (ORCPT + 70 others); Tue, 20 Dec 2022 02:14:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233565AbiLTHOA (ORCPT ); Tue, 20 Dec 2022 02:14:00 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB2F618B3D; Mon, 19 Dec 2022 23:07:22 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id js9so11525185pjb.2; Mon, 19 Dec 2022 23:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=AwGJvi0Hqvv9JsuJy6Gv715wZTJNC2wfNDuRpG/Z03c=; b=eMolG9vHTtOXK18ugSCIT0pCtnwCyoEsJeJ5PFZQGlEJEv8sGasn8k+mDNhl13PHtY KxdPALt6iNv1ZxEOScug4CjFT4yCtXaPilRS4KpEie5J9Y8SLqmppp5JrDNEKt+UxiZk eqBpTCNCaf/7o148rNd27ULe/kJ9Xn6dxiP231e6ygEywzOKaGrwUesy9DXrmQask2mJ QivmeB3xkmUMw8175037K8srGanPjwIp2+itZCK6uHl1Delon502RC/BOMncaixcxKaP c0p0fyUNurBXLQPHDAAE3x9UdnNFTS36u+ZdnOICTnOxYQF2w5zemVtMudmeT7rOIbzN 0jbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AwGJvi0Hqvv9JsuJy6Gv715wZTJNC2wfNDuRpG/Z03c=; b=gPquulXJNuhOIpoQuDEhq2z6kNRJrpGx9JLcx908mWGEILxmKGXsb/AboKNo7Gx2U0 Rti3PIQ/t4YxeCV40Ab7Dnyk063etWWJzTXtEI7tZIhiUPKQISrrYwkucxwXxOBD73Ox 5NyGghyD9i7YwigRYXuqAKmwszra49lpriFNNOtoU/o0z72xyvZRcAIUDjCSMx9k1qWk 7hQD4t7RZ0+x/fGhbPRxDzPk5zOX+YXFMnVBbxxbY4HdJvtfRtR1R/x6Fs+rVD+ysRw3 4j58p5rX/UiscZ26sQs5GEvbK4+MOsTE2EjXzdgXu9gSeLyC6f4L4mh0fIUujFwE7Qoo mz2g== X-Gm-Message-State: ANoB5pn4/4XKsNAQ9vPbeX5KET5xaY7DRcb0iXFDdfv4UF90BPC/llUq PVJvv0AhtkTGsjji7qN3fRIvkdUOryZVIg== X-Received: by 2002:a17:90b:1916:b0:21a:4bf:eeb0 with SMTP id mp22-20020a17090b191600b0021a04bfeeb0mr46812820pjb.28.1671520041576; Mon, 19 Dec 2022 23:07:21 -0800 (PST) Received: from bobo.ozlabs.ibm.com (203-219-149-28.tpgi.com.au. [203.219.149.28]) by smtp.gmail.com with ESMTPSA id f10-20020a17090ace0a00b00219220edf0dsm7074232pju.48.2022.12.19.23.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 23:07:20 -0800 (PST) From: Nicholas Piggin To: linux-kernel@vger.kernel.org Cc: Nicholas Piggin , 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: [PATCH] cputime: remove cputime_to_nsecs fallback Date: Tue, 20 Dec 2022 17:07:05 +1000 Message-Id: <20221220070705.2958959-1-npiggin@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 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 /* -- 2.37.2