Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Bradley Morgan <bradley.morgan@linux.dev>
To: Josef Schlehofer <pepe.schlehofer@gmail.com>,
	u-boot@lists.u-boot-project.org
Cc: "Tom Rini" <trini@konsulko.com>,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	"Marek Behún" <kabel@kernel.org>, "Qu Wenruo" <wqu@suse.com>,
	"Joao Marcos Costa" <joaomarcos.costa@bootlin.com>,
	"Richard Genoud" <richard.genoud@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Peng Fan" <peng.fan@nxp.com>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	"Tanmay Kathpalia" <tanmay.kathpalia@altera.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/6] Avoid 64-bit divisions that need __udivdi3() or __umoddi3()
Date: Wed, 25 Nov 2026 15:45:12 +0000	[thread overview]
Message-ID: <5D58F095-45B7-4BA0-A25E-2D65AF893947@linux.dev> (raw)
In-Reply-To: <20261125124259.95636-1-pepe.schlehofer@gmail.com>

On 25 November 2026 12:42:53 GMT, Josef Schlehofer
<pepe.schlehofer@gmail.com> wrote:
>U-Boot's private libgcc does not provide __udivdi3() and __umoddi3().
>v3 of the mpc85xx LTO series links mpc85xx LTO builds with it and added
>both routines [1]. Christophe Leroy asked why the callers do not avoid
>'/' and '%' on 64-bit operands instead, and Tom Rini asked to update
>the common code [2].
>
>Patches 1-4 avoid the divisions that make the mpc85xx LTO builds call
>__udivdi3() or __umoddi3(), in btrfs, squashfs, mmc_berase() and
>get_win_cnt() of the mpc8xxx PAMU code. They do not depend on each
>other. Patch 5 removes fs/btrfs/dev.c, which nothing uses and which
>holds another 64-bit modulo. Patch 6 converts the remaining divisions
>in btrfs. U-Boot never runs them, but builds without LTO still link the
>ones in the RAID5/6 code. My reply in that thread announced these
>conversions for v4 of the LTO series. They are sent on their own
>instead.
>
>Patch 2 and my big-endian fix for squashfs [3] conflict in
>sqfs_read_nest(). I will rebase whichever of them goes in second.
>
>Build tested with a buildman world build on a fork's CI, and sandbox
>test.py gives the same results as before. Run tested on qemu-ppce500
>(btrfs) and qemu_arm (btrfs, squashfs, mmc erase), and on a Turris 1.1
>with the mpc85xx LTO patches on top, which boots from an SD card and
>loads files from btrfs. The PAMU change is build tested only.
>
>[1]
>https://lore.kernel.org/u-boot/20261119133310.22732-5-pepe.schlehofer@gmail.com/
>[2] https://lore.kernel.org/u-boot/20261119200924.GB3176972@bill-the-cat/
>[3]
>https://lore.kernel.org/u-boot/20261125095537.37979-1-pepe.schlehofer@gmail.com/


Thanks,  after review, who will merge? Me? Or anyone else up to?

>
>Josef Schlehofer (6):
>  fs: btrfs: Avoid a 64-bit modulo in __btrfs_devread()
>  fs/squashfs: Avoid 64-bit divisions
>  mmc: Use div_u64() in mmc_berase()
>  powerpc: mpc8xxx: Avoid a 64-bit division in get_win_cnt()
>  fs: btrfs: Remove the unused dev.c
>  fs: btrfs: Avoid the remaining 64-bit divisions
>
> arch/powerpc/cpu/mpc8xxx/fsl_pamu.c |  2 +-
> drivers/mmc/mmc_write.c             |  2 +-
> fs/btrfs/Makefile                   |  2 +-
> fs/btrfs/compat.h                   |  8 ++------
> fs/btrfs/dev.c                      | 25 -------------------------
> fs/btrfs/volumes.c                  | 19 +++++++++++--------
> fs/btrfs/volumes.h                  |  9 +++++----
> fs/squashfs/sqfs.c                  | 21 +++++++++++----------
> fs/squashfs/sqfs_inode.c            |  5 +++--
> 9 files changed, 35 insertions(+), 58 deletions(-)
> delete mode 100644 fs/btrfs/dev.c
>
>
>base-commit: 79497816056122c49b3b135e14cbac59374e636c
>

--- Thanks!

  parent reply	other threads:[~2026-11-25 15:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 12:42 [PATCH 0/6] Avoid 64-bit divisions that need __udivdi3() or __umoddi3() Josef Schlehofer
2026-11-25 12:42 ` [PATCH 1/6] fs: btrfs: Avoid a 64-bit modulo in __btrfs_devread() Josef Schlehofer
2026-11-25 20:11   ` Qu Wenruo
2026-11-25 12:42 ` [PATCH 5/6] fs: btrfs: Remove the unused dev.c Josef Schlehofer
2026-11-25 20:14   ` Qu Wenruo
2026-11-26  9:15     ` Josef Schlehofer
2026-11-26  9:20       ` Qu Wenruo
2026-11-25 12:42 ` [PATCH 6/6] fs: btrfs: Avoid the remaining 64-bit divisions Josef Schlehofer
2026-11-25 20:15   ` Qu Wenruo
2026-11-25 15:45 ` Bradley Morgan [this message]
2026-11-25 15:51   ` [PATCH 0/6] Avoid 64-bit divisions that need __udivdi3() or __umoddi3() Tom Rini

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=5D58F095-45B7-4BA0-A25E-2D65AF893947@linux.dev \
    --to=bradley.morgan@linux.dev \
    --cc=chleroy@kernel.org \
    --cc=jh80.chung@samsung.com \
    --cc=joaomarcos.costa@bootlin.com \
    --cc=kabel@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=peng.fan@nxp.com \
    --cc=pepe.schlehofer@gmail.com \
    --cc=richard.genoud@bootlin.com \
    --cc=tanmay.kathpalia@altera.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    --cc=wqu@suse.com \
    /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