Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3783088imm; Mon, 8 Oct 2018 09:25:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV63MvtxUNDF+6DYX1CzwRbq3+jdSt62w3A2l2VUf5sK7Ag88XyMRnbknWVw2EemT7YUY1nCi X-Received: by 2002:a17:902:5993:: with SMTP id p19-v6mr24611886pli.260.1539015910796; Mon, 08 Oct 2018 09:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539015910; cv=none; d=google.com; s=arc-20160816; b=T0+T10rCCKnu/81/vYYDmwS1SYzhUoi1vd6vGEZMVB55bnuyP1QFK5xTNl1+Qd/1h7 xNsVxulTFy+/Lf40r6/7s+Q74EIUC+i2DoUFSMfnx13OE6kRgtTrs0mGixDnlR/RuM+X 02JxtKv0ecTkXxgB9HzIK6Mt2f+0HW3PqzpiOla8VuiXCOVSR9OrcSIZ56C6d7vl7DiK aPybY3M3mrq5rYtCwVLg1jLLCW2WXAyTO1qDk4H3tTq6v6REIpH9x2aeKKvptlpUg8iR QD2NKZFjjbpDUjakfqa9V3C+aL2jeZf4DVPjEBUvI9PBpWvnhw+iFNqzxwhAXlx/E1mB fwqg== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=obj/OJDOTlkDDN82ot/U22YAhAIu+OWAblXcZ2Sdwvg=; b=EJua5RIlzj0hE06QhWZ6E7Xher6SZJplQJ/OM21Dfsqg+d43ETIJtalj0JX/5wLoud qPYYfSw0qSzxN/SS6iBZ5DY+9H8NVikDKQ7bwSCLc5F7G47N+4kJ5CZt2qL8QE0K5X2V poW499Z6QzNwzJauqa0Zq3Y15Qdr7ssPgSXHbRep9X/xFeZhWu4XdL+PA7vodyXFQOGR XwU1YRDHfPiHcayGiQi59Si+ORoXBOF2sCfuc6S9F15bClwZCnhSTni6iTctMLCscxjX MDUwiTtiYtmnt3zuwj2z1QzAnngE9lHMlALIR7BPApi1CmFznprL1AmsKD7MUfzySEQD yWHg== 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 o18-v6si18997120pfj.25.2018.10.08.09.24.55; Mon, 08 Oct 2018 09:25:10 -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 S1726725AbeJHXgo convert rfc822-to-8bit (ORCPT + 99 others); Mon, 8 Oct 2018 19:36:44 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([146.101.78.151]:60038 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbeJHXgo (ORCPT ); Mon, 8 Oct 2018 19:36:44 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-5-47QI0Q_NP5m09-sOej_yfg-1; Mon, 08 Oct 2018 17:24:12 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 8 Oct 2018 17:24:12 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 8 Oct 2018 17:24:12 +0100 From: David Laight To: 'Michael Matz' , Segher Boessenkool CC: Borislav Petkov , "gcc@gcc.gnu.org" , Richard Biener , Nadav Amit , "Ingo Molnar" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "Masahiro Yamada" , Sam Ravnborg , "Alok Kataria" , Christopher Li , "Greg Kroah-Hartman" , "H. Peter Anvin" , Jan Beulich , Josh Poimboeuf , Juergen Gross , Kate Stewart , Kees Cook , "linux-sparse@vger.kernel.org" , Peter Zijlstra , Philippe Ombredanne , Thomas Gleixner , "virtualization@lists.linux-foundation.org" , Linus Torvalds , Chris Zankel , "Max Filippov" , "linux-xtensa@linux-xtensa.org" Subject: RE: PROPOSAL: Extend inline asm syntax with size spec Thread-Topic: PROPOSAL: Extend inline asm syntax with size spec Thread-Index: AQHUXlXo64INA1O8UEmnaVydWfJQNqUViHqQ Date: Mon, 8 Oct 2018 16:24:12 +0000 Message-ID: <14efacd19a76488c8771b9781dec34c0@AcuMS.aculab.com> References: <20181003213100.189959-1-namit@vmware.com> <20181007091805.GA30687@zn.tnic> <20181007132228.GJ29268@gate.crashing.org> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: 47QI0Q_NP5m09-sOej_yfg-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Matz > Sent: 07 October 2018 16:53 ... > I think the examples I saw from Boris were all indirect inlines: > > static inline void foo() { asm("large-looking-but-small-asm"); } > static void bar1() { ... foo() ... } > static void bar2() { ... foo() ... } > void goo (void) { bar1(); } // bar1 should have been inlined > > So, while the immediate asm user was marked as always inline that in turn > caused users of it to become non-inlined. I'm assuming the kernel guys > did proper measurements that they _really_ get some non-trivial speed > benefit by inlining bar1/bar2, but for some reasons (I didn't inquire) > didn't want to mark them all as inline as well. Could you add a 'size' attribute to the 'always inlined' foo() above rather than trying to add one to the asm() statement itself. Then add a warning in the documentation that small size attributes might make the assembly fail due to limited branch offsets (etc). Size '1' probably ought to be reserved for things that definitely fit in a delay slot. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)