Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2664550lqb; Tue, 28 May 2024 07:01:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGLLJT7JAlJ1fSqBpQErWUJgVYbhynyrUz3ty3AFTXeRoByPQ86CZFrhxTTSkWJHpZ4/EYMvnVdQdHA+eOfTVLz0wzIoHV+pIg8ZcWTQ== X-Google-Smtp-Source: AGHT+IHH9nYHLAWtKrx4VZ3jeUBVm8VsYIz+Ic8K32152uAu96y9svv/R8pdTtoC/dXS/iLpT9tG X-Received: by 2002:a05:620a:884:b0:792:c32f:caf0 with SMTP id af79cd13be357-794ab1247c9mr1236274085a.70.1716904899783; Tue, 28 May 2024 07:01:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716904899; cv=pass; d=google.com; s=arc-20160816; b=gM735Vj7SvSB4V30Fjam0f1OqC0veRtPT2Gz9MXm3Tv6Uy5S11AVjUlR7ECZo0d3FP sTtcZ4DjuQtWsskgQSjSc244uc21yVraQvXTO2le2lOcMHWMXDgwMzImpaxEOuyZP5CF vzDZiUoKYMl0bEmDf/9C7AtE1AHPK21qu3wm6PFPjNq2PaMbY5vBRyP6pTv++kG7bvRP cv16TQR3RR0sKLIdLSDKc6zCvm9fsRfFaC/8Owuy0PQZRhZPT1/OhKVTarr+yQXHsiiV lAWB+SPuCSirnGhF/tNkz5p2QrUIIcfsi5gW7fWzCjtSiplHcqMopJD5EMVONo6knnMw QdPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=VggxSiVozjhWuSWTY7ixbsruSFzfJywg2/svzSv+/Lk=; fh=6b1aXmwZn7Fwk5uBdN7QptZUhif/EKYWS1YEeWzbsZA=; b=Vg/E1J0qc4+tlffQ5kNhPYlReoOCSnwTrbEqtNnZlL+vn/bCAw9vUtft1yGmGhikTO tuvenyYkG8UhcfPcuHY4Aq+HlgAi1zeHkb29+3bRL9445QWvuqPvCN+AUiBqextKJShI P4DobRHOhwSlV5pY/kjoFALx/A6+/CzJ0epGg38Gj8oy7cUohLnCvD2+mKKvcVvrvtqZ +CpPMTfZlQVdOUCJIa/63DK4Cm6uvFPqMC5XHf7Un4LXbAa6vu4We/+OZsvt1IG/fGbN IJ0CDBR+MP6LsOk/tv+jTEotQ3e9pxWe1MvzRZtJaWzbxIc0iNIIYs6RSceyaOAk4NJW +NGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-192483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192483-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abcc67b5si1026451085a.163.2024.05.28.07.01.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 07:01:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-192483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192483-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 812E91C21F74 for ; Tue, 28 May 2024 14:01:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E8E316F28D; Tue, 28 May 2024 14:01:34 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB71D16D318 for ; Tue, 28 May 2024 14:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716904893; cv=none; b=oqWn5JjX3kBE6/ejvNKYOmkQgrIgtbdhcjztjFn44uDfK/xWrl2eXX5HFT8qpbzTSnubV38xHk/U5bems51u8+FvKYT+7jPTDcJaL5o5orQLd+5srhDZcM5REnbsp31m29Nd0qCtZhs6Kr4C5GiA0cNQNqrHC6UsFQlxmKjbEkU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716904893; c=relaxed/simple; bh=hgfX7M4P5V5VSXvfr5MKFamKM46mUbUoeDFgn0M5Gsc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=erIhyrHvUyX8/p6AxpDWMpeqimIos4aAmUFlig+URu07MCHU016dce7kv67qtr8vxLemkKoY7q0T33RO5HIJmzsTjvy2zAmTr/cmchrw0wzG4FIonY/SaakKUCzc0+VlC2a9sEBlm66xn5dNeMmJakttbtetTXQFARjgUUhrWVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5038AC3277B; Tue, 28 May 2024 14:01:30 +0000 (UTC) Date: Tue, 28 May 2024 10:01:28 -0400 From: Steven Rostedt To: Li zeming Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched: core: Remove unnecessary =?UTF-8?B?4oCYTlVM?= =?UTF-8?B?TOKAmQ==?= values from core_rq Message-ID: <20240528100128.41ee5fbf@rorschach.local.home> In-Reply-To: <20240528071446.59197-1-zeming@nfschina.com> References: <20240528071446.59197-1-zeming@nfschina.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 28 May 2024 15:14:46 +0800 Li zeming wrote: > core_rq is assigned first, so it does not need to initialize the > assignment. No, it is assigned in a loop. Yes, the loop should always execute once, but the compiler doesn't know that (hence the WARN_ON() that checks it). That means removing the NULL assignment will likely cause the warning from the compiler that the variable may be used uninitialized. The assignment is there at least to quiet the compiler. It's not a fast path, and the initialization is not a problem. NACK. -- Steve > > Signed-off-by: Li zeming > --- > 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 e32fea8f5830..346159a24705 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -6485,7 +6485,7 @@ static void sched_core_cpu_starting(unsigned int cpu) > static void sched_core_cpu_deactivate(unsigned int cpu) > { > const struct cpumask *smt_mask = cpu_smt_mask(cpu); > - struct rq *rq = cpu_rq(cpu), *core_rq = NULL; > + struct rq *rq = cpu_rq(cpu), *core_rq; > int t; > > guard(core_lock)(&cpu);