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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,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 8382AC433DF for ; Fri, 29 May 2020 16:13:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 40B0B20897 for ; Fri, 29 May 2020 16:13:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="V2vJfvPF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40B0B20897 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9E9F78001A; Fri, 29 May 2020 12:13:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99AE780010; Fri, 29 May 2020 12:13:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8AFE38001A; Fri, 29 May 2020 12:13:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 7520D80010 for ; Fri, 29 May 2020 12:13:42 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 2E7E3181AEF0B for ; Fri, 29 May 2020 16:13:42 +0000 (UTC) X-FDA: 76870252284.03.water09_778ed3ae3c819 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 109C6181A3 for ; Fri, 29 May 2020 16:13:42 +0000 (UTC) X-HE-Tag: water09_778ed3ae3c819 X-Filterd-Recvd-Size: 4091 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Fri, 29 May 2020 16:13:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xKE4iU4tL+hNaGx/FSTJV5asiZmclaundn7b5eVYaJA=; b=V2vJfvPFWaLSd/C8i8efXx0Oae 8eabsyjI/uaqb/8MWLPjD2t7RHs6xqCboxmyOZvHENqIOnPQ9SITwT+8+nrq+etzD4SDYffWmv9uG RBw6KKbt6WdM9PofbYUY1/XPERVENziT80bPAeONAW7O/EnmRvpDPjiQ0N9K/LkHWaQnn2EkfkLeF VhGKawKxETn6Bk0ZOXhohHvuang7C6oCETIY7kIELtmWZh2HZhrYMeHn5c6OawEHV9NvFn8CjEnWP 1SnJlGWzCwlGglVUV/kJtIkWGnwmOQt8yOfx2qAvuP3zREApQz9oZm/lYFW7TMbJws6Bio4+zLwME bIrqxtjg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jehct-0000rm-3K; Fri, 29 May 2020 16:12:55 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7A7AC30047A; Fri, 29 May 2020 18:12:53 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 418422BABEA78; Fri, 29 May 2020 18:12:53 +0200 (CEST) Date: Fri, 29 May 2020 18:12:53 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Christoph Hellwig , Randy Dunlap , Andrew Morton , broonie@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-next@vger.kernel.org, mhocko@suse.cz, mm-commits@vger.kernel.org, sfr@canb.auug.org.au, Linus Torvalds , viro@zeniv.linux.org.uk, x86@kernel.org, Steven Rostedt Subject: Re: mmotm 2020-05-13-20-30 uploaded (objtool warnings) Message-ID: <20200529161253.GD706460@hirez.programming.kicks-ass.net> References: <20200514033104.kRFL_ctMQ%akpm@linux-foundation.org> <611fa14d-8d31-796f-b909-686d9ebf84a9@infradead.org> <20200528172005.GP2483@worktop.programming.kicks-ass.net> <20200529135750.GA1580@lst.de> <20200529143556.GE706478@hirez.programming.kicks-ass.net> <20200529145325.GB706518@hirez.programming.kicks-ass.net> <20200529153336.GC706518@hirez.programming.kicks-ass.net> <20200529160514.cyaytn33thphb3tz@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200529160514.cyaytn33thphb3tz@treble> X-Rspamd-Queue-Id: 109C6181A3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, May 29, 2020 at 11:05:14AM -0500, Josh Poimboeuf wrote: > It looks to me like GCC is doing the right thing. That likely() > translates to: > > # define likely(x) (__branch_check__(x, 1, __builtin_constant_p(x))) > > which becomes: > > #define __branch_check__(x, expect, is_constant) ({ \ > long ______r; \ > static struct ftrace_likely_data \ > __aligned(4) \ > __section(_ftrace_annotated_branch) \ > ______f = { \ > .data.func = __func__, \ > .data.file = __FILE__, \ > .data.line = __LINE__, \ > }; \ > ______r = __builtin_expect(!!(x), expect); \ > ftrace_likely_update(&______f, ______r, \ > expect, is_constant); \ > ______r; \ > }) > > Here 'x' is the call to user_access_begin(). It evaluates 'x' -- and > thus calls user_access_begin() -- before the call to > ftrace_likely_update(). > > So it's working as designed, right? The likely() just needs to be > changed to likely_notrace(). But if !x (ie we fail user_access_begin()), we should not pass STAC() on the way to out_err. OTOH if x, we should not be jumping to out_err. I'm most confused... must not stare at asm for a while.