Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3741437ybk; Tue, 19 May 2020 11:50:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTAsnWBG0G2xMnPdAygAd7qR7R2q/VherLLWrF8uSPYmXwUUuQJj43eWiAJeS3tyv/Z6a0 X-Received: by 2002:a17:906:9719:: with SMTP id k25mr568967ejx.411.1589914229192; Tue, 19 May 2020 11:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589914229; cv=none; d=google.com; s=arc-20160816; b=BGjphjc/gE5h8EiN6QIfegNu8be49ak8CVTfBUskP/GqiztNQD3aWbt3unl0VVeJKe lV7Ps7XhF/Wrzg2J7lPyEpe3Fd8AluDUnEvfASkSCBd/P+0yEy6P/v+uAyJaEsBVTPl+ DFP+gTpHz080uUC4S/J/b66yw7ipRZWIzeRV5FNTGGIdqlhSzKg8VwzBj0b0EVE+g7/3 vgbGaMhUL5spLLkjA9mmrTGickvIr8NZmdW5qVPlHqdpFG3x8Qs0wPwbb9lByTu985Kr skzy4OHyaiusuJV6matSfKGNcUEzkKedD3UDPysV6ytcNx0gO+glyUpU4R+HBQGD6vAB 2kAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JyzkKr1JhOCfKm02c+21XonEXostNDxmZnTbn9PYvN8=; b=gEHNfn2EBx7WaX+uaaHjnEGOZZ/F6E5pGVAW//kR0uJNGZDH4QBsWJw8d1rkSB3lJh b9yxOWPYeDoZo9oBQa0uVrcQEtiEMijrEOnrZU7+LQkXVI3Qx0g4I8+QN4clZNgK24fE p4gp+6uFJVs67clctShvQIFxwgCH9ZxKifkQay6YgfAJO5DsOSa/nI9fWHtS8w/bLEyl 7qApj3qvmoCyYqj7FHBKhtsJL6IOG8gd2QlmJWgIUacyFNrAVHQX70Epsr7zuUKdprd9 uQhkxFhbgK+U0e95uM0+XDrAm6kDjs3YEbFEhlCvQ46GcOY44k1tRGE+xgRsI9oHknkX bY4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=CLqf0aif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id re25si397969ejb.627.2020.05.19.11.50.06; Tue, 19 May 2020 11:50:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=CLqf0aif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727008AbgESSqv (ORCPT + 99 others); Tue, 19 May 2020 14:46:51 -0400 Received: from merlin.infradead.org ([205.233.59.134]:45868 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbgESSqv (ORCPT ); Tue, 19 May 2020 14:46:51 -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; bh=JyzkKr1JhOCfKm02c+21XonEXostNDxmZnTbn9PYvN8=; b=CLqf0aifIj0VH4QIoZuacBPBRH XB9v62HUkRhzdcxBtbtle/Qa6NG4mUhtE050hOmZBlTodi4nsxHG3Poh2MLG5g4V5v3lViVUy6DRF cftEo7KzDlLTdAgvvCmHFfqm1Z9XrbHM5JC7qT5enwpzS/fKFe3v15WDiJkBKqpfkc0FWM5rD3qY1 TwifgQmOvMW2vxvSO6Y8wShS6rX6rYPKazo21kpk+1KbKGZ+kmzLG3lU+szhKliPDhqA6GMKnQgF0 q3re+w2qF6ZzmNWZNqxrr7tEzFBeIQXyTgIT/WWSzG8W4geQdsuB47Jdu7y4APnCa4lrOyqa7JPf7 YWANoo3A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jb7Bz-0008TD-6L; Tue, 19 May 2020 18:42:19 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3402D301A80; Tue, 19 May 2020 20:42:10 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 238A125D60953; Tue, 19 May 2020 20:42:10 +0200 (CEST) Date: Tue, 19 May 2020 20:42:10 +0200 From: Peter Zijlstra To: Linus Torvalds Cc: Oleg Nesterov , Ingo Molnar , Thomas Gleixner , Andrew Fox , Stephen Johnston , Linux Kernel Mailing List , Stanislaw Gruszka Subject: Re: [PATCH v2] sched/cputime: make scale_stime() more precise Message-ID: <20200519184210.GD317569@hirez.programming.kicks-ass.net> References: <20190718131834.GA22211@redhat.com> <20200127122817.GA10957@redhat.com> <20200519172506.GA317395@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 19, 2020 at 11:33:34AM -0700, Linus Torvalds wrote: > On Tue, May 19, 2020 at 10:25 AM Peter Zijlstra wrote: > > > > --- a/include/linux/math64.h > > +++ b/include/linux/math64.h > > @@ -263,6 +263,47 @@ static inline u64 mul_u64_u32_div(u64 a, u32 mul, u32 divisor) > > } > > #endif /* mul_u64_u32_div */ > > > > +#ifndef mul_u64_u64_div_u64 > > +static inline u64 mul_u64_u64_div_u64(u64 a, u64 b, u64 c) > > Do we really want to inline this? Particularly if we expect this to be > the "architecture doesn't have a better version" case? > > It's not like we'd expect people to call it with constant values that > could be optimized by inlining, do we? If any of the values are > actually constants and it's performance-critical, the code is likely > better off using some special helper rather than this anyway. > > So I'd much rather see it as a weak function defined in > lib/math/div64.c, and then architectures don't even need to override > it at all. Just let them define their own (inline or not) function, > and we have this as a weak fallback. I completely forgot we had a .c file to go with all this. Yes, I'll put it in there.