From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB06731196D for ; Sun, 18 Jan 2026 22:58:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768777087; cv=none; b=notkMOM+SMGRiYXqZBBKZgjm+DghYHDjrmZrtf6G+L+7agDrQjKBknElpDP3cH/v09GA939ady+k3IEzrCuTaWlx0Hpx0niDijrytjqifGUCwayCEUx7GwP9EWeIJjuPQ3kfXgNwwcggUNP10qKC/wjhqL75WGePfIyMEmUyMrI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768777087; c=relaxed/simple; bh=1I1MOn7VsYdFW2g0y2syTgWaqsitpk1YdLsYX251mws=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DNMZQJxQH6wXrAB4lo/JZvcxw7uF5XrTLk0TQNqsb4AwHvjo9CjCcZdtPX7c3LoOJ8QoGxvhrtAQCA9NK8BqhQlilNSHZKf4kHRjMZqEu0m1IvTdaNTVF4BFZQMka5/4BKg1tR9QfPDeh66AqqD/sbBpWoj8isK97pnP/WBOg+s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nX8psjA5; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nX8psjA5" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-432d256c2a9so3713134f8f.3 for ; Sun, 18 Jan 2026 14:58:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768777084; x=1769381884; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=C+AoEirnNJ8wGXGTX+1JJR7Q6d2HFcn4CnXldkR9miw=; b=nX8psjA51zZSVGSRaMhEbPPfy1p8Rlis4vA0128w+cVit/sCzHv89UM2zpaHFZVUD2 uM1qRGKKX76f8CLUm6LGjMi6oeMtRjmoKsYvXfbUlAlqr4U2ws3r3Av6a8kB6NwjppE3 kURXr/LS/bRTD/LVZ/2l1CX/16JYd0cKw8fArr9T1SliLLX/yLLs69+g+6Kq4v4qM5F8 4p0z306RH2KCBOjyPKQ1yuyqOHz8U32DsIn+LynOoQmvIECLeljbhWKaB1fyQEFEcsUa 4EjognIdYvShNz2YqusmElMAoCKeZKBztzM/c45RAqeyGbb7L44oxZQgSAZlJ2jeZDRV hGXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768777084; x=1769381884; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=C+AoEirnNJ8wGXGTX+1JJR7Q6d2HFcn4CnXldkR9miw=; b=pluBguV9NkDEearfKlO0WO/druimPzjJNG1HLcewfeSao36zOv9Q37MKD6BsNQnOpT cy4b59G5x35ZWt98SZz6dBfko0HXuYBmwSzgNuZMgW63D/s0FhpWm/vv0V8T+FBFZX5t wJS6+NMyoxtsylDIIx8M3weSlyn24jtIxwkDaorBdTAbuEUng54wrfT9/FMBjBuTnrcG 85UOucide2+VI5Udg4JaR5z+hZWnnSLuA/WR/E2Nbgy1LdBS7rLM/h/rQ2LuL9ypgD4I yhFOZk1yZnjlY2BqLmc4KmEcE+wIscBENeXO3Mw8d2SY9rq/Q+FuwpVevnHre86aSZId qA9g== X-Forwarded-Encrypted: i=1; AJvYcCVaJ3MxZbvEYEEy/+iTb1H3uH2kSEErLQTX6WROsQ7Sj/sl8FLgZZyAgvAyZODnpY/DI1mMyxroEkudzMI=@vger.kernel.org X-Gm-Message-State: AOJu0YyPhjNGVEYGom32xz0SS3M7JW3TG8MZCvKFboV9cmS01vYBsIYk wBrv2RHa1kz/O4jiRqsyqjsBtYWdazT5TwMS4oMaVbnqLjscWI5ydWXt X-Gm-Gg: AY/fxX5pyNLlIQTPvhXPpsT57eC1JmQMq+iW10xQy+36Jos/CabY4Jsh+jHWWyzh386 zbb99M0OX8oqfwZ7JEnr221Uiaj/PVkMwd3xZ5IsiHCZQY35JNtFxbUxVxgYFmXnQKBteR+6U02 nb5goy7XVJ80g6qh61hIH26TPpCYvUAW2Lf3vuM47KkFQ8TTI8vamKzF0QPQoDhRAFbTk2kvU5q CPemRSrvlTh0AzlPW9X+n9eK5Bac2Ra/NhQX+VrI4pzXg5OcmlkuLZ3f1kR1iFIr+dIYc82TGDO ShaaZ1HuslPTLUZ/ZK68ByVjRWMggmd5syfypkIBy+q8AKyClvZ0vv2WUgHLUU7BYV/F9RUS/RY 8o3XwEXfGqahSCoYUL4NXjyS3QOFYfLyODl2gbTaPzqLMZu+9kPGEkYQhPG1UD9XswOe7A0Kk4R ycITSnf4aO2dODcPYZ3ozLLEBHnvvMDSlio7M0bmqfu2bLfFNVAWrv X-Received: by 2002:a05:6000:1acd:b0:431:656:c73a with SMTP id ffacd0b85a97d-4356a07745fmr12404015f8f.31.1768777084002; Sun, 18 Jan 2026 14:58:04 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43569922032sm20046992f8f.8.2026.01.18.14.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jan 2026 14:58:03 -0800 (PST) Date: Sun, 18 Jan 2026 22:58:02 +0000 From: David Laight To: Andrew Morton Cc: Eric Dumazet , linux-kernel , netdev@vger.kernel.org, Jakub Kicinski , Eric Dumazet , Paolo Abeni , Nicolas Pitre Subject: Re: [PATCH] compiler_types: Introduce inline_for_performance Message-ID: <20260118225802.5e658c2a@pumpkin> In-Reply-To: <20260118114724.cb7b7081109e88d4fa3c5836@linux-foundation.org> References: <20260118152448.2560414-1-edumazet@google.com> <20260118114724.cb7b7081109e88d4fa3c5836@linux-foundation.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@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 Sun, 18 Jan 2026 11:47:24 -0800 Andrew Morton wrote: > On Sun, 18 Jan 2026 15:24:48 +0000 Eric Dumazet wrote: > > > inline keyword is often ignored by compilers. > > > > We need something slightly stronger in networking fast paths > > but __always_inline is too strong. > > > > Instead, generalize idea Nicolas used in commit d533cb2d2af4 > > ("__arch_xprod64(): make __always_inline when optimizing for performance") > > > > This will help CONFIG_CC_OPTIMIZE_FOR_SIZE=y users keeping > > their kernels small. > > This is good. __always_inline is ambiguous and the name lacks > commentary value. > > If we take away __always_inline's for-performance role then what > remains? __always_inline is for tricky things where the compiler needs > to be coerced into doing what we want? > > IOW, I wonder if we should take your concept further, create more > fine-grained controls over this which have self-explanatory names. > > > > mm/ alone has 74 __always_inlines, none are documented, I don't know > why they're present, many are probably wrong. > > Shit, uninlining only __get_user_pages_locked does this: > > text data bss dec hex filename > 115703 14018 64 129785 1faf9 mm/gup.o > 103866 13058 64 116988 1c8fc mm/gup.o-after The next questions are does anything actually run faster (either way), and should anything at all be marked 'inline' rather than 'always_inline'. After all, if you call a function twice (not in a loop) you may want a real function in order to avoid I-cache misses. I've had to mark things that are called once 'always_inline', and also 'big looking' functions that are called with constants and optimise to almost nothing. But I'm sure there is a lot of code that is 'inline_for_bloat' :-) (Don't talk to me about C++ class definitions....) On 32bit you probably don't want to inline __arch_xprod_64(), but you do want to pass (bias ? m : 0) and may want separate functions for the 'no overflow' case (if it is common enough to worry about). David