Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1391908ybn; Wed, 25 Sep 2019 17:39:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3oWxst8xRMe8DnGyoqMhTfr6MkFafqsF6e38/DM8kZllxfPWpCC7lC757Q4b0QEp+yZ6o X-Received: by 2002:a05:6402:17a2:: with SMTP id j2mr801489edy.121.1569458345969; Wed, 25 Sep 2019 17:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569458345; cv=none; d=google.com; s=arc-20160816; b=OpvZ8gysWswDqCWKqqnlR/RnHaI3yp8+VhdfrK3jBbkTuW0eS+4/GzxvORI/DWk/B0 PtIbDKuFvredHJvC+pxXUAtsZWXEH4r0Y6mx/VbqqdD/IsXrgxf+apE+SMBRzW6hu3sj 35jqHN+6E7zIpoQW1grt+DNlCKo+5JoX+WBxM83U7dbLjvsgExeMC2y8fDOlgUs6OwJO uWp1jQKOTVervBtwSv8aPmN/xV/ACCZitEY61dZZMIL2kHJffnmn8vx1zJzkDR0mefI5 gACJepzJZy2nQUJbkGlx+aMv0hlNtTdhTIwagl8owfDP6MtTzOPCWyy37a60hAtAbsGv qXCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=CfgrCcyEzfa/VSdhkATUkDR6dod2Tit2Tz5Usc6NZrs=; b=Te3YqXqz7RbzTaqkF4b3VyXCh0lsfUZWJqyhSuPyVIFg9A+7z93r1XKf1YYy207YWh +2mUrH90bPYcPjnTpDQsPxtqHqcmDjLFkexTc2BpmSVWdZAt+M8gBsc2BkqSq33Q+IDw HaPKDnJz1AnH80JLOGDCk+wUcWDWg0rbIaUDaj0SyNURTOzWBUTiatf3eEJ9nCgN3hKD R2tmFjXRWYbinN4cOXn2jYbxpB4u3E+Br5MmY5KeMRBHs9h2ZFF6SP03vK5UvnHQrwYI suPvxAcp9jN0Bf1Of5XL0tGOU4yvyyPQJQmi9NyTr0tmhtmPrsHmsCxXcW//ECHb2jMl ezlw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce9si222903ejb.347.2019.09.25.17.38.42; Wed, 25 Sep 2019 17:39:05 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408457AbfIXBzb (ORCPT + 99 others); Mon, 23 Sep 2019 21:55:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40188 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408444AbfIXBzb (ORCPT ); Mon, 23 Sep 2019 21:55:31 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2A2F3DE0F; Tue, 24 Sep 2019 01:55:30 +0000 (UTC) Received: from mail (ovpn-120-159.rdu2.redhat.com [10.10.120.159]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F0F8601A2; Tue, 24 Sep 2019 01:55:28 +0000 (UTC) Date: Mon, 23 Sep 2019 21:55:27 -0400 From: Andrea Arcangeli To: Paolo Bonzini Cc: Vitaly Kuznetsov , "Dr. David Alan Gilbert" , Marcelo Tosatti , Peter Xu , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 14/17] KVM: monolithic: x86: inline more exit handlers in vmx.c Message-ID: <20190924015527.GC4658@redhat.com> References: <20190920212509.2578-1-aarcange@redhat.com> <20190920212509.2578-15-aarcange@redhat.com> <6a1d66a1-74c0-25b9-692f-8875e33b2fae@redhat.com> <20190924010056.GB4658@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 24 Sep 2019 01:55:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 24, 2019 at 03:25:34AM +0200, Paolo Bonzini wrote: > On 24/09/19 03:00, Andrea Arcangeli wrote: > > Before and after this specific commit there is a difference with gcc 8.3. > > > > full patchset applied > > > > 753699 87971 9616 851286 cfd56 build/arch/x86/kvm/kvm-intel.ko > > > > git revert > > > > 753739 87971 9616 851326 cfd7e build/arch/x86/kvm/kvm-intel.ko > > > > git reset --hard HEAD^ > > > > 753699 87971 9616 851286 cfd56 build/arch/x86/kvm/kvm-intel.ko > > > > git revert > > > > 753739 87971 9616 851326 cfd7e build/arch/x86/kvm/kvm-intel.ko > > So it's forty bytes. I think we can leave this out. This commit I reverted adds literally 3 inlines called by 3 functions, in a very fast path, how many bytes of .text difference did you expect by dropping some call/ret from a very fast path when you asked me to test it? I mean it's just a couple of insn each. I thought the question was if gcc was already inlining without the hint or not or if it actually grew in size in case I got it wrong and there were many callers and it was better off not inline, so now I don't get what was the point of this test if with the result that confirms it's needed, the patch should be dropped. It's possible that this patch may not be relevant anymore with the rename in place of the vmx/svm functions, but if this patch is to be dropped with the optimal result, then I recommend you to go ahead and submit a patch to drop __always_inline from the whole kernel because if it's not good to use it here in a extreme fast path like handle_external_interrupt and handle_halt, then I don't know what __always_inline is good for anywhere else in the kernel. Thanks, Andrea