Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1733353pxm; Thu, 24 Feb 2022 08:23:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKBkTCz++D3udZ6VoLFQ9mchIlremKV1O7a8H9I/YWR1PbgZ3E14VQ7qTxnnMmEA5lnQ6V X-Received: by 2002:a63:5f41:0:b0:373:a108:3b60 with SMTP id t62-20020a635f41000000b00373a1083b60mr2891282pgb.0.1645719794100; Thu, 24 Feb 2022 08:23:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645719794; cv=none; d=google.com; s=arc-20160816; b=cThLhvoPdCrbwVcb/bjigPoa/GCcnZtsH12rDMpJC4x8IG2AB+TNzEIFmQcvB2VusF 2VEu7VbU3/1psZxRqmMs2KtISdEs7Yh+ET0eb2R85Uq1VIMiIf6rT1jG7ta0vx72jTDK ZPVjSIQXHRb7YNgINpSzhwpk8wKiXyS9K1QyBf3tf1tncZHJHrT78l0TaFb60q3J1/TG E6rA9kF729PYgk4wIkQ523KCqZScyJLCv1PFPwXc/SXiJjrJ4bZ5ElvfrsD9lo4v/KGe WqK0z2tD+HLQTFMXhaPUevTngELFPjuB3/Pn+q0YXztVRmwiOSlZvI7HNpnB9MsJTjzM 9cfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Rrg9S+e1z9ycGVjwf8FshYc7srhCJ2Jl2HeTSgf5H9U=; b=Yd51ukIPPYAJiK551QbeeZXYQKvwIpLdXBRc5trvrrsrgxON4Vi5ufw8jTXzfe4NU9 83PWKcCyfkQDnH8h8dXJ1elttnx/TIxf4evo37qyAZ4IE+tQB+DwI0eMwDvyMmtmtLVN eySHOkq2cpL0xnOZJAU6AQV37arg0S2Zs2beJa0YMYwOYJBuW5Ty9DdIwSG2vv7Ac8sb sQIqY0WVrVaGVS/GHnyqMoHM5x4Qj5TmJ+ZPhsCGJ7FGy96x+6mxxxPmBuMPB7Vt9lcF oEnjJFzKjJIOj6Dvb/Z514syRa0foRpiVYnsG2DWcFuX00mBNy/LTipjn+mJijtf/wD/ vfFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aXPoaFIm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 74si2559321pgg.749.2022.02.24.08.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:23:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aXPoaFIm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 23AEC1D0851; Thu, 24 Feb 2022 08:13:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235313AbiBXOEM (ORCPT + 99 others); Thu, 24 Feb 2022 09:04:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235269AbiBXOEK (ORCPT ); Thu, 24 Feb 2022 09:04:10 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6951C20D83C for ; Thu, 24 Feb 2022 06:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645711419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Rrg9S+e1z9ycGVjwf8FshYc7srhCJ2Jl2HeTSgf5H9U=; b=aXPoaFIm9iIbICVft973jjTm32mwCc2DWAOSZjRz481JSrP8JoPs1zCFw81fMDYUzYJ8Yx cS1LjHcZc9N4C/2N5yHRCPh02K/Sn8rW83YnMytauI5fscu9SbVjXV35+oBAdTMju3TOZG SRytBGsDTCi1Xb9udv562QvoNPClG6U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-235-4j-thfZ1NDuYbevR9MlnSw-1; Thu, 24 Feb 2022 09:03:36 -0500 X-MC-Unique: 4j-thfZ1NDuYbevR9MlnSw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A96861854E2A; Thu, 24 Feb 2022 14:03:34 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.22.33.156]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9D86842D7; Thu, 24 Feb 2022 14:03:15 +0000 (UTC) Date: Thu, 24 Feb 2022 09:03:13 -0500 From: Phil Auld To: Carlos Bilbao Cc: Peter Zijlstra , juri.lelli@redhat.com, vincent.guittot@linaro.org, mingo@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] kernel/sched: Update schedstats when migrating threads Message-ID: References: <20220126152222.5429-1-carlos.bilbao@amd.com> <0e42c46a-ccc4-e793-00b8-ae407e06846f@amd.com> <3c6224ca-c0da-7ba9-1396-a2e74c4a40e8@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c6224ca-c0da-7ba9-1396-a2e74c4a40e8@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Feb 23, 2022 at 10:13:50AM -0600 Carlos Bilbao wrote: > The kernel manages per-task scheduler statistics or schedstats. Update > function migrate_task_to() to increase the counter for migrations. > > Signed-off-by: Carlos Bilbao > --- > Changelog: > v2: Update commit message, don't reinitialize sched fields. > --- > kernel/sched/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index fcf0c180617c..1360e501c737 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -8751,7 +8751,7 @@ 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 */ > + schedstat_inc(p->stats.nr_migrations_cold); > I was going to give a reviewed by since I was looking at this, but I can't convince myself that nr_migrations_cold is right. This looks more like a "hot" migration (using stop_cpu to force it). But nr_migrations_cold is not incremented anywhere else so maybe it's a terminology thing. Can you tell me why this is the right counter? Thanks, Phil > trace_sched_move_numa(p, curr_cpu, target_cpu); > return stop_one_cpu(curr_cpu, migration_cpu_stop, &arg); > -- > 2.27.0 > --