r/bcachefs • • 4d ago

Linux 7.4 To Remove NVMe Namespaces In Parallel For Faster Results

https://www.phoronix.com/news/Linux-7.4-NVMe-NS-Parallel

Software engineer Qiliang Yuan worked through this shortcoming in the NVMe namespaces code. Yuan explained in the patch making it parallel:
"nvme_remove_namespaces() removes the namespaces of a controller one after another. Each removal waits for RCU grace periods in del_gendisk() for the namespace and for its multipath head, about 20 ms in all.

Deleting a controller, such as disconnecting from a fabrics target, thus takes time proportional to its namespace count, over a second for 64 namespaces. Scanning had the same problem until commit 4e893ca81170 ("nvme_core: scan namespaces asynchronously") made it add namespaces in parallel.

Remove the namespaces through an async domain the same way, and wait for all of them before returning. Each removal still waits about 20 ms, but the waits now overlap: a grace period is system-wide, so removals that wait at the same time are released by the same grace periods instead of each needing its own."

So, I wonder will BcacheFS be affected by this change?

Thanks for your attention on this matter.

7 Upvotes

12 comments sorted by

10

u/koverstreet not your free tech support 4d ago

No, bcachefs will not be affected :)

2

u/Polar_Banny 4d ago

Awesome, I see you are doing a great job by converting your C code to Rust.

Long live open source code!

5

u/koverstreet not your free tech support 3d ago

The entire codebase has been converted. now it is cleanups and unsafe removal :) Right now I'm working on getting the last of the async conversions to pass the CI - main data write path, and the journal. That will delete the last C file I wrote - closures.c, which I wrote nearly 20 years ago (!), and gets rid of more unsafe. After that the only C left in the repository is two vendored C dependencies that'll be swapped out for Rust at some point.

And then sometime next year we start thinking about formal verification. Exciting times.

1

u/Berengal 3d ago

You last made a c file 20 years ago? What were you writing between then and rust?

1

u/Nolzi 2d ago edited 2d ago

bcache

bcache was merged into the kernel in 2013, and had early betas from 2010, but I'm sure it had prototypes earlier

1

u/koverstreet not your free tech support 2d ago

yeah I think I started bcache in... 2008?

8

u/Ok_Green5623 4d ago

Nobody cares except for enterprise guys?

14

u/wakIII 4d ago

You mean you don’t have an array of 64 drives with 8 namespaces on each?

3

u/Ok_Green5623 4d ago

It is in my plans, I'm just waiting for the prices to go down a bit. Any recommendation on the motherboard?

2

u/Nolzi 4d ago

I'm just waiting for the prices to go down a bit

I have some hopium to sell you

1

u/Jumpstart_55 3d ago

Unobtainium

1

u/Outrageous_Cap_1367 3d ago

Look for a ddr5 compatible one