Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp877563ybg; Sat, 26 Oct 2019 08:55:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxB44WC5rGp6D9AwzS1k98xtS1FId1UnXV5M6nSWram0wkj4zBY1WXTB374YfEl9jan+y42 X-Received: by 2002:a17:906:4813:: with SMTP id w19mr8850261ejq.258.1572105344478; Sat, 26 Oct 2019 08:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572105344; cv=none; d=google.com; s=arc-20160816; b=dKf9MAHECvBhvKGckV45w+pKTRq66Y+LFzw2MMSfASzxG5JWve42pAR5pg7Z6kEWX5 6XSe4UWFBn7exvhtwTBgl8/ExQ2XQNUJQVJYNUdG7GrrDs0NCXHeiU6r5zQhp9NuxV1Z 0JlWK1q5OtM/LxD8lUL23AqNs/js0f5dXNAT6tYsEC7OR41vx9N2o+jHKAExaHROrOIu tZ3FmLIxMkyR9QlG9LDzNGCG4/42QrhbbvFGLAAglpHBquGCcKZtkW7A9Cd1GPRY40wC l2q6+G1qbtLDQcDrQ91R2IXk2U2284RC4Av2wdI8+qoaQdghIusK+Gl2OJoyqWT9uHga NRGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=lCt7SL1m2Z7jpYQxYrjZMDnbaYpbDUdxCHhebMSueHw=; b=EI/onir7jIQcYnKekdBfLdK5ErbkRWLbGRhCvqW92Lu94ZASy2zVhytIsg68AOIHHc 4wLZ2qU/loTNT0frJ28dMKhSX+0WIK5Qr+/YvKFWxf7OIFLiSPXl6V4e7uqjq+e46cfJ lWJW2mxDG0hWsrnlUXW177VyUU01ocLIM2sPnxxkOR/DNvM7PsEf4/+CRQnJRyHZnk/L rgk22ylxgyz1p2CRNYCeGzG2xXz85Scku0rD+K5qZII5Colw1iFQ1383mUMRfp6tmY9d n4c2GlNva5Ksqt2GnLHzm6J2ylLHU5J/cdsZzX460Lu8chjOfiMUsBhbEaogZC63cvKZ 88nw== ARC-Authentication-Results: i=1; mx.google.com; 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 f3si3955829eda.251.2019.10.26.08.55.20; Sat, 26 Oct 2019 08:55:44 -0700 (PDT) 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; 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 S1726350AbfJZPxu (ORCPT + 99 others); Sat, 26 Oct 2019 11:53:50 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:40100 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbfJZPxt (ORCPT ); Sat, 26 Oct 2019 11:53:49 -0400 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iOONj-0005yK-PO; Sat, 26 Oct 2019 17:53:35 +0200 Date: Sat, 26 Oct 2019 17:53:34 +0200 (CEST) From: Thomas Gleixner To: Christophe Leroy cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , vincenzo.frascino@arm.com, luto@kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation. In-Reply-To: <95bd2367-8edc-29db-faa3-7729661e05f2@c-s.fr> Message-ID: References: <8ce3582f7f7da9ff0286ced857e5aa2e5ae6746e.1571662378.git.christophe.leroy@c-s.fr> <95bd2367-8edc-29db-faa3-7729661e05f2@c-s.fr> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-537953535-1572105215=:10190" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-537953535-1572105215=:10190 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 22 Oct 2019, Christophe Leroy wrote: > Le 22/10/2019 à 11:01, Christophe Leroy a écrit : > > Le 21/10/2019 à 23:29, Thomas Gleixner a écrit : > > > On Mon, 21 Oct 2019, Christophe Leroy wrote: > > > > > > > This is a tentative to switch powerpc/32 vdso to generic C > > > > implementation. > > > > It will likely not work on 64 bits or even build properly at the moment. > > > > > > > > powerpc is a bit special for VDSO as well as system calls in the > > > > way that it requires setting CR SO bit which cannot be done in C. > > > > Therefore, entry/exit and fallback needs to be performed in ASM. > > > > > > > > To allow that, C fallbacks just return -1 and the ASM entry point > > > > performs the system call when the C function returns -1. > > > > > > > > The performance is rather disappoiting. That's most likely all > > > > calculation in the C implementation are based on 64 bits math and > > > > converted to 32 bits at the very end. I guess C implementation should > > > > use 32 bits math like the assembly VDSO does as of today. > > > > > > > gettimeofday:    vdso: 750 nsec/call > > > > > > > > gettimeofday:    vdso: 1533 nsec/call > > > > Small improvement (3%) with the proposed change: > > > > gettimeofday:    vdso: 1485 nsec/call > > By inlining do_hres() I get the following: > > gettimeofday: vdso: 1072 nsec/call What's the effect for clock_gettime()? gettimeofday() is suboptimal vs. the PPC ASM variant due to an extra division, but clock_gettime() should be 1:1 comparable. Thanks, tglx --8323329-537953535-1572105215=:10190--