Message ID | 20231031125928.235685-1-yajun.deng@linux.dev |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp215934vqg; Tue, 31 Oct 2023 06:00:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECPkeklO4s7mCMeu5Qs6qZ499pOd0nNHIKUt71GSUTmMFGUQ1aIV0uNksGoUf6NT6w7dFw X-Received: by 2002:a05:6a20:7286:b0:17a:e2b9:77e0 with SMTP id o6-20020a056a20728600b0017ae2b977e0mr3343641pzk.7.1698757199813; Tue, 31 Oct 2023 05:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698757199; cv=none; d=google.com; s=arc-20160816; b=lXBw2V1hGwz/zTmpYwpgHZjdr5JGdelxhEGOHDHJfcJu9Ay2XwkzcapdegnCRuKa3P IWqE+m8UNhlEyV2d1AyavB+Nt/FUQo/ZWpd7QHPPiS7FHkYxow5mcipWYJfGw5OlaqKm d3OPjqzcBxjYliIy1ZVXkto4KhFULNu3Br7wCgjMYEqj3qu3jQ0x2VPTqy3X2uFv7iYM PchdgfziukIEHFf3ggKYNBwcZPR21XnWCf5C+DBFkpwBry7lyZntc3ncVx3si9yIvl/9 SH3VOJAz+d4x2Mz0ENyaXw/VGp254f5GFvarUUNpCuGflCOnsy5VTyo6FzDibI+TaTQc 2mvg== 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=IDMC1GkRNk1k2ztG8ptBV6onAW6A2wHvK6RivRZoKp4=; fh=kY5sJNvn29qhEh2SatEVpXE2cTkcQ8AnU+xu9Bnn8Ic=; b=eO55gEGTNxTPzzldLU0I0NllFRnth13G6lVMbseKvHwMpAdrILQruyl6s+6YSwVplu M9PXsbmc8cDkXH+MMnKQ2ij72lcgtczbxsK9AOKBD+Tb6jzWIm1stuNnPrLTvsiOejpq v77t9z+ibcyVbTgXj4GohHBOeWMp/bt/PX+jvvHTOuzTQDBW574y7KZlNgVqs+7mPw0N SmcX0qsx7/xYt9WNaouWPZXc7niEDchd2GZ3jhKeEdKMf1WcBJDr66rJUyLq3XI0Fs+Y mMpR1HC5UxB36/oRACxA7CN35y/Yvz5sSQJ0XDVtmYgspHbdFsOFNTY8Mqf8p6h+CtJY VwVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="TA/0QBUV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 84-20020a630057000000b005b64e8336dfsi975160pga.604.2023.10.31.05.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 05:59:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="TA/0QBUV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 562AE801F740; Tue, 31 Oct 2023 05:59:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344382AbjJaM7z (ORCPT <rfc822;chrisjones.unixmen@gmail.com> + 33 others); Tue, 31 Oct 2023 08:59:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344350AbjJaM7y (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 31 Oct 2023 08:59:54 -0400 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C3B8BD for <linux-kernel@vger.kernel.org>; Tue, 31 Oct 2023 05:59:52 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698757190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=IDMC1GkRNk1k2ztG8ptBV6onAW6A2wHvK6RivRZoKp4=; b=TA/0QBUV5tjMBOvNwl6Xn4budzlArLfuW+A79pKt3KCUzJOtkHtRgHxu8TL7vXOaJKHz1T ZpKHEFCLgO1QPpwpXo7cMkcBIg0EP53i/qeh92aagpgaBFQY6PLevvlTAugkvzNPQU74Bb H1krPNOhnQtuF6yR90mC2kXuFHnXPuo= From: Yajun Deng <yajun.deng@linux.dev> To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Yajun Deng <yajun.deng@linux.dev> Subject: [PATCH v3 0/3] Use update_current_exec_runtime simplify code Date: Tue, 31 Oct 2023 20:59:25 +0800 Message-Id: <20231031125928.235685-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 05:59:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781276029403901983 X-GMAIL-MSGID: 1781276029403901983 |
Series |
Use update_current_exec_runtime simplify code
|
|
Message
Yajun Deng
Oct. 31, 2023, 12:59 p.m. UTC
update_current_exec_runtime would update execution time for each task, we can use update_current_exec_runtime simplify code. The 1st and 2nd patch update update_current_exec_runtime() applies to all callers. The 3rd patch use update_current_exec_runtime simplify update_curr. Yajun Deng (3): sched: Don't account execution time for task group sched: Don't trace stat runtime for task group sched/fair: Simplify update_curr() kernel/sched/deadline.c | 4 +--- kernel/sched/fair.c | 13 +++---------- kernel/sched/rt.c | 5 ++--- kernel/sched/sched.h | 11 +++++++---- kernel/sched/stop_task.c | 2 +- 5 files changed, 14 insertions(+), 21 deletions(-)
Comments
On Tue, Oct 31, 2023 at 08:59:25PM +0800, Yajun Deng wrote: > update_current_exec_runtime would update execution time for each task, > we can use update_current_exec_runtime simplify code. > > The 1st and 2nd patch update update_current_exec_runtime() applies to all > callers. > The 3rd patch use update_current_exec_runtime simplify update_curr. > > Yajun Deng (3): > sched: Don't account execution time for task group > sched: Don't trace stat runtime for task group > sched/fair: Simplify update_curr() > > kernel/sched/deadline.c | 4 +--- > kernel/sched/fair.c | 13 +++---------- > kernel/sched/rt.c | 5 ++--- > kernel/sched/sched.h | 11 +++++++---- > kernel/sched/stop_task.c | 2 +- > 5 files changed, 14 insertions(+), 21 deletions(-) Hurmph, so I'm having conflicts against this: https://lkml.kernel.org/r/54d148a144f26d9559698c4dd82d8859038a7380.1699095159.git.bristot@kernel.org (obviously).. I've resolved the first patch, which also mostly includes the second patch. However, your second patch isn't entirely right, it now unconditionally traces ->vruntime, which isn't the same. Imagine a regular task getting a PI boost to RT, in that case ->vruntime will be non-zero and the RT task will now be logging a vruntime. Anyway, that tracepoint doesn't really make sense to me anyway, that is, it logs a delta_exec and an absolute vruntime, that's inconsistent. Also, a delta vruntime can be easily computed because the weight should be known. I think I'm going to simply remove the vruntime from that tracepoint and avoid the whole problem. This then also makes resolving patch 3 easier. Let me go squish all this and then I'll post a link to whatever came out.
On 2023/11/6 20:35, Peter Zijlstra wrote: > On Tue, Oct 31, 2023 at 08:59:25PM +0800, Yajun Deng wrote: >> update_current_exec_runtime would update execution time for each task, >> we can use update_current_exec_runtime simplify code. >> >> The 1st and 2nd patch update update_current_exec_runtime() applies to all >> callers. >> The 3rd patch use update_current_exec_runtime simplify update_curr. >> >> Yajun Deng (3): >> sched: Don't account execution time for task group >> sched: Don't trace stat runtime for task group >> sched/fair: Simplify update_curr() >> >> kernel/sched/deadline.c | 4 +--- >> kernel/sched/fair.c | 13 +++---------- >> kernel/sched/rt.c | 5 ++--- >> kernel/sched/sched.h | 11 +++++++---- >> kernel/sched/stop_task.c | 2 +- >> 5 files changed, 14 insertions(+), 21 deletions(-) > > Hurmph, so I'm having conflicts against this: > > https://lkml.kernel.org/r/54d148a144f26d9559698c4dd82d8859038a7380.1699095159.git.bristot@kernel.org > > (obviously).. I've resolved the first patch, which also mostly includes > the second patch. > > However, your second patch isn't entirely right, it now unconditionally > traces ->vruntime, which isn't the same. Imagine a regular task getting > a PI boost to RT, in that case ->vruntime will be non-zero and the RT > task will now be logging a vruntime. > > Anyway, that tracepoint doesn't really make sense to me anyway, that is, > it logs a delta_exec and an absolute vruntime, that's inconsistent. > Also, a delta vruntime can be easily computed because the weight should > be known. > > I think I'm going to simply remove the vruntime from that tracepoint and > avoid the whole problem. > > This then also makes resolving patch 3 easier. > > Let me go squish all this and then I'll post a link to whatever came > out. Got it, thanks!