Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3837491imc; Thu, 14 Mar 2019 06:29:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsODM+GeV5rGUCfd40sbqZKyOeN+eaSeqMRIr0hxkw5orB/2FbF7vckbA8BkWUWGJEXCeN X-Received: by 2002:a65:624c:: with SMTP id q12mr43932387pgv.75.1552570194007; Thu, 14 Mar 2019 06:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552570193; cv=none; d=google.com; s=arc-20160816; b=ktpOBd+uSvm5Rr9PPFS4che70WKerGExv4BXwfQKxfUSD9rXwTulrJGjsJDPRX2POf V3Pw61ZPMV0+oJnJVbjch/IeEuhQhC1xN6yz2jdQIS1eXMicSz6Cm3q0kB1yM2Xdj8nb mjQ29Mt8kA5aS2NtQtQ0yhcqsq5dwZI9qM9kkhOWOVjM2soViY08YWMdc6xnGWzjJ9Jo EBf5BifJwuPPH2wrYFEE1jE8LnCEX/WuKCENYhoC8dijib5s+FYKUVEdW97g4SvfPNFR X2W2m3BTOI2iGtD3omGmJD3MkDlg4nAkb+qn7X/CvES5MQsSL0DugMVUeouyHkYgx4q3 6Omw== 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=yT9EaSYi20IjGFg2GYcyPsUPRxIjYqpT0Z2um99l8Zw=; b=SxX3DShYPx3l51BjcUpNPmDhJz4Jftj/VVoOju48CnKeO21+UuyXAXPGO0txfpxdOn TiEs27xRRMDUqPhyKbFwcEj2/rZDbn/Tise5nBGOdU13kLPl1ib5792L1aeOcIJQnhDF VwipNBjXR2jz+napJ8wQpmzMZKmr9eCsykqvEckGqVNGqYfqcSIbuFFDxS+0YewqnjFr x4r4oxosdtT/GWgszjYhVW8waAeGCb/PskzBjlwuoa3icsfvyQKc+1if43U8TAMiOFUL XQurK3DZpRrtHYDkCQVOEkz0TePX6e5nu7UvH4anXwIWwh80uSGQi+ixYnHbbdnaF+AF LwVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Z2gr8MtT; 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 t12si2376281pgv.477.2019.03.14.06.29.37; Thu, 14 Mar 2019 06:29: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=bombadil.20170209 header.b=Z2gr8MtT; 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 S1726996AbfCNN1i (ORCPT + 99 others); Thu, 14 Mar 2019 09:27:38 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53472 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbfCNN1i (ORCPT ); Thu, 14 Mar 2019 09:27:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=yT9EaSYi20IjGFg2GYcyPsUPRxIjYqpT0Z2um99l8Zw=; b=Z2gr8MtTnkExs0ba2F6U6LDF+ ZDsF2DxS1zc3hMssj2b96/Pv0VtlgR62+KAj4O/kX3joH857xUyVC1pahDPwCsHg+dcy0sIz75ZNY YsHVHfnohSbk13n55M+LjmLqzUCrNcPhXabIGmkRgPFuTKLkh/eqaGwsiVEdj/1Muk6K5F9Uwhot9 dO10InyZJM5bIIWB4t/T+hIxq7oAT04b6iH/qtMomrhwlrFObKrlRRxqfh4FYnKoVdkvvRu7d+waL 8b6790c5abYZSEgnZKrlOFrm7Tfy7q8l5IQA6WY10vbXKsKOJTJ3rJVgfCCySi9231OacFRLYkHJj x43qlecWg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4QOS-0004Uo-6g; Thu, 14 Mar 2019 13:27:32 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B6A84203C000B; Thu, 14 Mar 2019 14:27:30 +0100 (CET) Date: Thu, 14 Mar 2019 14:27:30 +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: <20190314132730.GI5996@hirez.programming.kicks-ass.net> References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-2-patrick.bellasi@arm.com> <20190313135238.GC5922@hirez.programming.kicks-ass.net> <20190313155954.jse2tyn5iqxm6wle@e110439-lin> <20190313193056.GP2482@worktop.programming.kicks-ass.net> <20190314110330.rshrdeoxgzt6pk5a@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190314110330.rshrdeoxgzt6pk5a@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 Thu, Mar 14, 2019 at 11:03:30AM +0000, Patrick Bellasi wrote: > void uclamp_rq_dec_id(struct rq *rq, int clamp_id, int bucket_id) { > if (__builtin_expect(!!(rq->uclamp[clamp_id].bucket[bucket_id].tasks), 1)) > return; > rq->uclamp[clamp_id].bucket[bucket_id].tasks--; > } > ---8<--- > > generates something like: > > ---8<--- > uclamp_rq_dec_id: > sxtw x1, w1 > add x3, x1, x1, lsl 1 > lsl x3, x3, 2 > sub x3, x3, x1 > lsl x3, x3, 2 > add x2, x3, x2, sxtw 3 > add x0, x0, x2 > ldr w1, [x0, 8] > cbz w1, .L4 > ret > .L4: > mov w1, -1 > str w1, [x0, 8] > ret > ---8<--- > > > which looks "sane" and quite expected, isn't it? Yep, thanks! Sometimes I worry about silly things.