Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp280779pxm; Tue, 22 Feb 2022 10:28:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3HBmOYLjvZagM7TI4ZImuDQAgRqODMZxnMsvaNoF8NBhHPQvbzlUNhaUn1sPPE8tpW71x X-Received: by 2002:a17:906:1393:b0:6ce:f3c5:49a5 with SMTP id f19-20020a170906139300b006cef3c549a5mr20484200ejc.123.1645554480313; Tue, 22 Feb 2022 10:28:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645554480; cv=none; d=google.com; s=arc-20160816; b=tk2T2dYXg8aogYsbNE1c/mLaTw8CnMJmJO5v+R9nQy7tEcMI0AEvnHkiQqUhWRlZkw EIpEL0oVyFIEm4re1SbjIhEbbDutqM+r0zBAgnow2WzNU18uuicWXJXEIBYdkBXMNBaW Pz6p2Ywa8hbzEpelHEDQQIgyZbCZ8moe0HLZX2zxbeuJ8f3wgzhgbBby3GEa/0hvb627 XGHdhdQaEGh3hLW1Zg7OFTaB/OFb2GcpstFgZ3BN3kCz1qBCbrVY4nDBMX+sfAJjScZn Y0mb7D7zqx1ELsHeUwElpxIiypgODi1Ndfj47HIfiE8NqekalyiHSPqXd4gv84T9cMyh RbrA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=CTBmZCIbf0xYIO9sAc9HbecPDlbBfJeHbZ9Knyudly8=; b=AnfBE3Ial1c+uMjpxLH3bfsl7WjycwrgvklxZDazUQEHhOMNJwQk4YTADB29aBETPE SeYheMjmD8vb11WlOlzCBhHz6iuaWnzrIEr6A3Fz12TfsPhHK+kOBXV6qBEFXpJSzJsJ jeT82vCJpC3Ru2IbtLxoOvwvw9OxjwbMPRG/FYPg1fdPFnDiRyltKEhH0yxRtIqthwUQ 6tpG5+fht3sdhEtNRYxF83XEad/xmhNHXPC2exXE9CjDtmqZ3mhFtHdQk8Hc8WyYXVJ+ /TVlDzetXRoRgz/ioV0tbHG9BhY/nsStfHmu8WrMzc4GHl42gtLJ8y8WZ9Jm8hhgEZmd 1WMA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cb19si7756456edb.11.2022.02.22.10.27.36; Tue, 22 Feb 2022 10:28:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233269AbiBVRQQ (ORCPT + 99 others); Tue, 22 Feb 2022 12:16:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbiBVRQP (ORCPT ); Tue, 22 Feb 2022 12:16:15 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C111F108744 for ; Tue, 22 Feb 2022 09:15:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 224F76118F for ; Tue, 22 Feb 2022 17:15:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79ED3C340E8; Tue, 22 Feb 2022 17:15:47 +0000 (UTC) Date: Tue, 22 Feb 2022 12:15:46 -0500 From: Steven Rostedt To: Carlos Bilbao Cc: peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, mingo@redhat.com, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel/sched: Update schedstats when migrating threads Message-ID: <20220222121546.4a45e049@gandalf.local.home> In-Reply-To: <6b4d8615-4c60-3d89-5210-b495344cabd4@amd.com> References: <20220126152222.5429-1-carlos.bilbao@amd.com> <6b4d8615-4c60-3d89-5210-b495344cabd4@amd.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Feb 2022 10:32:32 -0600 Carlos Bilbao wrote: > > @@ -8765,7 +8766,14 @@ int migrate_task_to(struct task_struct *p, int target_cpu) > > if (!cpumask_test_cpu(target_cpu, p->cpus_ptr)) > > return -EINVAL; > > > > - /* TODO: This is not properly updating schedstats */ > > + if (schedstat_enabled()) { > > + forced_migrations = schedstat_val(p->stats.nr_forced_migrations); > > + migrations_cold = schedstat_val(p->stats.nr_migrations_cold); > > + memset(&p->stats, 0, sizeof(p->stats)); > > + schedstat_set(p->stats.nr_forced_migrations, forced_migrations); > > + schedstat_set(p->stats.nr_migrations_cold, migrations_cold); > > + schedstat_inc(p->stats.nr_migrations_cold); > > + } > > > > trace_sched_move_numa(p, curr_cpu, target_cpu); > > return stop_one_cpu(curr_cpu, migration_cpu_stop, &arg); > > > I would love to hear some thoughts on this. I have no issues with this. Peter? -- Steve