From patchwork Thu Oct 12 22:59:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salyzyn X-Patchwork-Id: 10003247 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 566BE602BF for ; Thu, 12 Oct 2017 23:49:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3644F27F60 for ; Thu, 12 Oct 2017 23:49:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26F6D285FE; Thu, 12 Oct 2017 23:49:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B41427F60 for ; Thu, 12 Oct 2017 23:49:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=EQ3SNYKKa5RFylXc7/0ZYsP53VLXc0XANQne3duCiRk=; b=tJU 0SVPkQyqfZ6VzQ6YIC1iCP494TnTfcrjwCkxsm5TXunPvxxbOrKNYyYRxkaZhDMr3ep8i7+5KCkM6 c75Yb1o5yYXU6fgU6ssRAsrkxcm9IDXvDi5kJ1B2FaLAw8K+FZXBlOxCBLkuWyAdTT4nKUKaYuiYS MS/IisCiwMk7dssYtO9CEzb7DpWwYkXbX8v2Scned1n4039CbMP2Ix2mAEBsRKMAxUHH+KM641vQf phgssCV8Plnsd5kFZL0X5bylx3L4SMJWAxKYVs0bFJqUEu8HoTkcNsK907N1ZkF+M9GoLuIvsVne6 BaxYon+P+g0qPdp6saU8wMvv5cRunhw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e2nE2-0000Vg-UT; Thu, 12 Oct 2017 23:49:14 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2nE0-0000RZ-QF for linux-arm-kernel@bombadil.infradead.org; Thu, 12 Oct 2017 23:49:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GptitRWAqONPbQ18t98TM2W8qKFPppnouLT3ECTgqaY=; b=uE4+3H2n4iS998nmGqymFqELv dXWwcARXM3wKexVqgVq+VILjFqw90ehlQHDzPRgoARNpHORxf/DLggbpSAeatKH7IB9p4Q8pLOcgZ jIpoJA2EkiYakUB9Ci6UWKlYGxb4VcULQ8bjv2SDyvjtBaksEgpJuOtbTQkcNyJ0QVBoTide8ZLC/ wnyYQZyUl0JmmW/U8lKYIpWTFUXdNx9U3nQCsEF1QI3s972ezRzPGNBCq3ZgehkzBkpCLC8V9ML4k Vn5MdVZJD/ga+/COx5qwLGRFG48HA+2spUbH0pI3lPSSBJ6Mfo4pA1I6oXLB5N6xIIhpOSWzkoHGr LDpjpl2rw==; Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2mSq-0007LA-Vk for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2017 23:00:29 +0000 Received: by mail-pf0-x22c.google.com with SMTP id d28so7051970pfe.2 for ; Thu, 12 Oct 2017 16:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GptitRWAqONPbQ18t98TM2W8qKFPppnouLT3ECTgqaY=; b=eW/E2cVHI0EJu6RDnWscCh90Khls7/VgRHeg8RgRZnV2Yv1YkuLmtRRSy0n7se2hAH c80Ugvzs6NHB6m0CB9SJPwl2W6qDekPxgX7K863qFH4bhORO9xIR3VZ1r7P7RES6y4Ce yfWQ6sRrDiB6putUZv4DPQLTR7DpEUKfvxPrDjrpUHA7qxnL7CZJJgK5WYo+yZubOIKn e9In5R+HzRuwWfxLm232gMxgTg6TVuP4EvpNubwV6SBf2455SZsZ4p0cUxvjuLxeJy4n IlcS/wCsWm9ecHOE634sY2GyS3lspNweFJBsSvNcx83kjwWVQd2o9iJYHVjX8aOznztf rVtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GptitRWAqONPbQ18t98TM2W8qKFPppnouLT3ECTgqaY=; b=NYwGp/XYpCtsZFr3JF7ci6tlYHo3Qlw3shAETRrYex3s8F+mZ2ANoPEnwbw4sN0IKA 9a+D8D1dFklnQzkQDvIH+kZZ6ZWV4EB+/RSsKlQ80BgJTM63yYEUuBID6OD55Dm10M3P MUtVFXEWBhVbrhgXU/W24KuwFoLiEASYDKBHo/ihbO6VVAMJu7PdVmYHo6uXKrkTJ4/n CdTVaB5yuxL51ASwArjSXCRG881rUF305Zw4mnHBatWTw58+rFzHZKr2vUEG1y9HZEin r8ADuALcJQnrO/Coj8P2dOqc6v3Q8Oj7KHQaL48zyMX081ZRm984hR2XBlLheL0EvH09 dxsQ== X-Gm-Message-State: AMCzsaVSMAWvYobgaPNXRCRY0zHWEK7UgMZh8+P5Lh7a4QcCjwpWr6YM MEZHic5TFzvIOhY1FVq9sF+z/Q== X-Google-Smtp-Source: AOwi7QD1kQC4Dhndq3Pbfl7PRX8R7+LFM4JegQkbkE2OKHVwr6JlWDIed86YfxD8aEJl2JrBVBKd+g== X-Received: by 10.99.163.1 with SMTP id s1mr1403515pge.310.1507849203210; Thu, 12 Oct 2017 16:00:03 -0700 (PDT) Received: from nebulus.mtv.corp.google.com ([100.98.120.17]) by smtp.gmail.com with ESMTPSA id y3sm14568477pfe.68.2017.10.12.16.00.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 16:00:02 -0700 (PDT) From: Mark Salyzyn To: linux-kernel@vger.kernel.org Subject: [PATCH v2 4/10] arm: vdso: enforce monotonic and realtime as inline Date: Thu, 12 Oct 2017 15:59:52 -0700 Message-Id: <20171012225956.86705-1-salyzyn@android.com> X-Mailer: git-send-email 2.15.0.rc0.271.g36b669edcc-goog X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, james.morse@arm.com, Russell King , Mark Salyzyn , Mark Salyzyn MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Ensure monotonic and realtime are inline, small price to pay for high volume common request. Signed-off-by: Mark Salyzyn v2: split first CL into 4 of 7 pieces --- arch/arm/vdso/vgettimeofday.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/vdso/vgettimeofday.c b/arch/arm/vdso/vgettimeofday.c index 5f596911bd53..71003a1997c4 100644 --- a/arch/arm/vdso/vgettimeofday.c +++ b/arch/arm/vdso/vgettimeofday.c @@ -99,7 +99,7 @@ static notrace int do_monotonic_coarse(const struct vdso_data *vd, #ifdef CONFIG_ARM_ARCH_TIMER -static notrace u64 get_ns(const struct vdso_data *vd) +static __always_inline notrace u64 get_ns(const struct vdso_data *vd) { u64 cycle_delta; u64 cycle_now; @@ -115,7 +115,9 @@ static notrace u64 get_ns(const struct vdso_data *vd) return nsec; } -static notrace int do_realtime(const struct vdso_data *vd, struct timespec *ts) +/* Code size doesn't matter (vdso is 4k/16k/64k anyway) and this is faster. */ +static __always_inline notrace int do_realtime(const struct vdso_data *vd, + struct timespec *ts) { u64 nsecs; u32 seq; @@ -137,7 +139,8 @@ static notrace int do_realtime(const struct vdso_data *vd, struct timespec *ts) return 0; } -static notrace int do_monotonic(const struct vdso_data *vd, struct timespec *ts) +static __always_inline notrace int do_monotonic(const struct vdso_data *vd, + struct timespec *ts) { struct timespec tomono; u64 nsecs;