Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3678197rwb; Sat, 12 Nov 2022 10:16:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4yb1MvFpslqLVdgTfRVmjD++jsfee8saxrEhZz+shN/K2ag8MmgvNKRILp8czgfNgpRn75 X-Received: by 2002:a17:90a:e64b:b0:20d:b124:33b1 with SMTP id ep11-20020a17090ae64b00b0020db12433b1mr7160226pjb.202.1668276980071; Sat, 12 Nov 2022 10:16:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668276980; cv=none; d=google.com; s=arc-20160816; b=YfDj+pHN8K6vtXp8h2vUqNt6o0LlvgiWQ2LboHT1qIFVZZM/eZ2Z1e67Ldj4Y+7/eI n/X4AoKm6I0+wLzhEpl1nhBam+9JqCH0mRwJJuQFSBrgZ75GdD17w185VqWN8XnO317r KKI4uiZanMsmm9Ug5gkrkAvA+kSZ1fpEAe4hkHJ5sEVzPcWa8aCj3kJy2IGJLi+UhlQW IwUK/yZVvBNdwNyixcW6lecwG3eBq/NhbpeijoSJpBj2t9VNDpYdnKiXb5bc34VPxaTl JNJDay0gRLwd9/OeIk+6i82gWUMRzvB35ECu98/GqAPR4qUIGR22+VM6cp69VBFNQks2 xLZQ== 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=yeWm7GyGHtOmeOmHiUe2AeKpEt0z3x9o6ccodPf45EQ=; b=MZucedvqLeWRjjmz5ijQ1LxvQBpKkJKTFjPITOnGk5kKgQ4n7S1Dyn34GfKo/MPPij alG78jUWXiTxzEf4wsI/07wSqJI5+BiL2HsOfBP6TJR1AonHFqtv80IwUXBou+9Bi1Na 45X+trc/cD1bklsJJUJYLqkamO7/Kr2Agu434Qzw86qwf2vNdsbNxe2A6Z8oX6D8ohR2 ZhFtei7og2vBYFBwTSrPAjnog441b5RtlSxRvPYM61/e9KiMtHq/X0+8uL4w9qf9UcL6 dCDlAhy+38WvaFUVv0jXyxLqLdfTHIf1t56hETTHRJSuBqXaQs2nQkjDV5r8XEpZ4sgG jdBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@layalina-io.20210112.gappssmtp.com header.s=20210112 header.b=zkocUwzI; 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 s13-20020a632c0d000000b0047005e8d874si5597962pgs.9.2022.11.12.10.16.06; Sat, 12 Nov 2022 10:16:20 -0800 (PST) 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=@layalina-io.20210112.gappssmtp.com header.s=20210112 header.b=zkocUwzI; 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 S234063AbiKLRrQ (ORCPT + 91 others); Sat, 12 Nov 2022 12:47:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231404AbiKLRrN (ORCPT ); Sat, 12 Nov 2022 12:47:13 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41F9D12743 for ; Sat, 12 Nov 2022 09:47:11 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id l14so10449821wrw.2 for ; Sat, 12 Nov 2022 09:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=yeWm7GyGHtOmeOmHiUe2AeKpEt0z3x9o6ccodPf45EQ=; b=zkocUwzIaTggBmbQU9Yj7IHmLRx08cuYh1tfWjrm5GSy/lQmcT/0jLjDDzIq8oCbS2 4sALrb3q7/yKJfTyXlOtpyyi52l8kOq5zlWw4jF4mZBIeV74Jjs3X66VQteoUKv0fiaS AoRKqKSy62T4HmTLnXHmq0Gul6gjxJxttHAXTp3DR8MMtmvcv6Cfk5WT41nfETScV8HT z6qK49MjZcRfPNBf/7oDjAwdPrdIKUaNOljNuNW1/xFYxoSXSGT1jHBRf006b2LTma6l M2pxiuOuJGcYBzSfI63uxuU3W5RJBrjXhyX1PDnFnvs26nM4aBdZv0rEXb3wbY1Wx25i cmbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yeWm7GyGHtOmeOmHiUe2AeKpEt0z3x9o6ccodPf45EQ=; b=JaeK7mjs6/z5DlfZvXLMy7IeiSuK/Jqpv/2nCBFsQ+HGzYmvrwXeYDndaK8C89Gbx8 ZNGuHkjU5mjIMyKP7UW4YooSh0EmOeJ2LzMB8ywxxSeueWu7lwpfIYnLK18UD/ZLhtDD dgvbaYbQVB2xyIJNXBL/egGI0ZccingN3QKmC6pAns12BoqUSbrLGqYl2kQ4G5SgYHER D1kjeII47itxVdIYbQTzvCge/jdvz4eF39XmrAeNCiYAS2j7cCc/JQ4smsNZkScoprbR XMq2hlyVj0YVqKf0M0d62+WMixW/opFZfvj4DAt2rGWF2eoV7m1DG/Y73Td/+FkYO201 6gOA== X-Gm-Message-State: ANoB5pkiVzulwi9KbvVIVXUwavBhTQTrDh15G7eWwugty5Eva0sQcA/J fwubcsBqoxhfxmzyaooD+GINx9FUP9DoxtcV X-Received: by 2002:a5d:67c4:0:b0:236:2f7f:4c42 with SMTP id n4-20020a5d67c4000000b002362f7f4c42mr3804174wrw.479.1668275229790; Sat, 12 Nov 2022 09:47:09 -0800 (PST) Received: from airbuntu (host86-130-134-87.range86-130.btcentralplus.com. [86.130.134.87]) by smtp.gmail.com with ESMTPSA id g9-20020a05600c4ec900b003cfd10a33afsm6773819wmq.11.2022.11.12.09.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 09:47:09 -0800 (PST) Date: Sat, 12 Nov 2022 17:47:05 +0000 From: Qais Yousef To: Dan Carpenter Cc: oe-kbuild@lists.linux.dev, Qais Yousef , lkp@intel.com, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, x86@kernel.org, Peter Zijlstra Subject: Re: [tip:sched/core 3/19] kernel/sched/fair.c:7263 find_energy_efficient_cpu() error: uninitialized symbol 'util_min'. Message-ID: <20221112174705.pymjyzr4nqhkqfoc@airbuntu> References: <202211121723.P4V3w801-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202211121723.P4V3w801-lkp@intel.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 11/12/22 13:16, Dan Carpenter wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core > head: 52b33d87b9197c51e8ffdc61873739d90dd0a16f > commit: 244226035a1f9b2b6c326e55ae5188fab4f428cb [3/19] sched/uclamp: Fix fits_capacity() check in feec() > config: riscv-randconfig-m031-20221111 > compiler: riscv64-linux-gcc (GCC) 12.1.0 > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > | Reported-by: Dan Carpenter > > smatch warnings: > kernel/sched/fair.c:7263 find_energy_efficient_cpu() error: uninitialized symbol 'util_min'. > kernel/sched/fair.c:7263 find_energy_efficient_cpu() error: uninitialized symbol 'util_max'. > > vim +/util_min +7263 kernel/sched/fair.c [...] > util_min/max not initialized if uclamp_is_used() is false. (I thought > I had reported this earlier but I don't see it on vger). Thanks Dan! It's harmless since util_min/max are ignored in util_fits_cpu() too; uclamp_is_used() is checked there as well. I couldn't reproduce, I need to get GCC 12.1.0, but the below ought to cure it. Let me test it a bit more and send a patch. Thanks -- Qais Yousef --->8--- idiff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4cc56c91e06e..89dadaafc1ec 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7217,10 +7217,10 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu) eenv_task_busy_time(&eenv, p, prev_cpu); for (; pd; pd = pd->next) { + unsigned long util_min = p_util_min, util_max = p_util_max; unsigned long cpu_cap, cpu_thermal_cap, util; unsigned long cur_delta, max_spare_cap = 0; unsigned long rq_util_min, rq_util_max; - unsigned long util_min, util_max; unsigned long prev_spare_cap = 0; int max_spare_cap_cpu = -1; unsigned long base_energy; @@ -7258,10 +7258,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu) * aligned with sched_cpu_util(). */ if (uclamp_is_used()) { - if (uclamp_rq_is_idle(cpu_rq(cpu))) { - util_min = p_util_min; - util_max = p_util_max; - } else { + if (!uclamp_rq_is_idle(cpu_rq(cpu))) { /* * Open code uclamp_rq_util_with() except for * the clamp() part. Ie: apply max aggregation