Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1329887ybl; Fri, 30 Aug 2019 16:17:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzV0yyhtACSKkFCmogH9jZ+bGkZQvN0gTMsZ0Apn/i+aSC37+XqGvowqFSQb7ate1gqtMna X-Received: by 2002:a65:62cd:: with SMTP id m13mr14798849pgv.437.1567207028441; Fri, 30 Aug 2019 16:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567207028; cv=none; d=google.com; s=arc-20160816; b=uKVYK6YYVshWMLJYbRpsn/SPDRLF9pAjo42c8XZVDUfMwFGzJwXbSVtR4SILbdRNLR Sj4NiHlAd81uHeTf3fm7hZ7YM2dp2OzWQuyjGWbSPg8QbxQkmxh8VWroTMvvPOPoOUzM kdwx9uc9YEBj2wBNKqcYPXwRsZUNp6xXRDJ1bBHARj6zURyQpOP2utA8Rjlhmviro1/v SbLoUDZYf7UrggdMQ3no73goV8qFtnNUKnZWJVbZbYwpJyBOTw2CoW+WtVk+i5HVv7Tx Q7o0vpuHPAqHkKqfVCcc6brP+VWJtFzhng+w6/XxfZl5fsKoPgUKZEDGu8x0fsBabqPE 4YpQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JgLR6Eqt8jfsgQZgs5aBVeUPiD11IsQFXRalFsn+2h4=; b=iUfUOzA/ci8fkM3SihvH82BA1a8nsJR3q6kgdHxcc5dU1mMjpBpfLqT6fLt9z8vi+e +d+NbcJQk8DUMFxgOcEFTbP8Uwc2P33XwqGPpqXkEGATlXXICgTRxNjoqQnYRI+qOEsE 164DQ7qfeC5WCqMKhEUaLSFB7dsKHPVix75OF+ub5k9Czq+9GDWWWh+KmnQhd7s2lpdt KUcc+6hyGc4/o6kA0G5Mma66Pa0fX0WkbQFgCifw/5sneuiDlYWyENvUXEOfxP/LaED/ HQJF0f5VhOe8eTzZtw0G5ND7GwpfwUxzt4JCUA8YNpE3fY33dC5n/pufSv9e7+Nj2swk SjoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=SEyfKpx+; 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 j18si5278835pgh.186.2019.08.30.16.16.53; Fri, 30 Aug 2019 16:17:08 -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; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=SEyfKpx+; 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 S1728524AbfH3XPq (ORCPT + 99 others); Fri, 30 Aug 2019 19:15:46 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:36218 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728480AbfH3XPl (ORCPT ); Fri, 30 Aug 2019 19:15:41 -0400 Received: by mail-ed1-f66.google.com with SMTP id g24so9746262edu.3 for ; Fri, 30 Aug 2019 16:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JgLR6Eqt8jfsgQZgs5aBVeUPiD11IsQFXRalFsn+2h4=; b=SEyfKpx+UxdmCsImA4NLZZVWJ0Qc7uZoy3V9wb5N7x6SfGZ6OBGkohHadaiHd5Gj9W GOhE+amAdonKoqRYvNSkuCIc4WvUouS4zt2RSP5UR8HUOz4Xoxo/yP2zugiG8WFh1cJj 8EWjQ+fE1yv2bFmRCJIwOvbJyC5Wm0Nl1Qg7s= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=JgLR6Eqt8jfsgQZgs5aBVeUPiD11IsQFXRalFsn+2h4=; b=MAs5j7iDKY/flV+Grm/BIWGSrbSlrRzH9h+yoecXLMO2FCo1rO2A05x/LbcMTew0xs 0vuubNPvI44ilypkv8nWhZ77IGG2ZsFGwxmOuXn4VxUa4/nnOGi4Xy2ffOjcgq7fcWIB YZdwTqXDSsBEvh+2tXLNVCTr+iqj+JmPjVFvWQq6EipPA0ZIrpNjFkFf7P68vr0Eom6a FgWoUraXX3eSG6RnZa5v3sOGPknL0OL4eohpajLUeUTpceZXd3tGPEGrYznyixSAdPOU urL+gh9PacL8GewfFJVx9ZTlxVynCWCOnSeGjVzGT0tnKMxXRz4/sUSxGl+8lpxCVVmb bUZw== X-Gm-Message-State: APjAAAVIGH97G8m9Yk8m0J7xDayCdZXncQGsH4Djx/3kNJJyepe1glSt zNmkW1HkKcmfsFHxhSeJjLgfyw== X-Received: by 2002:a17:906:5c49:: with SMTP id c9mr8555292ejr.78.1567206939423; Fri, 30 Aug 2019 16:15:39 -0700 (PDT) Received: from prevas-ravi.prevas.se (ip-5-186-115-35.cgn.fibianet.dk. [5.186.115.35]) by smtp.gmail.com with ESMTPSA id s4sm875457ejx.33.2019.08.30.16.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2019 16:15:38 -0700 (PDT) From: Rasmus Villemoes To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Nadav Amit , Linus Torvalds , Miguel Ojeda , ndesaulniers@google.com, Rasmus Villemoes Subject: [PATCH v2 6/6] x86: bug.h: use asm_inline in _BUG_FLAGS definitions Date: Sat, 31 Aug 2019 01:15:27 +0200 Message-Id: <20190830231527.22304-7-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190830231527.22304-1-linux@rasmusvillemoes.dk> References: <20190829083233.24162-1-linux@rasmusvillemoes.dk> <20190830231527.22304-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This helps preventing a BUG* or WARN* in some static inline from preventing that (or one of its callers) being inlined, so should allow gcc to make better informed inlining decisions. For example, with gcc 9.2, tcp_fastopen_no_cookie() vanishes from net/ipv4/tcp_fastopen.o. It does not itself have any BUG or WARN, but it calls dst_metric() which has a WARN_ON_ONCE - and despite that WARN_ON_ONCE vanishing since the condition is compile-time false, dst_metric() is apparently sufficiently "large" that when it gets inlined into tcp_fastopen_no_cookie(), the latter becomes too large for inlining. Overall, if one asks size(1), .text decreases a little and .data increases by about the same amount (x86-64 defconfig) $ size vmlinux.{before,after} text data bss dec hex filename 19709726 5202600 1630280 26542606 195020e vmlinux.before 19709330 5203068 1630280 26542678 1950256 vmlinux.after while bloat-o-meter says add/remove: 10/28 grow/shrink: 103/51 up/down: 3669/-2854 (815) ... Total: Before=14783683, After=14784498, chg +0.01% Signed-off-by: Rasmus Villemoes --- arch/x86/include/asm/bug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index 6804d6642767..facba9bc30ca 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -32,7 +32,7 @@ #define _BUG_FLAGS(ins, flags) \ do { \ - asm volatile("1:\t" ins "\n" \ + asm_inline volatile("1:\t" ins "\n" \ ".pushsection __bug_table,\"aw\"\n" \ "2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n" \ "\t" __BUG_REL(%c0) "\t# bug_entry::file\n" \ @@ -49,7 +49,7 @@ do { \ #define _BUG_FLAGS(ins, flags) \ do { \ - asm volatile("1:\t" ins "\n" \ + asm_inline volatile("1:\t" ins "\n" \ ".pushsection __bug_table,\"aw\"\n" \ "2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n" \ "\t.word %c0" "\t# bug_entry::flags\n" \ -- 2.20.1