Received: by 10.192.165.148 with SMTP id m20csp1170475imm; Thu, 10 May 2018 06:47:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrPy99ACc7h8m9sZww6TFdGf+Xxg3Aq8EB608ckOlGyMLo4/7iOj3ioQmHz7WlEUNO5j9El X-Received: by 2002:a17:902:31a4:: with SMTP id x33-v6mr1464348plb.355.1525960031868; Thu, 10 May 2018 06:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525960031; cv=none; d=google.com; s=arc-20160816; b=E3DG6pjUkYjTq27fDL2EoL+yQgCYISFtJj7pme/pCpCMmsylDtjPXl5tm4PxQmPIpL 7w/AEr8AJn0wL9qnzwsUODgjAUez7Ny+AXOAQcb1FaVtiJadyC9CuuvKdKG3gNfUDzuz fiaCWYe8OC+mRBcri4VUUtF8OYDnzi0N/rPtIKU5XX6ve0c3Zt/XsHZh2Tnj/ZrTfyYc Dh+sbOX/MpQ6OkEo9nuQpDNjn3SM6ftNzi9MEPNZzKLIA9X6RL6p/iGouHcYzQzN7XV+ UySQriqU/HOvx53PgRpWymyPU8XyXjSakGcVZsZE5Fj5stHXkx/dEDeB4lB/mo4U9oyZ NDMg== 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:arc-authentication-results; bh=Qmx7JjeoeaJC3OplY4bbMOvvnadtQKcRgCsArlMNFho=; b=TmSJKwo2Q0bdp4FveQD0B+VIg65DWPg1TmTLf9R5f0VchBTNhwUuam5ND1U7CPQDc9 wuB3l81G1LAR2jPQHhv50lHh3NbENIq04vd7+y+N6qUCUiZYaBPcsN+634qYL9skShVd lzUJqkRBFzeXPJq469NCb9yP3uZhuIn+JK+FUgdhaiwrbQ291Ygjzf8l+ZI7H3iRXL50 AxIjh8RyLwd6+gLyBCjP3lbriOj2Er8fycHxhvtTDDpdjoa7afEP6Y/EuyzOxfCMpQPf 3TgaXvdiV3abKt0GzoGjTXmjYpbEqUWvYGPUSRlX1awqH/q5fFW6fJn0ecLeFfKJromO M+vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cmpxchg.org header.s=x header.b=JriDjeZd; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 203-v6si934133pfc.21.2018.05.10.06.46.56; Thu, 10 May 2018 06:47:11 -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=@cmpxchg.org header.s=x header.b=JriDjeZd; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965200AbeEJNot (ORCPT + 99 others); Thu, 10 May 2018 09:44:49 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:50108 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935499AbeEJNop (ORCPT ); Thu, 10 May 2018 09:44:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cmpxchg.org ; s=x; 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=Qmx7JjeoeaJC3OplY4bbMOvvnadtQKcRgCsArlMNFho=; b=JriDjeZd9eV4ZClfXZvC28l8PO F/8t+M6zIp+w9nYM0FDY6NNldhMrdi0BcA1zS3WDgwrmLY28TcuLy3Kvq6kCSnPmUK5I1c5eQSV1/ zDmpizbkMWJc07lvRAoHmRNuhUEMA62UXm5wUt2LVlF8u4mifMmPCT6rVLJHGtDLa2/A=; Date: Thu, 10 May 2018 09:46:36 -0400 From: Johannes Weiner To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, cgroups@vger.kernel.org, Ingo Molnar , Andrew Morton , Tejun Heo , Balbir Singh , Mike Galbraith , Oliver Yang , Shakeel Butt , xxx xxx , Taras Kondratiuk , Daniel Walker , Vinayak Menon , Ruslan Ruslichenko , kernel-team@fb.com Subject: Re: [PATCH 5/7] sched: loadavg: make calc_load_n() public Message-ID: <20180510134636.GB19348@cmpxchg.org> References: <20180507210135.1823-1-hannes@cmpxchg.org> <20180507210135.1823-6-hannes@cmpxchg.org> <20180509094906.GI12217@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180509094906.GI12217@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 09, 2018 at 11:49:06AM +0200, Peter Zijlstra wrote: > On Mon, May 07, 2018 at 05:01:33PM -0400, Johannes Weiner wrote: > > +static inline unsigned long > > +fixed_power_int(unsigned long x, unsigned int frac_bits, unsigned int n) > > +{ > > + unsigned long result = 1UL << frac_bits; > > + > > + if (n) { > > + for (;;) { > > + if (n & 1) { > > + result *= x; > > + result += 1UL << (frac_bits - 1); > > + result >>= frac_bits; > > + } > > + n >>= 1; > > + if (!n) > > + break; > > + x *= x; > > + x += 1UL << (frac_bits - 1); > > + x >>= frac_bits; > > + } > > + } > > + > > + return result; > > +} > > No real objection; but that does look a wee bit fat for an inline I > suppose. Fair enough, I'll put these back where I found them and make calc_load_n() extern instead.