From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D81E4C2D0C0 for ; Tue, 24 Dec 2019 02:29:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9134206D3 for ; Tue, 24 Dec 2019 02:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577154594; bh=DSQS0uHBNC9Ui3z1SA4ieLxiBxYjVLA1pvOoujpbOvo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=0IF4lJRFwmjrD2quZmPn3C2gbErEGTt0Ya//Yl4jZjmW3h9gnA4V4/Z9+7e3T9Ptf vJqZ02xlbK9S5QmOsxZYpcNjpp4ips1EchiMK+nZrjtfXd1NcKMM7mzvwHNK+SQKOa OukIN0V7W9O1E/fddrMsoVeK/F8Woj7SzU2aOBn4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726995AbfLXC3y (ORCPT ); Mon, 23 Dec 2019 21:29:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:51626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726976AbfLXC3y (ORCPT ); Mon, 23 Dec 2019 21:29:54 -0500 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 8713121927 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-f53.google.com with SMTP id q6so18588528wro.9 for ; Mon, 23 Dec 2019 18:29:53 -0800 (PST) X-Gm-Message-State: APjAAAVGush15QS6isS00kAAC2ALuGSiEz7mSZ+Hbtnxgp3fS3R3DpsW HW+89uSLxkimYH2kiBZ0Kc1WVVGt10eN4VsYfpa2Ww== X-Google-Smtp-Source: APXvYqz5QXY27AstGyElWlUnUHM0Y/Cls6krR6JAY/F6G6Ra4+oArxsi2W6pHlVu1RWJHAU5CqdrqYSugVUavqgLJoc= 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-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@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.