Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4446127pxv; Tue, 27 Jul 2021 07:34:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3x+/Yw890EKqaa+JdHBLg9fnc93H2WQHeolX3m7rtPvcBIshjJY5FTWiEz/9+h+M/8f1k X-Received: by 2002:a05:6402:1a35:: with SMTP id be21mr5447340edb.332.1627396467992; Tue, 27 Jul 2021 07:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627396467; cv=none; d=google.com; s=arc-20160816; b=Wi/MCasSPv0Pap8Z7Em/wcMH9QiUoirWsWLRzv1QPPXtPCSin2YvW2KVKhdRgLeUJw GJPCUpaxlvnAjcBWDcNaoNAR7HXGaskmrqOZkMtVOq+4Jy47QedFI05b5bKIeAxDtn1r ACu+es4ac/SNh13Fjzf1YdigTEwIOyK+ATHb2QLopBQ7zuygkpG6PAErE3xV3u4wN4rQ 4WX7XquoxSxVwnhIJYwZmwKaaK4difNWdCVbXEozUZ/B0XJsCYQx57/WxeVgPVAQoBXT 3tcVh3PlKO5BDZ4jhP2v/dEDv+p6CwdO8t6w+RuWwE6rFPLIM4COiUskIKJQ/PQFt+1i iaVA== 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; bh=Hmg9MLZr17IEw2RmilYhs5I9MnocLOHEcRsq+CLJPvk=; b=zB8cXQBZSrpeWoUfUwK1Yf2x0j6qW1YhnXlkV8JIb1XLO+EvernUkw/vyEkgje++CR 92UgZI+IYhQayQBDQ1g0SstFZs17gmvooP7baHUQZ2R4vNmpyRvr4nDlOEq3wKeMPbAa RsyJQDoxCbcfW3AJ7z4MIpF3HNYjPhEEtXJFqnAuw62FucRgPr1kqhEsaJJdw/2deyvs E6gKj4iAM8gbDyLpujFwt7Puow/yL+NcFrF4WqUk2iQYyBedhekq8Xg/eQN+zrayrdml MGUaMjkEGif53HkLsrQQ4ELMRgor5ngFb4M6O3amo1ep6Pn4zaMxFkB2VFjuCIHein2J IRGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si3262796edd.191.2021.07.27.07.34.01; Tue, 27 Jul 2021 07:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232523AbhG0Oc0 (ORCPT + 99 others); Tue, 27 Jul 2021 10:32:26 -0400 Received: from foss.arm.com ([217.140.110.172]:39704 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232123AbhG0Oc0 (ORCPT ); Tue, 27 Jul 2021 10:32:26 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 745FE1FB; Tue, 27 Jul 2021 07:32:25 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (unknown [10.1.195.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CAC6A3F66F; Tue, 27 Jul 2021 07:32:23 -0700 (PDT) Date: Tue, 27 Jul 2021 15:32:21 +0100 From: Qais Yousef To: Quentin Perret Cc: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rickyiu@google.com, wvw@google.com, patrick.bellasi@matbug.net, xuewen.yan94@gmail.com, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v4 1/2] sched: Fix UCLAMP_FLAG_IDLE setting Message-ID: <20210727143221.w3dxsc7ovc6cnce5@e107158-lin.cambridge.arm.com> References: <20210719161656.3833943-1-qperret@google.com> <20210719161656.3833943-2-qperret@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210719161656.3833943-2-qperret@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/19/21 17:16, Quentin Perret wrote: > The UCLAMP_FLAG_IDLE flag is set on a runqueue when dequeueing the last > active task to maintain the last uclamp.max and prevent blocked util > from suddenly becoming visible. > > However, there is an asymmetry in how the flag is set and cleared which > can lead to having the flag set whilst there are active tasks on the rq. > Specifically, the flag is cleared in the uclamp_rq_inc() path, which is > called at enqueue time, but set in uclamp_rq_dec_id() which is called > both when dequeueing a task _and_ in the update_uclamp_active() path. As > a result, when both uclamp_rq_{dec,ind}_id() are called from > update_uclamp_active(), the flag ends up being set but not cleared, > hence leaving the runqueue in a broken state. > > Fix this by clearing the flag in update_uclamp_active() as well. > > Fixes: e496187da710 ("sched/uclamp: Enforce last task's UCLAMP_MAX") > Reported-by: Rick Yiu > Signed-off-by: Quentin Perret > --- I've put a note that handling of this flag needs to be improved for the future. But for now and FWIW, this LGTM: Reviewed-by: Qais Yousef Thanks! -- Qais Yousef