Received: by 2002:a05:7412:8d08:b0:f9:2d0a:d759 with SMTP id bj8csp209127rdb; Sun, 17 Dec 2023 08:19:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcJ0OtJSzph5k4a0IkZXvRxKbOptUHtLcPdMDthsnLvnuCrBCqVQ3FQojv/l+B+3jJXZRq X-Received: by 2002:a05:6808:1410:b0:3ba:cc:6c60 with SMTP id w16-20020a056808141000b003ba00cc6c60mr18747442oiv.96.1702829989308; Sun, 17 Dec 2023 08:19:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702829989; cv=none; d=google.com; s=arc-20160816; b=Y7Kc0icWFcnPVMJiN8S3aJD9NILBK/GH+UX9vsyQnjaTk6kW5jFVgHXvh2vGtczJVd vw31BWZOQkdygp7KXTAMVHtntyHQI1ZHbuYEFwnLDi8mOhXQ43fXULLjC1UgfjM5A9F8 cBMXdQMY15O95UW+iYAyX+BLr+7hWg3VjWHt2HswVo+BATCsbOr2AP4XvVjvEJTpYrgN ZU525rmAY3ydVs3cl0ADjA+ftnqz2HFbkCOLKe8s+hwzqdgQF3TS7q0QD/SgEBt6S0e6 siuc4fDdepNgKu1hXFzVhCcNbxtQ/oeqLuaP6sTeAnb0/46HKHSU2Uo3VzXJWIJGxyc8 VTxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VpgQuU2Mi03SNo7nMLIvXtsaJFrml4RGReO/JB+4P+8=; fh=F7bFBih1mO2dRELlPF5lrvb91hNXCinssYgzQJo4TWw=; b=vQ6s4ZNMWpIIHWz05Zh1wHgMok3LmWVRB7+ZZ68pj4XWjwjorUSb+2Y5aDsep4A9gY JJ2oEUZ9nDlZ7macUPYSZaWDkrs6G6nvDO9RGxG3Sl3dwyBKvaqXdD7bYHtD0SOrGJOl uhXcjnL1JN6r6JYFcvz56C4QotpJP2ar3BnnqyN/E4h9kVu0RS7w/V7eQ5S2lzLI/E97 PrUpsqSsw6oT4z2KJ0ahQl0YJtebfqsZsFOo4J5nii8RjadePSKaMHuaoWImL5TTiOcD NuZIOztYdo9a/m/cQ4qV6IIgIohb3sWRTUutHRBgAJP61BYoFslFKsKS7YiC7uWqiV09 fg9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=OoQ7xqfU; spf=pass (google.com: domain of linux-kernel+bounces-2676-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2676-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id g18-20020a056a0023d200b006d6342a5d1dsi1010633pfc.261.2023.12.17.08.19.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 08:19:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2676-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=OoQ7xqfU; spf=pass (google.com: domain of linux-kernel+bounces-2676-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2676-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 13C5FB21B1E for ; Sun, 17 Dec 2023 16:19:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B64945BED; Sun, 17 Dec 2023 16:19:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b="OoQ7xqfU" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E41D244C88 for ; Sun, 17 Dec 2023 16:19:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=layalina.io Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40b5155e154so28023895e9.3 for ; Sun, 17 Dec 2023 08:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1702829970; x=1703434770; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VpgQuU2Mi03SNo7nMLIvXtsaJFrml4RGReO/JB+4P+8=; b=OoQ7xqfUZMo8TidtiTkJCAzu4JYuPrN7M1hun68NhigguiXn+3OThCWVA/hKGJNCBo WqJeKgiOWn22DpzN6geYz8WGwmD1c8w7owKzzpRRN+E9XD5DQFgNICPnLGP/lqwpzt2+ TU2rZoYefZgULoZTFmCIV9ei1sndCFk5OuaGObyN9COKZUtBDMLDzQhHgiODitIGheoV FXCiwhXurukJXVFQz4pWFD+jOpSAGVVzgV/ro0ln9ZsLtMWQyY6Ta2xpP5mYZiAmrYi6 djNAobQqdv0Zu1TxA+3MA4Rcb7R6aNqQ25iq6kxjvfXV8xbWrnu/iB4G3O8fWtk5JHbh e64g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702829970; x=1703434770; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VpgQuU2Mi03SNo7nMLIvXtsaJFrml4RGReO/JB+4P+8=; b=D/GGX8K65HaMKCejOWIVmhSYtMEERK96GTC97lEm+SgH6C+2aRRbOfQpc7jFECSRHA Nid1fbPO3sCl1axmREcBwpiiVNW9+agjadAk+8I7BuO7MtNe9U+DlkT2RIbdxt5Setjq x6turPXfbsephnytG4gHJRfxlUccYkcb1ZBzcdCRy2J3FW0nB4Bkga/KzYvGKeC70Vbp VeU+Lu/IBUbtIUR+ykNyBNMrfh4zx1aKTC8qhi3jyvuLwn8exARUCHm+8kRG3se+6mc2 ssSJFkHJOhcLBoauXlAC/espAWMxDgbqig+XxcYC5NFBwhF201kuKwJAHwUAtXfdYbbB kHIQ== X-Gm-Message-State: AOJu0YxTGn+xWnPCOMCygbEIgup9eYnC5S2WcZgtSf1myBVy0F41fDXt K0+hMZ207UWzEVrr0XoM0Ak56/o+TCVYWsHwTfs= X-Received: by 2002:a05:600c:5248:b0:40c:3e0a:692e with SMTP id fc8-20020a05600c524800b0040c3e0a692emr6804171wmb.232.1702829969876; Sun, 17 Dec 2023 08:19:29 -0800 (PST) Received: from airbuntu (host86-135-101-43.range86-135.btcentralplus.com. [86.135.101.43]) by smtp.gmail.com with ESMTPSA id j18-20020a05600c191200b0040c6b667dccsm11429183wmq.25.2023.12.17.08.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 08:19:29 -0800 (PST) Date: Sun, 17 Dec 2023 16:19:27 +0000 From: Qais Yousef To: John Stultz Cc: LKML , Peter Zijlstra , Joel Fernandes , Qais Yousef , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Youssef Esmat , Mel Gorman , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , "Paul E . McKenney" , kernel-team@android.com, Connor O'Brien Subject: Re: [PATCH v6 01/20] sched: Unify runtime accounting across classes Message-ID: <20231217161927.vewygmvxvddhxs65@airbuntu> References: <20231106193524.866104-1-jstultz@google.com> <20231106193524.866104-2-jstultz@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231106193524.866104-2-jstultz@google.com> On 11/06/23 19:34, John Stultz wrote: > From: Peter Zijlstra > > All classes use sched_entity::exec_start to track runtime and have > copies of the exact same code around to compute runtime. > > Collapse all that. > > Cc: Joel Fernandes > Cc: Qais Yousef > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Juri Lelli > Cc: Vincent Guittot > Cc: Dietmar Eggemann > Cc: Valentin Schneider > Cc: Steven Rostedt > Cc: Ben Segall > Cc: Zimuzo Ezeozue > Cc: Youssef Esmat > Cc: Mel Gorman > Cc: Daniel Bristot de Oliveira > Cc: Will Deacon > Cc: Waiman Long > Cc: Boqun Feng > Cc: "Paul E . McKenney" > Cc: kernel-team@android.com > Signed-off-by: Peter Zijlstra (Intel) > [fix conflicts, fold in update_current_exec_runtime] > Signed-off-by: Connor O'Brien > [jstultz: rebased, resovling minor conflicts] > Signed-off-by: John Stultz > --- > NOTE: This patch is a general cleanup and if no one objects > could be merged at this point. If needed, I'll resend separately > if it isn't picked up on its own. Looks like this actually got merged into tip via the deadline server work :-) Though not sure if I caught a bug here > diff --git a/kernel/sched/stop_task.c b/kernel/sched/stop_task.c > index 85590599b4d6..7595494ceb6d 100644 > --- a/kernel/sched/stop_task.c > +++ b/kernel/sched/stop_task.c > @@ -70,18 +70,7 @@ static void yield_task_stop(struct rq *rq) > > static void put_prev_task_stop(struct rq *rq, struct task_struct *prev) > { > - struct task_struct *curr = rq->curr; > - u64 now, delta_exec; > - > - now = rq_clock_task(rq); > - delta_exec = now - curr->se.exec_start; > - if (unlikely((s64)delta_exec < 0)) > - delta_exec = 0; If negative instead of returning for stopper task; we set delta_exec to 0 > - > - schedstat_set(curr->stats.exec_max, > - max(curr->stats.exec_max, delta_exec)); > - > - update_current_exec_runtime(curr, now, delta_exec); And curry on to do time accounting > + update_curr_common(rq); But the new function will return early without doing accounting. Wouldn't this re-introrduce 8f6189684eb4 ("sched: Fix migration thread runtime bogosity")? > } Cheers -- Qais Yousef