From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE83BEEDB; Thu, 6 Jun 2024 01:43:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717638215; cv=none; b=bef72ZMolWjS1exCy6K7USv+Cg1WlOfniXz5PEYOLozAk/owXfflb1PizaGpP2cgmi+LJYAuaEhd49gK6L87Xopf0oylOndDP9rJH0t+8e6VS/jX1mOtd9qcKwgDBc6Ep4WUiBdg61pep9tE770B/BT3GevwMJlPgGyX4ZHpa1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717638215; c=relaxed/simple; bh=njaB7xwtRqM5zOvkd98x7fcmkQz3EohBYZ74D1OJmrE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ag59Kyqhh0Y0qvsTi7wR/n1DIwtS8oktj4g4CKKPWJa6NGaUHRaLDahdGgk/5r4r1sV4HTMQ9jbwToM2KOATid75U+jNZZC2aub7SXDnRYDS8En2wBPv3oO3ukKof5yJ936xqStuI21cA9eHO1M5fHScDAs8h3YXgpx4Z/CS6YQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE1A6C3277B; Thu, 6 Jun 2024 01:43:28 +0000 (UTC) Date: Wed, 5 Jun 2024 21:43:31 -0400 From: Steven Rostedt To: Andrew Lunn Cc: Jason Gunthorpe , Paolo Abeni , Mina Almasry , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Donald Hunter , Jonathan Corbet , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Andreas Larsson , Jesper Dangaard Brouer , Ilias Apalodimas , Masami Hiramatsu , Mathieu Desnoyers , Arnd Bergmann , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Steffen Klassert , Herbert Xu , David Ahern , Willem de Bruijn , Shuah Khan , Sumit Semwal , Christian =?UTF-8?B?S8O2bmln?= , Pavel Begunkov , David Wei , Yunsheng Lin , Shailend Chand , Harshitha Ramamurthy , Shakeel Butt , Jeroen de Borst , Praveen Kaligineedi , Willem de Bruijn , Kaiyuan Zhang Subject: Re: [PATCH net-next v10 05/14] netdev: netdevice devmem allocator Message-ID: <20240605214331.34d9583e@gandalf.local.home> In-Reply-To: References: <20240530201616.1316526-1-almasrymina@google.com> <20240530201616.1316526-6-almasrymina@google.com> <20240604121551.07192993@gandalf.local.home> <20240604163158.GB21513@ziepe.ca> <20240604124243.66203a46@gandalf.local.home> <3be107ce-3d9f-4528-b9f7-1c9e38da0688@lunn.ch> <20240604202738.3aab6308@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 5 Jun 2024 02:52:29 +0200 Andrew Lunn wrote: > > How is a compiler going to know that? > > It might have some heuristics to try to guess unlikely/likely, but > that is not what we are talking about here. > > How much difference did 'always_inline' and 'noinline' make? Hopefully > the likely is enough of a clue it should prefer to inline whatever is > in that branch, where as for the unlikely case it can do a function > call. Perhaps, but one of the issues was that I have lots of small functions that are used all over the place, and gcc tends to change them to function calls, instead of duplicating them. I did this analysis back in 2016, so maybe it became better. > > But compilers is not my thing, which is why i would reach out to the > compiler people and ask them, is it expected to get this wrong, could > it be made better? Well, I actually do work with the compiler folks, and we are actually trying to get a session at GNU Cauldron where Linux kernel folks can talk with the gcc compiler folks. I've stared at so many objdump outputs, that I can now pretty much see the assembly that my C code makes ;-) -- Steve