Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1090342pxm; Wed, 23 Feb 2022 17:53:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJXezArtNAr78fylfbD2oR9AZMbVThlslQU+H1Fc/fsbxTzNAxUUIkWI/K74gunpiBCheE X-Received: by 2002:a17:902:8548:b0:14e:e968:9703 with SMTP id d8-20020a170902854800b0014ee9689703mr319633plo.148.1645667590919; Wed, 23 Feb 2022 17:53:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1645667590; cv=pass; d=google.com; s=arc-20160816; b=CqgkglW1Wq5ZWOExi/nRW87PPquPA4T1xYXe1qgmQ9JfrTdWJ4uZunH5BCiDEq0T+e 6by/LU+AtcjiAngOqlv+IfOGfAoWYrBnor7Ju1uDoYESmM2u5pjpI5npITjFN+2XgFWQ 9vs4ADvdEACdm2nS1kIyDHtg+8UceoAFLR/CEVzxK9HN+2Y+778IJvqpkCoVAZ/Prm+7 UBZVyyldiGZuPxNukq0RTfZYpvUC4d77F1cPgnkIdrPAE0DDlnCsWEME8COcN5B4HPHh RBlDJQ8VzDnZ+b071gPkcM7J/2zoijOqHc4R0nljLQfDLE1Dc8qyB8A0zwZDPQnaKWyW x0OQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:references:cc:to:from:content-language:subject :user-agent:date:message-id:dkim-signature; bh=64RdqPZdxyKzKgRykwMVTou8TeK9SljeH5cNR+IXsnA=; b=VXpLgC1m2ABZUh2X5m+g3A5ObPov+3GA7BrL3urxCxeWvBQyo9dQy6Lo58cjhmHzRK J2oxp4sHA0LSZGwFsav9rYbAL06s+yagoNQoXK56Xcw5XHtxMLwainE7YRBeY2FudfUq XIeVFcxpI2PioRtp9DtT9oaSye05T/1mDDulx8NiC8t2lnkEEqNaznfI/gYF7TXQhVWk A6h4w/Ad1RaJ0MZ4FYr5KPAzAGYvi/MIgTaoDXCEjIkbaK18xxwjNHj1kMIb4IZh+o8Q cjWVX7OODB1Q9AYPsI+1T6Qia/ySCPTuQj+HD+8fI1K4EU+gTXqbaRl7sy/mY1J8zEx+ l+vg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="p36K/6tR"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l18si1235935plh.536.2022.02.23.17.53.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 17:53:10 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="p36K/6tR"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AB36F5EBE4; Wed, 23 Feb 2022 17:24:36 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238806AbiBWQO0 (ORCPT + 99 others); Wed, 23 Feb 2022 11:14:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234136AbiBWQOY (ORCPT ); Wed, 23 Feb 2022 11:14:24 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2046.outbound.protection.outlook.com [40.107.220.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBF4FB45BB for ; Wed, 23 Feb 2022 08:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hd4a16fHglmbTLe8TAJ3S64UtUICRhj/Sy8dW5e0oadPjRxD2UQxeCW4Xc7a/Nq8dpyoPJ4buW1+ziZwWukA2z22lwdFbbIAvv7G9Y5IqojISPGo8XafaPx/zJR/U7mvSavLiKKGjBJ97AhJoTn+j8ppqrwQD9885+1h9lrhTmEBGQiJ6Aegu3fhivpuaoeWKc/Q4B/CM7BQkNfBNfzWK3Ms213yIXUoiJb4mMrk1S5QietIeTw5VELpeERrjLx35Gw5VwEhgZtKuoAnlTYo1lpuWhujrk05qNGYhdkrEqEoAmqxkm/8pQZpxJrxdEL7SNmCvGz1zg9P4iA73LnXjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=64RdqPZdxyKzKgRykwMVTou8TeK9SljeH5cNR+IXsnA=; b=cFSBIbND1LvquscJ39f65Pkf9BqShdAsfRdjUPbfnZ1xnivxZJlE4m/qVYVylfmG29/yxvhX0JCYnkf6qyv/5oTN0Jv+hjq1FmjxqUtmq4E7uOUov/D7zZYVxoXPoH82PZXitQM77XABV7vfl/JHBDwu+QblFC1QmRord3uA/wMCZakLApWibn1MbmjadqwNDZFsJixz55SyRzd7j0bMblNiVirdKwdowisfZv2kX62lnRnwJVnduvbKgIP3XjsE8UVl85VucSfNAnwanh/xrAOig29UeHww8PljIH8ROsgrbHLgQzBrXpiZfigJ/Uha9EAQ5mjd7tHB1E83cH9O7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=64RdqPZdxyKzKgRykwMVTou8TeK9SljeH5cNR+IXsnA=; b=p36K/6tRRcvY/b2Gkp/puIs7pbGFfa90dwUdB4sITiEABdJyVcKGIZZMqZBAPvOUwquz+1I0SXij8M1KcTIdtSnKkI0LsfOt0imYhuzcMBpzamW/ShxbXR0lrSxB4hIqIgGclxmALNlJ6Wx1ojadMMurJgeURLWejOFow7OxKsc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5874.namprd12.prod.outlook.com (2603:10b6:208:396::17) by BN8PR12MB3634.namprd12.prod.outlook.com (2603:10b6:408:47::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.26; Wed, 23 Feb 2022 16:13:54 +0000 Received: from BL1PR12MB5874.namprd12.prod.outlook.com ([fe80::8d44:d69b:b031:1d50]) by BL1PR12MB5874.namprd12.prod.outlook.com ([fe80::8d44:d69b:b031:1d50%4]) with mapi id 15.20.5017.023; Wed, 23 Feb 2022 16:13:54 +0000 Message-ID: <3c6224ca-c0da-7ba9-1396-a2e74c4a40e8@amd.com> Date: Wed, 23 Feb 2022 10:13:50 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: [PATCH v2] kernel/sched: Update schedstats when migrating threads Content-Language: en-US From: Carlos Bilbao To: Phil Auld , Peter Zijlstra 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 References: <20220126152222.5429-1-carlos.bilbao@amd.com> <0e42c46a-ccc4-e793-00b8-ae407e06846f@amd.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BL1PR13CA0246.namprd13.prod.outlook.com (2603:10b6:208:2ba::11) To BL1PR12MB5874.namprd12.prod.outlook.com (2603:10b6:208:396::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4753ee1d-66b9-4dce-8180-08d9f6e77cd1 X-MS-TrafficTypeDiagnostic: BN8PR12MB3634:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DAMZwa/0Oi8hN0CEJsjm4RgjofvuMfezp5wevFRg+yvAmgLjfPX0mknNYMFB0xDjMTxudM6SVn02lgQFON9bhDkET8UloKjdln53KPeIJ9wGnkMqWUniw3y7t2MgfdgFO07OAn+rTyemfQIlt9grenTuGsV55RvHCrJ1L3Ciouin6Aa4L9wPYZWxdHvGn+EpLU+tlOqoDZJGLc8dv8A0pLP7WDL+wCTHd2j/uhRb2xxdfuVhrVID3ybG9aFxxDE+/gOtnExc4oaCScxCbiuyS/u6m0pm7ai2bDjw/vT5Tui8zo0TSPICMpXAdaZ62o+/9V/ID0rkNPJEG5hRiLyEeDUZ1arnC/+x0+LkCTOr540ljrkzyOz27tK3yNb2z3MvD6m6HD0iiZbpUJA65fGZ5EZpsW5uaKyq+B7EIQ8EgB+bdyUAFcq3lqa7/8r5+A+rlMknj3YyVeg7uwytM7fpSfesZYd76U3I7lWNiTixGEYe+xOZAC2dmwdoN4CupiDmRU6SCh5qvX5y1ljh65iQF/7hSWqtLO1jkLhdSCT05w8THgWfSph+85juvAVYEUU+fAxI2JsG7qbQDuWt9OxRwVnltggoF1ul9jhSQ8/j6EvfmialgqYMdkl+SV1gM6RcJHaG63pb0177X1aNKGdwwVTO+lTvbEFCPVCBesOBn6YK7ysazk2K1hyNcMUa98Pp/1x1TP9ividUiHVqXjr/6EJdyTA73+jing3etS/FgAMZCufH8J2v85Bz4N8tIM0U X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5874.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(36756003)(86362001)(6506007)(186003)(26005)(38100700002)(6666004)(2906002)(31686004)(44832011)(508600001)(316002)(83380400001)(110136005)(4326008)(31696002)(6512007)(8936002)(4744005)(2616005)(15650500001)(5660300002)(8676002)(6486002)(66946007)(66556008)(66476007)(7416002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aURjTTJBQjZ6U2EwY2poQjNDNlp3SmQ0Zk12Q201K25sVUp1M2dQUUthOVl6?= =?utf-8?B?YktBOGJDeDZPVHQ1YVl6WVNweTl5aENjQ041N2tKVkY0YXNWS0FMUGxKMUhw?= =?utf-8?B?aytMeDh4VnoybUVEVUxYbTlyenFCd1pweEJodk4wc3FtTUN2TFJXcjR0K2Ex?= =?utf-8?B?NW1xSGxWOVUzck82SkN1MUd1cjBUVzV0RlZzc09pTlhWWktLSk94d1ZnYndv?= =?utf-8?B?ckMrZkVncUJUSFJWOFlJY3VDVGpoUHA0eXFGVHpiRVFVSm9SZm5qdnppVHQ0?= =?utf-8?B?SEo4NmVQMXBUMENIeWlPWExneE9GOTZUUXpXdTNFWGNPQ2hEWmJpTVpyZXJh?= =?utf-8?B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1V2V2YUg5OHVRM0dVR2RlVVZU?= =?utf-8?Q?4ZAMNMMLzUonlZaD2s+kI64=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4753ee1d-66b9-4dce-8180-08d9f6e77cd1 X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5874.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 16:13:54.2869 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mUN/wSZ9/lKz4WJ0hJ49qi6LwYqCQOR7KGg9DQWn2DGPJWFEDqa9lckjtCEMif0xMSgcoQnyRv3KwcDQuF/esw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3634 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,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 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); trace_sched_move_numa(p, curr_cpu, target_cpu); return stop_one_cpu(curr_cpu, migration_cpu_stop, &arg); -- 2.27.0