Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7109331ybl; Mon, 23 Dec 2019 18:31:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzpEPHtVigWCwQUQhsGoto08L023p/75cqzFd2ep55VktbsVxlTz5r17RJCOSQkzsuhbqp3 X-Received: by 2002:a05:6830:1bf8:: with SMTP id k24mr21292887otb.215.1577154660623; Mon, 23 Dec 2019 18:31:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577154660; cv=none; d=google.com; s=arc-20160816; b=w/74rP2IDgXmekc5L91tES5LCjEkvfEF+5G8XSFsTiSu/QoBeDBz1EAExBztJhAahI SNXEqMJIWM5A/xS9EtSnBZE4FG/XSpjgDMTPiB3RC3aY/4a2uapamv69TUy8jfPhsDGb fPaMwjNTSblEHdM5m6SlZWnVK93VnWAzGyS/CC43Ll1K+I++qs2D/W3MF4RL9tML4FB+ GY5s912u6/hGNkohZNgkZVeKOZW10hkSn/lmUd9TV3u6Rm8ItMp0GwksSZikrzyi5Aoy 8jQ3rhiMcXC+CJA5FbrNCkIM1pxRHxmVhdyOZ2DEQVeDuX9mLpB5mSdLwdYU9S+8ylO1 2m7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DSQS0uHBNC9Ui3z1SA4ieLxiBxYjVLA1pvOoujpbOvo=; b=zB69aHBE71YtFicfFaeYhf78ysYJxG8K+D2TZlGS1aOy8S32U9Qe2ADgnBylPJir2p pNSDUCokjH2zkFmkM0cvQINxaUTuqJHGl5GRZM/idtlVuKPLc2lGopA4viK0ENFNJbd9 pUZb9VDk4hxR/eQDRqhIf1BMO6OuDyj6Z5UeV+w2iuywjHFlYSFdgo55KV/BnhS4NDCy 4UU7PUhHX4df/mzPhxxIswwSVLUA8f+R5/RSLgj3rxnHjDrd5M0loPlV4yQSJGicn1e6 upODW4kkHSZl+qphz+8CW69ikkQzEzY/aBfXAwpzhWErQn8rUoFIPqFJJKMRDk9seybs YmCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mBOamR3e; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c17si8264935otp.131.2019.12.23.18.30.48; Mon, 23 Dec 2019 18:31:00 -0800 (PST) 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=@kernel.org header.s=default header.b=mBOamR3e; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727014AbfLXC3y (ORCPT + 99 others); Mon, 23 Dec 2019 21:29:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:51620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726908AbfLXC3y (ORCPT ); Mon, 23 Dec 2019 21:29:54 -0500 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 770CE20882 for ; Tue, 24 Dec 2019 02:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577154593; bh=DSQS0uHBNC9Ui3z1SA4ieLxiBxYjVLA1pvOoujpbOvo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mBOamR3e8+z/oxuQ1j6arsjUSXZzjlhMM4HvwMIBzxIH0PnwI3vD0y6J79ccnKo8X DVK+NzbOAuvhO9t9AREqK8/n+jmOBhUq+hrD4x5Lzu4meIgw/Aq56f9vXJtZCiBv6N w94bwVmE4Fl4guBclpw34hSD8o5Dpk5G3lj9oiXU= Received: by mail-wr1-f41.google.com with SMTP id g17so18621049wro.2 for ; Mon, 23 Dec 2019 18:29:53 -0800 (PST) X-Gm-Message-State: APjAAAVb2qYyMSD0/+JWvOYSqEz+14OBf4NC50d3t62riM7GZQGLYy5q gVOZ+VmGb+VTRVz0Rv6bWRske9v5j5qR44+W3VmH8w== X-Received: by 2002:adf:eb09:: with SMTP id s9mr34152116wrn.61.1577154591966; Mon, 23 Dec 2019 18:29:51 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andy Lutomirski Date: Mon, 23 Dec 2019 18:29:39 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 05/10] lib: vdso: inline do_hres() To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Arnd Bergmann , Thomas Gleixner , Vincenzo Frascino , Andrew Lutomirski , LKML , linuxppc-dev , linux-arm-kernel , "open list:MIPS" , X86 ML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 23, 2019 at 6:31 AM Christophe Leroy wrote: > > do_hres() is called from several places, so GCC doesn't inline > it at first. > > do_hres() takes a struct __kernel_timespec * parameter for > passing the result. In the 32 bits case, this parameter corresponds > to a local var in the caller. In order to provide a pointer > to this structure, the caller has to put it in its stack and > do_hres() has to write the result in the stack. This is suboptimal, > especially on RISC processor like powerpc. > > By making GCC inline the function, the struct __kernel_timespec > remains a local var using registers, avoiding the need to write and > read stack. > > The improvement is significant on powerpc. I'm okay with it, mainly because I don't expect many workloads to have more than one copy of the code hot at the same time.