Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5446801ybp; Tue, 8 Oct 2019 03:03:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwW4SY+QSFRV79AX7w1bBJLkaVAsvCHMThgwmQlKJaKOLDmxQq49aJYYcNvRymfprjd9SlI X-Received: by 2002:a17:906:4a06:: with SMTP id w6mr27228888eju.214.1570528979932; Tue, 08 Oct 2019 03:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570528979; cv=none; d=google.com; s=arc-20160816; b=mVyU1+x6FZUrI1K5yEXKXHzfAR4524Vr7wUTMqkFyUvZjUprSuGg99naORn/M3erCk OE3G2Wh0NtCfagKTDpSORbh7OLOHOrJNlRDAwOtqvY5EKXNXJ7N7wgemdAAPpDIyA9Q9 O/1AxZhz6nqR/eYl8yQqs6Wrp8ZCTpD4RlhtUcsMeR/bEHbu+NyfYzRDWxG1VOTSyfSY +bECjCx/QrEt58kkMzeF95HRXxn9svEqNYs+NLSR7BsMvEbPl1Pd19UrPcXt8Ox0yBdU JFFFlt3L2wwJcIX9zL3gNofT7KzESgBegjhfU/zhXjE/+DZraSegcAF22/mef+fr3T+V u0mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=GqzTqyowvPAvUQbXgGnvR7I0v85sKzoqVofmPdE4wrQ=; b=snkIX853lPZE7R3Z1T9APvLsrKhclBtjP2VtGozDgM7MhhwENLkS1yOxcXzoV9j3QP tenQYTM7IbsOTavRHE82mgt4OjMKH0AghZ5Xkr9ECezri57GEWA/A90gV697hKnnpsnW QXc1GFp9v2Bu8mTOAaWnSm5APSHwfoiuJcdTVAYrcWqQoR/58JUeEQ6cEoUMQn8v34Ck Vf1PjhrByid/ZNNU/nJIprN0idMmvz96BhYxj2GDC1UIbR+o/bYX44/HAVriYQm/D7Ew kbcztlvDQ+OHGhqoQWsjKndjwioc4SqDh/Q8jAUVDvi3rqDcg0lYKrtDu0n88c8Agcyj GqoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Wq+k9y3c; 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 d15si10136857edb.7.2019.10.08.03.02.35; Tue, 08 Oct 2019 03:02:59 -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=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Wq+k9y3c; 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 S1730268AbfJHKCN (ORCPT + 99 others); Tue, 8 Oct 2019 06:02:13 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:43006 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730199AbfJHKCN (ORCPT ); Tue, 8 Oct 2019 06:02:13 -0400 Received: by mail-lj1-f194.google.com with SMTP id y23so16840757lje.9 for ; Tue, 08 Oct 2019 03:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GqzTqyowvPAvUQbXgGnvR7I0v85sKzoqVofmPdE4wrQ=; b=Wq+k9y3cqefVkZ1tL1Y6xqcaD3CqIz8/tHswdPC7vEhgEGm1vMawqMRWqG0DJywGT4 8fmOpR2baz2OYprCPC1aEY2/tk0YjGKyKnNmrKJqXnyYPhOuLyW9yuN/Nl6uxfwS4oBi k7PN8yNJCpnN5dt7uymncpWz1kmBiGAfGidf4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GqzTqyowvPAvUQbXgGnvR7I0v85sKzoqVofmPdE4wrQ=; b=W4JOP3K4gYvWRuMtVoFsmVAa9cB/uxGC1FQ1atulLQ8D5k8NNpnFs/IEiv/cgra41b 9K2ubODsy+wAi5/Tl0iXUEARs9dCF5ttF6YeVrnZUjwor+lnKvMeaNiddrmU96FjEzcQ C8Sbv/eaCtQXVQOjLgmkTSPTHZye1SbxNHh/8xWkjNnjnEuOcGPVCrd3MOsZKV2pxqWT 0jo+fwJwsVU0GEGP+EMz7N1KB4PKU4nj0fFmy4T2VumD/peYFdEJt3hE78eFgdCYjGYm SC7uHaU4MU9cr5Gyx/FTyA44wRKsHd4ERqViRifDDKsIPy2YWkTi3LAbxbYJNd+BZtPF zE7A== X-Gm-Message-State: APjAAAW9I5HHeWlhaJPptLTtRyFuqVfY9ElGmLwhN+BkP7JzBFqNtHst FrjYFn839rPaEtbazBDqg/7ShJkLPJ0fC09U X-Received: by 2002:a2e:7c17:: with SMTP id x23mr15734325ljc.210.1570528929703; Tue, 08 Oct 2019 03:02:09 -0700 (PDT) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id f21sm4366420lfm.90.2019.10.08.03.02.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2019 03:02:09 -0700 (PDT) Subject: Re: [PATCH 3/5] backlight: pwm_bl: drop use of int_pow() To: Daniel Thompson Cc: Thierry Reding , Lee Jones , Jingoo Han , Bartlomiej Zolnierkiewicz , linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190919140620.32407-1-linux@rasmusvillemoes.dk> <20190919140620.32407-3-linux@rasmusvillemoes.dk> <20191007152800.3nhbf7h7knumriz4@holly.lan> <5f19e307-29c4-f077-568d-b2bd6ae74608@rasmusvillemoes.dk> <20191008093145.kgx6ytkbycmmkist@holly.lan> From: Rasmus Villemoes Message-ID: <9bf6baf9-46be-771c-7e26-527b117c998a@rasmusvillemoes.dk> Date: Tue, 8 Oct 2019 12:02:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191008093145.kgx6ytkbycmmkist@holly.lan> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/10/2019 11.31, Daniel Thompson wrote: > On Mon, Oct 07, 2019 at 08:43:31PM +0200, Rasmus Villemoes wrote: >> On 07/10/2019 17.28, Daniel Thompson wrote: >>> On Thu, Sep 19, 2019 at 04:06:18PM +0200, Rasmus Villemoes wrote: >>> >>> It feels like there is some rationale missing in the description here. >>> >> >> Apart from the function call overhead (and resulting register pressure >> etc.), using int_pow is less efficient (for an exponent of 3, it ends up >> doing four 64x64 multiplications instead of just two). But feel free to >> drop it, I'm not going to pursue it further - it just seemed like a >> sensible thing to do while I was optimizing the code anyway. >> >> [At the time I wrote the patch, this was also the only user of int_pow >> in the tree, so it also allowed removing int_pow altogether.] > > To be honest the change is fine but the patch description doesn't make > sense if the only current purpose of the patch is as a optimization. Agreed. Do you want me to resend the series with patch 3 updated to read "For a fixed small exponent of 3, it is more efficient to simply use two explicit multiplications rather than calling the int_pow() library function: Aside from the function call overhead, its implementation using repeated squaring means it ends up doing four 64x64 multiplications." (and obviously patch 5 dropped)? Rasmus