Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2452505ybl; Thu, 9 Jan 2020 13:03:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwXVt0jtXeFuQnzRHiqnmprCSQ2MgWGFC6564e/l7f9AbvhuhKac+wLQspHvW+yqmxn/rfQ X-Received: by 2002:aca:72d0:: with SMTP id p199mr5114102oic.40.1578603783239; Thu, 09 Jan 2020 13:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578603783; cv=none; d=google.com; s=arc-20160816; b=urFaCigwYbT3vjtxkfaqI4wKKE+vZ5ykDRqFpiS5pPfKBACsIqtXJvqE1CVH+d2diW +1UgTmblP00Glv/nu4kQTCv8pelsR05fNxW8/rIoVOxfRjyXpeOYK983HDi//pqjCKdl CqMwim6FhYr2eBiIfgQDITB8UVg0IOO/Vu4wVH3GqJ/OJLCiwyH93BnzCx/pubSubrH+ /4Ymk4Uy6VczDJkRc55Vmk9kUbkNSgkGVcxKBDBckc7gDSEjSTna2WZTB+YS/nIvv8kf NgL6eJCprYFsbR2lfuiEAU47jp/Aw0fFgleHM+4HyhXEBBVGOGLoqC14VkO9wERnrzRH /PVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:dkim-signature; bh=FYx4kyu0guKehGok9fASqGVuxxVoy/XJcQO7YPTYaQc=; b=cUvD6HrMBr0odAYV+5cp6CR3bI5p6X1XX2lt1rNk5v9sbQifL0CZ9ICtEI+k9ECuh/ Cs1c3SR3S+vE1GAa5roHXZukTLAVELgBaQx1w+S0CyZplQdBN23GUrtpsQhEiWIBxgWn I4cjQuW9Xi+6T1uFUsd6aUfFnVCt07XQy6+ca4k2c6FaVbqGGEd89zbxDPo+RAJuSEtn ADnpfOR9iQzMg74pVCS0F9WVxzYxg78lRwk8xSxOwUWWfx3MPZvKLuuKWjqnGnML0g6Z 9n91gG5ivUUN5RHYAyiYybEqaiVdNB/Amgg7jOQkip66R7rMlFhup39e2WK7ynaN1lnC IDdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=F2yrOYUt; 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 y140si4294754oia.49.2020.01.09.13.02.51; Thu, 09 Jan 2020 13:03:03 -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=F2yrOYUt; 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 S2388359AbgAIRwh (ORCPT + 99 others); Thu, 9 Jan 2020 12:52:37 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:55070 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730326AbgAIRwh (ORCPT ); Thu, 9 Jan 2020 12:52:37 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 47ttxG2WM3z9txHp; Thu, 9 Jan 2020 18:52:34 +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=F2yrOYUt; 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 D9ctLdBUZqbw; Thu, 9 Jan 2020 18:52:34 +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 47ttxG1NMwz9txHl; Thu, 9 Jan 2020 18:52:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1578592354; bh=FYx4kyu0guKehGok9fASqGVuxxVoy/XJcQO7YPTYaQc=; h=From:Subject:To:Cc:References:Date:In-Reply-To:From; b=F2yrOYUt44TvH+5O/nMl5vMshj2XKIRHohr5s+oeadn2dM2WIQzI2nCl/M7lAIkXW JxBLJ5s3We6Cyg3fWHtSz+ys/3or+bNkpzqXxrzX1drGWe8AHYgvp4LxAr7x2nNkum EEx91AF9jbgNwX3yge3UCqm+YIsT3UIhyIUywk4Y= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E09AE8B82E; Thu, 9 Jan 2020 18:52:35 +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 za-1hAB_sfui; Thu, 9 Jan 2020 18:52:35 +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 0F7B48B82D; Thu, 9 Jan 2020 18:52:35 +0100 (CET) From: Christophe Leroy Subject: Surprising code generated for vdso_read_begin() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , arnd@arndb.de, tglx@linutronix.de, vincenzo.frascino@arm.com, luto@kernel.org, Segher Boessenkool Cc: x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org References: Message-ID: Date: Thu, 9 Jan 2020 17:52:34 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wondering why we get something so complicated/redundant for vdso_read_begin() static __always_inline u32 vdso_read_begin(const struct vdso_data *vd) { u32 seq; while ((seq = READ_ONCE(vd->seq)) & 1) cpu_relax(); smp_rmb(); return seq; } 6e0: 81 05 00 f0 lwz r8,240(r5) 6e4: 71 09 00 01 andi. r9,r8,1 6e8: 41 82 00 10 beq 6f8 <__c_kernel_clock_gettime+0x158> 6ec: 81 05 00 f0 lwz r8,240(r5) 6f0: 71 0a 00 01 andi. r10,r8,1 6f4: 40 82 ff f8 bne 6ec <__c_kernel_clock_gettime+0x14c> 6f8: r5 being vd pointer Why the first triplet, not only the second triplet ? Something wrong with using READ_ONCE() for that ? Christophe