Received: by 10.192.165.148 with SMTP id m20csp5303956imm; Wed, 9 May 2018 02:50:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqVtEZkag/oE77fW+zECIXlk9B4adny5oH8h7jBOcld2tZs2M/AoiMgIVelFFFfBBOqilhV X-Received: by 10.98.103.154 with SMTP id t26mr43758960pfj.24.1525859419181; Wed, 09 May 2018 02:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525859419; cv=none; d=google.com; s=arc-20160816; b=g9z089hnVkKtT3ZW9+YoqPM3djScTr46eTtZnzV4E9p2YJKoykHr+evEQPUqa0uFbg 0SxKQG6aJ0skEwZbirFK7HoMnTZ+4c9xBRgMqrMLKEC/glYqdpL2ODl1bo+X/domh3NB a+xytgJ3LHTSbus4cAC2rZOEZ8rqXc2PGHSpjVZBFpNibRIscWQvh5nrfMVaJ7ZqXUpF 6xyFHAr78w8OndrdzOnRL0c5s58wpFCtJbKyL/JMctrfEkbQoEQ2Wpk6mZebBCAwaTe5 tkZN3VWxBscaIVf89WiJ3YNysnMsijzALfk0kQL23gcUXV2o/uzpcy3FlJB19H3Iw2dt bvdQ== 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=zWG9IPm9IFMWB62eZxyspALqVLb6gPilyxYotQ540Rk=; b=NMAQrzIH4rLMCQJckcMDxdvpshI04Pdv1zQ6d98LjH3QTaJLAZmcxJ6YifeiHzx1cW xZ/VdsFRbltvzsYOw4J2lxGKryPbhBQJnUNIih8Nsa2AxU5rVIgZoP3uEfPaVJMmzXyu soC3dWLP1YjUgkY8lpAYBNZgRgjMFMp6f3emi7xfGYB8HpCIXY8hVXzFbRotpPBIN0j5 dbDye5XReptzqYO0R+VapLdstilK7+tCM+cwEMxF88k+1hy+4YgdF2f+E/aLnN0Al/lG KYfIamaZQnIJU/MiThnmy5xKpSBsnh9BdABn2vF49s8MvVK+1pF5aHpMCWpwSa77TC6x 2WoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=J+bPqcme; 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 f13-v6si10822276pgr.62.2018.05.09.02.50.04; Wed, 09 May 2018 02:50:19 -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=J+bPqcme; 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 S934456AbeEIJt1 (ORCPT + 99 others); Wed, 9 May 2018 05:49:27 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:42866 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934097AbeEIJtZ (ORCPT ); Wed, 9 May 2018 05:49:25 -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=zWG9IPm9IFMWB62eZxyspALqVLb6gPilyxYotQ540Rk=; b=J+bPqcmeG51gAAZ07qiXmUDid 0aU0zhialh1RGsRYTvkv/QxONGGdeugJl07wAZ7ZxXsFytvdy1hh0jK3LWDnTJ4KZri1XySHoerji Mkg6F78cs3c412k3Cbmi/HBLN6RmuJNJCvqeR5ZnN/NcOpR/M/jnIrvCPCmTpqVKCqhXXYogTK2OT vUoEeI2C1ygqLDCDFcwbOVePisEtSuKI7vEiypFVQnZ+erF4n+9HFAaxftVmJGVkC4ZxWw8DMmUzx ML5XKIEo4wPRTwy/XHMR9fjMQdFlzS5KQ0CIC8VajiDvWvm8OEh732/BWU6jtuQu7hu78MG1rNhvG GkKkGYPIA==; 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 1fGLie-0002IF-Rm; Wed, 09 May 2018 09:49:09 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C943C2029FA13; Wed, 9 May 2018 11:49:06 +0200 (CEST) Date: Wed, 9 May 2018 11:49:06 +0200 From: Peter Zijlstra To: Johannes Weiner 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: <20180509094906.GI12217@hirez.programming.kicks-ass.net> References: <20180507210135.1823-1-hannes@cmpxchg.org> <20180507210135.1823-6-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180507210135.1823-6-hannes@cmpxchg.org> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.