From nobody Sun Feb 8 12:58:02 2026 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (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 C547114AD35 for ; Thu, 11 Apr 2024 12:19:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712838000; cv=none; b=K3/YP07utagHM/KGCDM9nTe9ikn4TOhqhUmpuFQtgGBo9gTnHV4fVL4yjB+lRtqduqMXzQRy9Sa3IX9r8FT0NLKMrGEop9O+H1GfZ9VmDlI5Mu69lBOBgYX3xPlEXo7PCYfaqEdmmdY9jl9I5jmPYYevAUkkS6UqJRJTddVAcHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712838000; c=relaxed/simple; bh=CfV54zs3ZTSh59pbZIsqCLI5u5wOBkvUuECrNExEESo=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JLXiLr3iTZDwUh3TFlXF8LFpeop6PqTA7Sq5o92texseV/fwh/sMt54MTkL9BI7MEtGq2ZCQEsK0g5aDRqkSe1/wMm1aDCW5QrrOT4TFv6OnYYmYSF40tLgjl5kwVHnwUcg3XyHqBuQJ1cpOYGF8tQyjjJblZx2VNAA0Nydi2Yc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4VFdws5Xwcz1RCL6; Thu, 11 Apr 2024 20:17:01 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id E745618001A; Thu, 11 Apr 2024 20:19:54 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemd100011.china.huawei.com (7.221.188.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Thu, 11 Apr 2024 20:19:53 +0800 From: Changbin Du To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , , Changbin Du Subject: [PATCH v2] sched/cputime: clean up common vtime APIs Date: Thu, 11 Apr 2024 20:19:48 +0800 Message-ID: <20240411121948.2154391-1-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 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-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd100011.china.huawei.com (7.221.188.204) Content-Type: text/plain; charset="utf-8" This removes the vtime_account_kernel() and vtime_account_idle() functions in generic vtime accounting. There's no common vtime APIs now. Signed-off-by: Changbin Du --- v2: also remove vtime_account_idle. --- include/linux/vtime.h | 11 +++-------- kernel/sched/cputime.c | 19 +------------------ 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/include/linux/vtime.h b/include/linux/vtime.h index 3684487d01e1..005d0870e41b 100644 --- a/include/linux/vtime.h +++ b/include/linux/vtime.h @@ -9,14 +9,6 @@ #include #endif =20 -/* - * Common vtime APIs - */ -#ifdef CONFIG_VIRT_CPU_ACCOUNTING -extern void vtime_account_kernel(struct task_struct *tsk); -extern void vtime_account_idle(struct task_struct *tsk); -#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */ - #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN extern void arch_vtime_task_switch(struct task_struct *tsk); extern void vtime_user_enter(struct task_struct *tsk); @@ -52,6 +44,9 @@ static inline void vtime_flush(struct task_struct *tsk) {= } static inline bool vtime_accounting_enabled_this_cpu(void) { return true; } extern void vtime_task_switch(struct task_struct *prev); =20 +extern void vtime_account_kernel(struct task_struct *tsk); +extern void vtime_account_idle(struct task_struct *tsk); + static __always_inline void vtime_account_guest_enter(void) { vtime_account_kernel(current); diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index af7952f12e6c..353b3b4c19da 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -709,18 +709,6 @@ static void __vtime_account_kernel(struct task_struct = *tsk, vtime_account_system(tsk, vtime); } =20 -void vtime_account_kernel(struct task_struct *tsk) -{ - struct vtime *vtime =3D &tsk->vtime; - - if (!vtime_delta(vtime)) - return; - - write_seqcount_begin(&vtime->seqcount); - __vtime_account_kernel(tsk, vtime); - write_seqcount_end(&vtime->seqcount); -} - void vtime_user_enter(struct task_struct *tsk) { struct vtime *vtime =3D &tsk->vtime; @@ -775,18 +763,13 @@ void vtime_guest_exit(struct task_struct *tsk) } EXPORT_SYMBOL_GPL(vtime_guest_exit); =20 -void vtime_account_idle(struct task_struct *tsk) -{ - account_idle_time(get_vtime_delta(&tsk->vtime)); -} - void vtime_task_switch_generic(struct task_struct *prev) { struct vtime *vtime =3D &prev->vtime; =20 write_seqcount_begin(&vtime->seqcount); if (vtime->state =3D=3D VTIME_IDLE) - vtime_account_idle(prev); + account_idle_time(get_vtime_delta(&prev->vtime)); else __vtime_account_kernel(prev, vtime); vtime->state =3D VTIME_INACTIVE; --=20 2.34.1