Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7897753rwd; Tue, 20 Jun 2023 07:38:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7p+AL6pqnBwRPXFyB37BWozVMHRRKcCl29ACONvo5CNL1Cfp3kUmbuhYJyxYL2yjNLo7Er X-Received: by 2002:a05:6870:a54b:b0:19f:9495:95ff with SMTP id p11-20020a056870a54b00b0019f949595ffmr11471550oal.27.1687271911098; Tue, 20 Jun 2023 07:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687271911; cv=none; d=google.com; s=arc-20160816; b=g5xS9Jgvn921pN5NGoiLzDXUZQH3LBAKsGMThRKeFW1ZJjLXlx1/HhBQ8ZeeZ6q6hH k4/cWlT6Yi7q3mgVyeECg6GKe76IYHNQKsAZ4RDQ1AgONceWzMblYX1kzK4yn4t8uNY3 4xSVtY8b2NAvCKQQQOJPl6BZ+rzyp1i2Y1pvU8IsfsQoFZuTtE+CGKo6hnNDIClOedEx XKEchrriNDuTeWEIu6Yhw79OfOTBimQFtiu1cRAX8IdnwIqwbd8ZdN+0vzqBLGqA2shu REytoEbpYM75jmGhrtizyu4SxNV1RHa1wawphktQ2D+tn5TWMvixp1cd1MyEZrytMvb5 czrg== 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=VmM0Nc3LtyvvmpukuP4nGr0cZ1knJlu8u3HNcvubAaw=; b=fzseDiBg6NKG6o0MQ0qBouOKbS5Gs5flMtUs7HQPHHmdpm5E0r54f+a0ceKSu/PAS6 dXNFXb6Bslv2WO/EQbNW6bxxVJl0lu72634CAxKxZa9gMf8UReqiUcOu0C2m9muBSz0V yB+SvDtkTCqV0HuLZ/BKiI+dO4zHc3f+QD1MxPNTZ+QY9RP6j+i0JsRdTyMtkP0FxiO/ jT+lkORlpitY9N10Os0WFOPFKzsW4fJN38Hj2kUlefazQB6ij3xCY7DT9BrL/TFWWEnS nFrCAYSR/DxeKHqIw1tGQ7vxqIeUVBQDzfhI0gp9q3Fi9NWd/J6+0YTj01peENYUPNwv hqYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=hm0iJgo4; 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 i27-20020a633c5b000000b00553921dbc22si1975535pgn.643.2023.06.20.07.38.18; Tue, 20 Jun 2023 07:38:31 -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=@infradead.org header.s=desiato.20200630 header.b=hm0iJgo4; 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 S232714AbjFTOMR (ORCPT + 99 others); Tue, 20 Jun 2023 10:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233191AbjFTOMQ (ORCPT ); Tue, 20 Jun 2023 10:12:16 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2C74E72 for ; Tue, 20 Jun 2023 07:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VmM0Nc3LtyvvmpukuP4nGr0cZ1knJlu8u3HNcvubAaw=; b=hm0iJgo4ztBsmZPctKxioshyft ZpurZs5YOMn0tybmwtDzZ26ulMwGO+q8Ug9sWYwSrySeGGgJONlCiviE5nxghdkhl7Fc+yVWDVpKp vNlJzJub/+yh6VwpjHlvDJRa12pIwZqkqZMJKyQ04yIFS0Ja4DChE0Likncf8MfZGzs4GLEkJ0Fob 9lRcbK3qYzDPjyXtQG9ItqgL7zHCndZpLgw4gnaT6LyjvcMa5RkUUmxNNZ0cGFQFuu2GQX1WwZebG aAp2YhyBSIOrKFAFh4ZPBiivTOZKA4IxgLPhwKiugqsC+blAamhKRZTG0dtS2IN5HcWpoYeqaL3Ta +mgshOFA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qBc4o-00G6C2-24; Tue, 20 Jun 2023 14:11:22 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 84B17300137; Tue, 20 Jun 2023 16:11:20 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3BF96241C2230; Tue, 20 Jun 2023 16:11:20 +0200 (CEST) Date: Tue, 20 Jun 2023 16:11:20 +0200 From: Peter Zijlstra To: Miaohe Lin Cc: mingo@redhat.com, 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/topology: remove unneeded do while loop in cpu_attach_domain() Message-ID: <20230620141120.GA2016469@hirez.programming.kicks-ass.net> References: <20230617081926.2035113-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230617081926.2035113-1-linmiaohe@huawei.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Sat, Jun 17, 2023 at 04:19:26PM +0800, Miaohe Lin wrote: > When sg != sd->groups, the do while loop would cause deadloop here. But > that won't occur because sg is always equal to sd->groups now. Remove > this unneeded do while loop. This Changelog makes no sense to me.. Yes, as is the do {} while loop is dead code, but it *should* have read like: do { sg->flags = 0; sg = sg->next; } while (sg != sd->groups); as I noted here: https://lore.kernel.org/all/20230523105935.GN83892@hirez.programming.kicks-ass.net/T/#u So what this changelog should argue is how there cannot be multiple groups here -- or if there can be, add the missing iteration. > Signed-off-by: Miaohe Lin > --- > kernel/sched/topology.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index ca4472281c28..9010c93c3fdb 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -750,10 +750,7 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu) > * domain for convenience. Clear such flags since > * the child is being destroyed. > */ > - do { > - sg->flags = 0; > - } while (sg != sd->groups); > - > + sg->flags = 0; > sd->child = NULL; > } > } > -- > 2.27.0 >