linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Xie Yuanbin <qq570070308@gmail.com>
To: rppt@kernel.org, akpm@linux-foundation.org
Cc: Liam.Howlett@oracle.com, david@kernel.org,
	justinstitt@google.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, ljs@kernel.org, llvm@lists.linux.dev,
	mhocko@suse.com, morbo@google.com, nathan@kernel.org,
	nick.desaulniers+lkml@gmail.com, qq570070308@gmail.com,
	surenb@google.com, vbabka@kernel.org
Subject: Re: [PATCH] mm: optimize once judgment with clang
Date: Sat,  7 Mar 2026 22:41:35 +0800	[thread overview]
Message-ID: <20260307144135.380683-1-qq570070308@gmail.com> (raw)
In-Reply-To: <aavd4hoAO1DFLuJP@kernel.org>

On Sat, 7 Mar 2026 10:12:18 +0200, Mike Rapoport wrote:
> On Sat, Mar 07, 2026 at 02:54:04PM +0800, Xie Yuanbin wrote:
>> commit 242b872239f6a7deacbc ("include/linux/once_lite.h: fix judgment in
>> WARN_ONCE with clang") helps optimize performance and size under the
>> clang compiler, but the modification is not complete.
>
> How much does it actually optimize for size?

Basing on commit a0ae2a256046c0c5d377 ("Add linux-next specific
files for 20260306"), compiler "Debian clang version 21.1.8 (5)",
arm64 default defconfig, and setting CONFIG_CC_OPTIMIZE_FOR_SIZE=y,
the size result is:
|                                    | size     |
|                                   -|         -|
| Image.gz                           | 14256146 |
| size of ".text" section in vmlinex | 17035264 |

Basing on above, revert the commit 242b872239f6a7deacbc
("include/linux/once_lite.h: fix judgment in WARN_ONCE with clang"),
and build again:
|                                    | size            |
|                                   -|	              -|
| Image.gz                           | 14258152(+2006) |
| size of ".text" section in vmlinex | 17039360(+4096) |

> Note that performance is really not critical here because we are already
> dealing with slow path of debug code.

It seems that WARN_ON_ONCE_GFP() is not affected by in CONFIG_DEBUG_VM,
and it is used in __alloc_frozen_pages_noprof(), which seems to be a hot
path.


  parent reply	other threads:[~2026-03-07 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-07  6:54 Xie Yuanbin
2026-03-07  8:12 ` Mike Rapoport
2026-03-07 10:48   ` David Laight
2026-03-07 14:41   ` Xie Yuanbin [this message]
2026-03-08 18:03     ` Mike Rapoport
2026-03-09 15:32       ` Xie Yuanbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260307144135.380683-1-qq570070308@gmail.com \
    --to=qq570070308@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mhocko@suse.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox