Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8199982rwd; Tue, 20 Jun 2023 11:32:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7UH/Ql4PhkdEKI0R+207GYtQ21QrqlIoqJfeZ5i0lu83erRqM+cI4flF0x63pH2dUK0dic X-Received: by 2002:a17:90a:7064:b0:25e:2db8:cc5f with SMTP id f91-20020a17090a706400b0025e2db8cc5fmr13517658pjk.40.1687285967120; Tue, 20 Jun 2023 11:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687285967; cv=none; d=google.com; s=arc-20160816; b=nyih6p1C4RyeCV1JBn5RyD8cfjjcO0AHXMoT0+QgSPNNY3DBLHDV0WeAlgdVBnS5W8 7ePcjlJY431H2ru8T8SM3V1n+sDHrkZWhf+41omxAAJAyW0MjgNd7EhRCja0PHrROMzD AW+8A7JMuvD6UZQRiS0pZ+4rjmLuHR/Ad3iWv2SrnaI0mFpldY++woOaCOU22rMBtQ3i jRBqjpH9p/CPBA8PLSLfObsnIpzyth7qV5Iw090IkyMYDWepF6oDljYUrLtOHgmykM/y BPjf4d5H4kadNASrVtVkuVIfS/m/E4VvrWVdb07ecz/zcH42yYb2aBOpGFAFPFXENLUZ ujZA== 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=hWQlynuRt1Gl0mrdrJdeyjqzsyOsoIOcGlKrs4rJzEo=; b=tKnGgmeTdow3R7Enr5M6jYpBRtrg8ecicbKrIVNL4JpgEQQx+mwLHbv49VXV/R+gtW Jn2sx6ItmnjnQTdrND0ybbPzs6CrxLjSYnPdylRs5aAsFxVWCTqsHMScsmyFnduvw960 Aj5Kv5KJCrh42QCZBoNFoAO1PlFetszkG8DoWTXeS97Og1n4XMAE+DYXtMpaN/PUABPS 8ysku8Z6pWjp+dNQbBM/0p3r0tiDKmsb3uu3Krs5xYSKgM/GXfigQ3LI2oGbdM+nIVRs 2/3hF+WzwW0+Fq+fYcfPuRvU/OCiiDBuIkSUelR+vvygOarHA9/SuJ62JN6v+5bkG1dF nPJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IQxHIQ45; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k63-20020a633d42000000b00553d7157e83si2236995pga.134.2023.06.20.11.32.34; Tue, 20 Jun 2023 11:32:47 -0700 (PDT) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IQxHIQ45; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbjFTRuI (ORCPT + 99 others); Tue, 20 Jun 2023 13:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjFTRuH (ORCPT ); Tue, 20 Jun 2023 13:50:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DA4A1728 for ; Tue, 20 Jun 2023 10:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687283358; 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=hWQlynuRt1Gl0mrdrJdeyjqzsyOsoIOcGlKrs4rJzEo=; b=IQxHIQ45zk3ST41oIypIi3DitmJkhaO5nuDyObQEkJqUvMZTFkgMbrBDt/K4Z6gk7Z9ILC 8Z3u0l8LCBZoneOxq98lDCkMzKI2m1J95WHq+laV6jO9z2oPaz9iRRMmRUhlv/wdZK6PMV M6PGxoSrbYp1P4wnVfamRglu+torSRQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-120-WFuT7F1LPBOxWDEpBBGB8A-1; Tue, 20 Jun 2023 13:49:14 -0400 X-MC-Unique: WFuT7F1LPBOxWDEpBBGB8A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08FB21C0512B; Tue, 20 Jun 2023 17:49:13 +0000 (UTC) Received: from lorien.usersys.redhat.com (unknown [10.22.18.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 55E39C1ED97; Tue, 20 Jun 2023 17:49:12 +0000 (UTC) Date: Tue, 20 Jun 2023 13:49:09 -0400 From: Phil Auld To: Miaohe Lin Cc: 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, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/fair: Use recent_used_cpu to test p->cpus_ptr Message-ID: <20230620174909.GA678839@lorien.usersys.redhat.com> References: <20230620080747.359122-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230620080747.359122-1-linmiaohe@huawei.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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, Jun 20, 2023 at 04:07:47PM +0800 Miaohe Lin wrote: > When checking whether a recently used CPU can be a potential idle > candidate, recent_used_cpu should be used to test p->cpus_ptr as > p->recent_used_cpu is not equal to recent_used_cpu and candidate > decision is made based on recent_used_cpu here. > > Fixes: 89aafd67f28c ("sched/fair: Use prev instead of new target as recent_used_cpu") > Signed-off-by: Miaohe Lin > --- > kernel/sched/fair.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 7666dbc2b788..3cc06cfca350 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -7156,7 +7156,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) > recent_used_cpu != target && > cpus_share_cache(recent_used_cpu, target) && > (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) && > - cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr) && > + cpumask_test_cpu(recent_used_cpu, p->cpus_ptr) && > asym_fits_cpu(task_util, util_min, util_max, recent_used_cpu)) { > return recent_used_cpu; > } > -- > 2.27.0 > This looks correct to me. Reviewed-by: Phil Auld --