From patchwork Tue Dec 27 12:13:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 36855 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1360895wrt; Tue, 27 Dec 2022 04:15:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXsYMxU4aR4hsbQIKDS9CYTOYQ++6s6vPYnJklipLroDhWu/wIHDvADkFwlw4GhOz/zlS+cU X-Received: by 2002:a17:903:1306:b0:192:5ec4:c439 with SMTP id iy6-20020a170903130600b001925ec4c439mr15552150plb.16.1672143352063; Tue, 27 Dec 2022 04:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672143352; cv=none; d=google.com; s=arc-20160816; b=MvD3sdmmF9jVmfNkI5df7bw5qGkzuPuFgi+B4I5NJ+aZmmyzPUEccfNOCR40Bf2R25 ClsrpPZkoHPQIu6bJmmifx1Z4/CU+T0O8KuxFdjAoPvulnOT+lyMUh0T9gA7hyE17I8e X/IRxfhZxR22pfZYoZHD8dYldys4i0AQBnR5AG8r+H1546va+sCfQZkEcxCzTj8N3hD9 edb1AGSn/94c/TnvsYtjAYJHjY7nFijL0SOF3zE1cFBiZIhhj3ReO3sN+fruod1gVo1d EUhrwUiifyAVVvz1o8YjsK5zyvvtGMMbRY1MkGt+bdBk91yyeWWZ1auCIN29D8s5WFw7 Peyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Oge8BJUdIiR8BP1GUdyWN8bXPtoIk/0R250b97qS1F4=; b=PSVx0GTOUxi4l3y2wqk5qRTW/EXmfDYsjmGoktNDJsB1RPuYTRjyobX0RiaheTBJTt CpsrBfNugH+tlnnXwm7jTj2jra+6k+0hcucA5amJNa9e2rJSRgjl3AxDzgPmZRl31bje 2Rv2gMnJfV78FPcUwIP95uM0L21Qa2dwRF6qtgX8emX71DbLNCPrQucZsqmQPYOCzdVq /NZa/GVtdBANS/751wsorlszcxOQy70B6EKjyMEEj+pmEgqOGW863HoX8rQSULXvDyWq ssPbI2U+XiLyLOrlY3q0n4u7NLeZVWRcABWui3Ma6ogbG7dutEPHu7VhS3+tseM3K17a Xb9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NhtCsqJE; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=9g4gbHJf; 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=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a170902ced100b00188e49e9dddsi15027559plg.52.2022.12.27.04.15.38; Tue, 27 Dec 2022 04:15:52 -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=@linutronix.de header.s=2020 header.b=NhtCsqJE; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=9g4gbHJf; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231765AbiL0MPC (ORCPT + 99 others); Tue, 27 Dec 2022 07:15:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232099AbiL0MOh (ORCPT ); Tue, 27 Dec 2022 07:14:37 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 195A4BCE; Tue, 27 Dec 2022 04:13:50 -0800 (PST) Date: Tue, 27 Dec 2022 12:13:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1672143228; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Oge8BJUdIiR8BP1GUdyWN8bXPtoIk/0R250b97qS1F4=; b=NhtCsqJEvC22vJr6hO6dsxKp1d6McUdSfCRCUhacaErQrGfN3Ak8JHF5QGYcBEeM3NnwFJ ApK6SJhhwcCDeRRYdmGQkG9Q6z/Z6DfIMBU7eBRKRLNtD+jVNEDzfALsHCC//8LMt35s/k 0mDbuMKI3H366ONDkEBzdemeOsHTbLuA3rKdmYQ7E1pe6onw/wA+BXdJkW+4pYNvp1hf90 KAcP+JHDCHgIo0oi5ZeGJJ2IvGAgXr49v8hUmTmxueLd6nxTEvCabxI0cqboJS8c3Qf6Lz HgmtrbOQAbf7sZWgU4Qxp6EtrrgF+MfL/sAu/VaHsqnPvoVZDeDcL7HWpgGkOA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1672143228; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Oge8BJUdIiR8BP1GUdyWN8bXPtoIk/0R250b97qS1F4=; b=9g4gbHJfFxeydysTiPp9iXcU/GvO35iQdSKqTeArghjAoNfU8HKg+UTDMK28FGDhNjC1Ut hiVgYqFEbXC1VyAA== From: "tip-bot2 for Nicholas Piggin" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] cputime: remove cputime_to_nsecs fallback Cc: Nicholas Piggin , "Peter Zijlstra (Intel)" , Alexander Gordeev , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221220070705.2958959-1-npiggin@gmail.com> References: <20221220070705.2958959-1-npiggin@gmail.com> MIME-Version: 1.0 Message-ID: <167214322823.4906.12017382437888947820.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752716998405158462?= X-GMAIL-MSGID: =?utf-8?q?1753369387408828258?= The following commit has been merged into the sched/core branch of tip: Commit-ID: c89970202a1153b2fc230e89f90c180bd5bcbcef Gitweb: https://git.kernel.org/tip/c89970202a1153b2fc230e89f90c180bd5bcbcef Author: Nicholas Piggin AuthorDate: Tue, 20 Dec 2022 17:07:05 +10:00 Committer: Peter Zijlstra CommitterDate: Tue, 27 Dec 2022 12:52:17 +01:00 cputime: remove cputime_to_nsecs fallback 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. Signed-off-by: Nicholas Piggin Signed-off-by: Peter Zijlstra (Intel) Acked-by: Alexander Gordeev Link: https://lore.kernel.org/r/20221220070705.2958959-1-npiggin@gmail.com --- 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 4bf1ee2..a6bbcea 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 9436f30..e0a88dc 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 ce3c582..5f8fd5b 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 95fc778..af7952f 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 /*