Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8317035ybl; Thu, 16 Jan 2020 14:30:05 -0800 (PST) X-Google-Smtp-Source: APXvYqzqwvWVfD/nqz+fB8mR26UcqdKcf8L8vowgrKp+tVVJg2b5K1Wigo3o64FYF3HH/o4ZrN3c X-Received: by 2002:aca:d4c1:: with SMTP id l184mr1166196oig.172.1579213805011; Thu, 16 Jan 2020 14:30:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579213805; cv=none; d=google.com; s=arc-20160816; b=iRT5N+NoeXG2RzYPv/ZxJ5q8luTaOR+YgK/XHxZ4o4H4SrzXkfw/dRXcVgXlU2aCts xQQIrMNlUbLny+CbsqLmipFQtByWvYZpMrvgb5Wk98+PGkQ1c2uLjjDK6a3FvQRRXMkC QSfd/PpeyELBwCUPt6hj5sx3bTj2jiWaVzotTvWCzCck9xuaiJzd+0GYG21f0t8AZmuM hmAGK2wBPmHAnRLyyyqWoUsQFeCG0lx2PB42iHznOsgLbQ+MZGl+GoD1UeQGJDg4YbbG nrLC0tR7W5eZsxA30tLZHijjhUQ6HWMmLZxuEBf843LxVqerD5mP/ev/7CtZpMBsu1W8 p2Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=8NMCNHuubcE6t4e17wk7DBu9YLriy2ZDehAsOAuF4AM=; b=Hhz9ANO4cFl+LeLeE9UqfibmcmcUcorFA/w0anOnodWL6BZ+P5kSiYO91czJcsVOwn DsSlT2fBURYpx5Ti3vwKKO1BYzZQ4ZgxmcJqv5HJaCYm+sAt/vA5s329lzG7YFUwyVEl +MbeTHWIy/9IC1NPBDKXyG5g6BJB3W2ubq1y3wFHfyjfo5Gd2VIeayZYaRC2WeAzAeq7 UyZK4zzBDo1lWqh8IrX/X5nh9c00+CLo6si0VY9xK6DUgJGuBSQArPLx6u6ZSXusa4Ul tEJ4hAjd+yxUhuLY5/8KENUcbunC8+g4trGqXLHePN4Y9N3k/eaJQsLD8yhqIjYDT6GE punA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=hu4ilqW7; 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 f204si10725313oia.43.2020.01.16.14.29.52; Thu, 16 Jan 2020 14:30:04 -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=@c-s.fr header.s=mail header.b=hu4ilqW7; 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 S2394717AbgAPR7F (ORCPT + 99 others); Thu, 16 Jan 2020 12:59:05 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:56142 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394630AbgAPR6d (ORCPT ); Thu, 16 Jan 2020 12:58:33 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 47zBks4rWmz9v3G9; Thu, 16 Jan 2020 18:58:29 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=hu4ilqW7; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id O51UVLooQNFG; Thu, 16 Jan 2020 18:58:29 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47zBks3d0qz9v0Mk; Thu, 16 Jan 2020 18:58:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1579197509; bh=8NMCNHuubcE6t4e17wk7DBu9YLriy2ZDehAsOAuF4AM=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=hu4ilqW7N3T8WujMXabIwtHKKTKsmMtwFUCZFVxCoaYZhizxdgG91lNwgD9tz6FyN uAxw87XR6KVTrvW4It/YMNKKcsT/90SNK/yrsdGq5RLmxki5jNn8tARXBLEi5E8HYL bOCKf2uGE6tihxiwW/DhFtaOPssrZOPbyYQhcHVo= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 282748B82A; Thu, 16 Jan 2020 18:58:31 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id viixK8XbZXYy; Thu, 16 Jan 2020 18:58:31 +0100 (CET) Received: from po14934vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id ABC488B82D; Thu, 16 Jan 2020 18:58:30 +0100 (CET) Received: by po14934vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 84AC364A33; Thu, 16 Jan 2020 17:58:30 +0000 (UTC) Message-Id: <2e730f4e6ef77be2d5bfc38273d8a622e2cb4f97.1579196675.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [RFC PATCH v4 06/11] powerpc/vdso: provide inline alternative to __get_datapage() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , nathanl@linux.ibm.com, arnd@arndb.de, tglx@linutronix.de, vincenzo.frascino@arm.com, luto@kernel.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, x86@kernel.org Date: Thu, 16 Jan 2020 17:58:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __get_datapage() is only a few instructions to retrieve the address of the page where the kernel stores data to the VDSO. By inlining this function into its users, a bl/blr pair and a mflr/mtlr pair is avoided, plus a few reg moves. The improvement is noticeable (about 55 nsec/call on an 8xx) With current __get_datapage() function: gettimeofday: vdso: 731 nsec/call clock-gettime-realtime-coarse: vdso: 668 nsec/call clock-gettime-monotonic-coarse: vdso: 745 nsec/call Using the __get_datapage macro provided by this patch: gettimeofday: vdso: 677 nsec/call clock-gettime-realtime-coarse: vdso: 613 nsec/call clock-gettime-monotonic-coarse: vdso: 690 nsec/call Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/vdso_datapage.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/asm/vdso_datapage.h index 4d7965bf369e..7342cc0c1ae4 100644 --- a/arch/powerpc/include/asm/vdso_datapage.h +++ b/arch/powerpc/include/asm/vdso_datapage.h @@ -105,6 +105,17 @@ struct vdso_arch_data { extern struct vdso_arch_data *vdso_data; +#else /* __ASSEMBLY__ */ + +.macro get_datapage ptr, offset=0 + bcl 20, 31, .+4 + mflr \ptr +#if CONFIG_PPC_PAGE_SHIFT > 14 + addis \ptr, \ptr, (_vdso_datapage + \offset - (.-4))@ha +#endif + addi \ptr, \ptr, (_vdso_datapage + \offset - (.-4))@l +.endm + #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ -- 2.13.3