Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 0/3 RFC] Unlikely annotations for EIO/EUCLEAN/abort branches
Date: Wed, 17 Sep 2025 19:53:53 +0200	[thread overview]
Message-ID: <cover.1758130856.git.dsterba@suse.com> (raw)

Hi,

manually add unlikely annotations to the branches that lead to critical
but rare errors. This is RFC as this has a big conflict surface.
However this would be a one-time action, possibly done now before 6.18
freeze.

The base is current for-next (without series [1]):

   text    data     bss     dec     hex filename
1650172  136289   15560 1802021  1b7f25 pre/btrfs.ko
1650934  136289   15560 1802783  1b821f post/btrfs.ko
DELTA: +762

There are differences in the generated assembly so the compiler does not
detect the error branches as unlikely by itself (sometimes it does due
to __cold function annotations).

I've used my prototype branch from some time ago so some of the
annotations could be still missing, this is more about getting the idea
of the scope.

[1] https://lore.kernel.org/linux-btrfs/cover.1758095164.git.fdmanana@suse.com/

David Sterba (3):
  btrfs: add unlikely annotations to branches leading to EUCLEAN
  btrfs: add unlikely annotations to branches leading to EIO
  btrfs: add unlikely annotations to branches leading to transaction
    abort

 fs/btrfs/backref.c          | 24 ++++++-------
 fs/btrfs/bio.c              |  4 +--
 fs/btrfs/block-group.c      | 24 ++++++-------
 fs/btrfs/ctree.c            | 66 +++++++++++++++++------------------
 fs/btrfs/defrag.c           |  2 +-
 fs/btrfs/delayed-inode.c    |  2 +-
 fs/btrfs/dev-replace.c      | 10 +++---
 fs/btrfs/disk-io.c          | 48 +++++++++++++-------------
 fs/btrfs/export.c           |  2 +-
 fs/btrfs/extent-tree.c      | 68 ++++++++++++++++++-------------------
 fs/btrfs/extent_io.c        |  2 +-
 fs/btrfs/extent_map.c       |  2 +-
 fs/btrfs/file-item.c        |  2 +-
 fs/btrfs/file.c             | 45 ++++++++++++------------
 fs/btrfs/free-space-cache.c |  2 +-
 fs/btrfs/free-space-tree.c  | 24 ++++++-------
 fs/btrfs/inode.c            | 58 +++++++++++++++----------------
 fs/btrfs/ioctl.c            |  6 ++--
 fs/btrfs/lzo.c              |  6 ++--
 fs/btrfs/qgroup.c           | 18 +++++-----
 fs/btrfs/raid56.c           | 14 ++++----
 fs/btrfs/relocation.c       | 14 ++++----
 fs/btrfs/root-tree.c        |  6 ++--
 fs/btrfs/scrub.c            | 18 +++++-----
 fs/btrfs/send.c             | 12 +++----
 fs/btrfs/super.c            |  6 ++--
 fs/btrfs/verity.c           |  4 +--
 fs/btrfs/volumes.c          | 30 ++++++++--------
 fs/btrfs/zoned.c            | 50 +++++++++++++--------------
 fs/btrfs/zstd.c             |  2 +-
 30 files changed, 284 insertions(+), 287 deletions(-)

-- 
2.51.0


             reply	other threads:[~2025-09-17 17:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 17:53 David Sterba [this message]
2025-09-17 17:53 ` [PATCH 1/3] btrfs: add unlikely annotations to branches leading to EUCLEAN David Sterba
2025-09-17 17:53 ` [PATCH 2/3] btrfs: add unlikely annotations to branches leading to EIO David Sterba
2025-09-17 17:53 ` [PATCH 3/3] btrfs: add unlikely annotations to branches leading to transaction abort David Sterba
2025-09-18 15:03 ` [PATCH 0/3 RFC] Unlikely annotations for EIO/EUCLEAN/abort branches Filipe Manana
2025-09-22 11:15   ` David Sterba

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=cover.1758130856.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=linux-btrfs@vger.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