Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3164050imc; Wed, 13 Mar 2019 10:23:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH+Y4YRgapDPS6YA5PrJ/SfNC9TKRjggsmIusadLeaA+GLhV6ZSy16ajdPP75lU+uA3L8w X-Received: by 2002:a62:4754:: with SMTP id u81mr45515221pfa.66.1552497833349; Wed, 13 Mar 2019 10:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552497833; cv=none; d=google.com; s=arc-20160816; b=YhrFMIclpz9Q47zdnbD7FYHqR38vzDbler1KV0kP4XJiqc6KyaSdGfYnL+1ejk/fE8 JJTmyzrERmEPa59ZsKNsVPpB/1+u9tHI8VflAH8G7r2HvuR6ki905Jd8bZPB5wpg/L0t EiKzvPw/7vAMvE8f19l6hU7UxIvPvZr3Lh7BkyPwmOdtJgFo6FFecr3r5r7YltliartI a6b4nw6wkLdPEsFfY4hqhhscD6TE5BXSXKQdOv1XE/ESfBcAZaiX2vgWf8OUF2fAf40l d3hHZROnHAgeBmXXgHeqT4gH4qP9g3v27BvzrT8Qdb9RkDi8BZMvKWnCmr0fyu0vE/wT jYhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zCMgs6brq8AkwCpETt9ZurpyQhRdFytZGG2OsW51ZwQ=; b=zZv2IyT39abzzgPjNBF7+fHmDmK69FbWmcHTmpTwuZsHktVZCQH5kbPBKgU5vGTrkl wCjNtTxr8TmF4YO985ZG7HikahFaXbi+3oK2LUufUNbqao2gLnjvkNUadI56eW/lY/UO db2HKWeE3vxuIXFTk5TkTbC76ZMeiIkowX3pHGnA/t88rR8DymUq52qa2TPwfGHVxwYe t3fBnpyj6ptMoEmnM0P/Fy3r0qF0aF2Y5r/exnKOZtJAnWyGmc3RLA66hMibggWJvBKh tvCZrLp6Hq6KCXDPNkTxTAFAWbjlJaeH41O17fzgE9MhM385HpSu6iWdco7iZ09JhiUq iAhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=djGLuI+a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ct12si12302612plb.422.2019.03.13.10.23.37; Wed, 13 Mar 2019 10:23:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=djGLuI+a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726831AbfCMRWn (ORCPT + 99 others); Wed, 13 Mar 2019 13:22:43 -0400 Received: from merlin.infradead.org ([205.233.59.134]:50686 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbfCMRWn (ORCPT ); Wed, 13 Mar 2019 13:22:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; 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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zCMgs6brq8AkwCpETt9ZurpyQhRdFytZGG2OsW51ZwQ=; b=djGLuI+ay+BbtOrxkiTAyJEvY wbtPvkv8Tu48RhJb0JUr5eIHtPP80B9ZXgAsocgxFhZRvPKUWNZbfekesYjeNVJaHEZid+Xzf43ne iU2KfcNc7bMW1BOuZnjPYMFWKGteG5FF2cVXlQmJZJhVeaRY2mKsiQrZYz0/x7qAIBUZ4lRFfjS0C cIaOEaBYkUT8eeWkIzzdCTYfcHUDRAD+9RbYX4cGjHIw11sU1kor4+W++cgfJQqkGjAodY3GzwZpZ w2UVYv6yEmltYpg0ZBsykuQ1HFVr1/4B57T7P4w7rvC2K9rARJP7aX1WlwFYn+YmaQtATvbXZ9jDX TjPZnzphw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h47aG-0005PI-P4; Wed, 13 Mar 2019 17:22:29 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BF4CB20298BBF; Wed, 13 Mar 2019 18:22:25 +0100 (CET) Date: Wed, 13 Mar 2019 18:22:25 +0100 From: Peter Zijlstra To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v7 01/15] sched/core: uclamp: Add CPU's clamp buckets refcounting Message-ID: <20190313172225.GG5996@hirez.programming.kicks-ass.net> References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-2-patrick.bellasi@arm.com> <20190313134022.GB5922@hirez.programming.kicks-ass.net> <20190313161229.pkib2tmjass5chtb@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313161229.pkib2tmjass5chtb@e110439-lin> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 13, 2019 at 04:12:29PM +0000, Patrick Bellasi wrote: > Yes, the for looks better, but perhaps like that: > > unsigned int bucket_id = UCLAMP_BUCKETS; > > /* > * Both min and max clamps are MAX aggregated, thus the topmost > * bucket with some tasks defines the rq's clamp value. > */ > for (; bucket_id >= 0; --bucket_id) { GCC will be clever and figure that unsigned will never be smaller than 0 and turn the above into an infinite loop or something daft. That is; use 'int', not 'unsigned int' for bucket_id.