Oddbean new post about | logout

Notes by Thorsten Leemhuis (1/4) | export

 In case you are on #btrfs and update-grub/grub-probe broke for you with #Linux 6.7 it's time to rejoice: the fix for that regression finally landed in mainline: https://git.kernel.org/torvalds/c/d565fffa68560ac540bf3d62cc79719da50d5e7a

See also: https://git.kernel.org/torvalds/c/7b65c810a1198b91ed6bdc49ddb470978affd122 and https://bugzilla.kernel.org/show_bug.cgi?id=218353

#kernel #LinuxKernel 
 Eric Snowberg submitted a new #Linux LSM as RFC: https://lore.kernel.org/all/20240311161111.3268190-1-eric.snowberg@oracle.com/

"'"Introduce a new LSM called Clavis (Latin word meaning key).  The motivation behind this LSM is to provide access control for system keys.  Before spending more time on this LSM, I am sending this as an RFC to start a discussion to see if the current direction taken has a possibility of being accepted in the future."'"

#kernel #LinuxKernel 
 nostr:npub1cm7wlyhq6f0yhmert2lsm45s3ej26dl4whu2y8n4w04gqhg3ctxsyn32y8 Let's debug by this horribl... 
 @ba73f167 

Guess your remotes have different names:

https://gitlab.com/knurd42/kernel-scripts/-/blob/master/linuxscru/linuxscru?ref_type=heads#L52

See the README as well.

https://gitlab.com/knurd42/kernel-scripts/-/blob/master/linuxscru/README.md?ref_type=heads

Side note: needs a tree that contains mainline, next and stable, not sure if that's the case for you.

Guess I should fix these things up and include a few checks, but I first wanted to see if anyone is interested in this… 
 @ba73f167 

ha, nice hack, guess that will be a whole lot faster. 😬 

For my use case something like that wasn't needed, as the lookup was fast enough for my needs. But to be honest I recently thought about going a similar route for some other problem (one my head already forgot about… 🥴) 
 nostr:npub1cm7wlyhq6f0yhmert2lsm45s3ej26dl4whu2y8n4w04gqhg3ctxsyn32y8 
why did I read it as linux... 
 @Hyeonggon Yoo 

Haha, by brain hadn't made that connection yet (and had to to read "linux SRCU" two times before my brain saw the difference).

Side note: "linuxscru" didn't take much of a thought; if others show and interest in it it might be wise to consider a better name 
 Do you often need to check if a patch was merged to #Linux #kernel and which version is showed up in?

Or check through which tree a particular patch was merged?

I have to do this and a few other things all the time, hence I developed a script to make these tasks a little easier for me: 

#linuxscru, the #LinuxKernel scrutiny tool – https://gitlab.com/knurd42/kernel-scripts/-/blob/master/linuxscru/linuxscru?ref_type=heads

Right now it's tailored for my needs and my setup; but that could change if other people show an interest in it.

https://gitlab.com/knurd42/kernel-scripts/-/blob/master/linuxscru/README.md?ref_type=heads

https://cdn.fosstodon.org/media_attachments/files/111/186/331/916/244/340/original/cc5093ea7abe84fa.png 
 How exactly is it possible that a regular mainline #Linux #kernel eats a few hundred MB of RAM on... 
 @98025892 

because the kernel on those might be build from the same  source code, but the build configuration is totally different – hence a ton of features (ACPI might be among them) are missing in the second case 
 #btrfs-progs 6.5.2 is out an brings support for some features slated for #Linux #kernel 6.7:

"""
    raid-stripe-tree, new tree to track extent mapping for raid profiles, allows raid1*, raid0 and raid10 on zoned devices (kernel 6.7)
    simple quotas, simplified accounting that does not track exclusive and shared extents (kernel 6.7)
    mkfs with duplicate UUID on a single device, temp-fsid (kernel 6.7)
"""

https://github.com/kdave/btrfs-progs/releases/tag/v6.5.2 #LinuxKernel

https://cdn.fosstodon.org/media_attachments/files/111/174/877/383/785/730/original/ababb308ff9cfbe9.png 
 @a9106e75 

Not sure if the license is the biggest problem, as quite a few bits for BPF progras are GPL exported as well: https://docs.kernel.org/bpf/bpf_licensing.html#using-bpf-programs-in-the-linux-kernel

I worry more about "we can work around a oddity or missing feature in the Linux kernel's C code using a BPF program, so why should we invest time and money to improve the C code?" 
 @a9106e75 

see also this recent post from Mel regarding the BPF extensible scheduler class: https://lore.kernel.org/all/20230926092020.3alsvg6vwnc4g3td@suse.de/ 
 As interesting a technology as bpf is, I really do worry that some aspects of it are just a way o... 
 @a9106e75 

Not sure if the license is the biggest problem, as quite a few bits for BPF progras are GPL exported as well: https://docs.kernel.org/bpf/bpf_licensing.html#using-bpf-programs-in-the-linux-kernel

I worry more about "we can work around a oddity or missing feature in the Linux kernel's C code using a BPF program, so why should we invest time and money to improve the C code?" 
 Fedora packaging tools ;(

"dnf5 distro-sync" ends with installing extra 54 packages.

To find wh... 
 @a06711c5 

/me wonders if dnf doesn't sync groups on distro-sync, while dnf5 does – but it's just a wild guess 
 #kcbench, my #Linux #kernel compile #benchmark, got a new feature:

Instead of compiling a defconfig or an allmodconfig it's now possible to specify your own #LinuxKernel .config file to compile.

Many thx to @0d168def, who contributed that change and fixed up a few minor issues while at it. Much appreciated! 👏 

https://gitlab.com/knurd42/kcbench/

https://cdn.fosstodon.org/media_attachments/files/111/164/096/227/871/219/original/0a47003fae5b6991.png 
 #Linux #kernel 6.6-rc4 is out: https://lore.kernel.org/lkml/CAHk-=wia2-4DRvD-aXz70AV64yrt+Vr50MxHiDunZ71dHATv-Q@mail.gmail.com/

"""You all know the drill by now. There's nothing particularly odd in here, […]

But everything else looks very much normal. The libata suspend/resume handling shows up due to it walking away from using the generic SCSI version that caused issues. Other than that, it's a random mix of fixes all over […]

              Linus""" 
 auto-cpufreq 2.0 is out: https://github.com/AdnanHodzic/auto-cpufreq/releases/tag/v2.0.0

Wondering if this is or only looks like one of those tools that shouldn't exist, as the #Linux #kernel ideally should better be enhanced do the right thing automatically.

FWIW, from the README: 

"""Why do I need auto-cpufreq? […] the CPU will run using "performance" governor with turbo boost enabled regardless if it's plugged in to power or not."""

Why is that a bad thing? Doing something quickly to then sleep quickly cat be the wisest move. 
 @Hyeonggon Yoo 

getting regzbot involved is much appreciated, but don't worry, I can handle that, I do that all the time.

Good to see that a fix is getting closer to being fully formed & mainlined.

And thx for reporting! 
 Developers don't say "I was young and needed the money". They say:

"I was young and thought 'this should be simple!' " 
 2/ Above tooth is inspired by @ba73f167, who in https://lore.kernel.org/all/2023100159-tapered-fragment-7f9d@gregkh/ said the following about the #Linux #kernel's unified object model of all devices:

""" When Pat and I created it, we were young and naive and thought "this should be simple!"  Famous last words... """ 
 Developers don't say "I was young and needed the money". They say:

"I was young and thought 'this
should be simple!' " 
 nostr:npub1cm7wlyhq6f0yhmert2lsm45s3ej26dl4whu2y8n4w04gqhg3ctxsyn32y8 That's it! My laptop has ju... 
 @4dbba09d 

Congrats for getting further.

Too cynical? Well, I think this is nothing that should be dealt with on the distro level; the kernel should do "the right thing"™ by default 
 "[…] Instead of accepting my [#LinuxKernel] patch or guiding me towards a better solution, he went ahead and implemented his own fix, giving me credit only for reporting the issue  […]

My first contribution to the [#Linux] #kernel was a really frustrating and discouraging experience, dealing with people who do not think it’s important to get proper recognition for your work. […]"

https://ariel-miculas.github.io/How-I-got-robbed-of-my-first-kernel-contribution/

1/ Side note: I sometimes wonder if… 
 2/…patches from new or rare contributors should have some kind of tag to indicate things like

(1) I have no interest in learning how to do things better, I just want it fixed; I'm thus happy if someone dramatically changes the patch or writes a better one.

(2) I'd really like to learn how to do this properly, hence would be grateful if someone could guide me somewhat.

Why? Well, misunderstandings here can be annoying and a waste of time for both sides (and lead to situations like the above). 
 #Linux #kernel developer Mel Gorman on the #BPF extensible scheduler class" from Tejun and other Meta devs:

"""I view pluggable scheduler as something that would be a future maintenance nightmare […]

I generally worry that certain things may not have existed in the shipped scheduler if plugging was an option including EAS, throttling control, schedutil integration, big.Little, adapting to chiplets and picking preferred SMT siblings for turbo boost. […]"""

https://lore.kernel.org/all/20230926092020.3alsvg6vwnc4g3td@suse.de/ #LinuxKernel 
 nostr:npub1cm7wlyhq6f0yhmert2lsm45s3ej26dl4whu2y8n4w04gqhg3ctxsyn32y8 Oooh. I'm performing a post... 
 @4dbba09d 

good luck (you at least seem to have data for analysing – I just had a black screen :-/ );

I meanwhile made it to the end now and found the culprit (see reply to the initial tweet for details) 
 @8a76e5f1 @f7edc411 

pretty sure a fix for that problem was mainlined and backported to stable, so that's up for the debian devs to fix I assume 
 nostr:npub1cm7wlyhq6f0yhmert2lsm45s3ej26dl4whu2y8n4w04gqhg3ctxsyn32y8 I find the thing about the ... 
 @2b4c2608 

I remember it to be obfuscated as well, but haven't take a look in years; maybe somebody cleaned things up and the debian devs didn't notice? Or the obfuscation is only found in headers or something? 
 nostr:npub1cm7wlyhq6f0yhmert2lsm45s3ej26dl4whu2y8n4w04gqhg3ctxsyn32y8 could you compile elsewhere... 
 @258ceafa nope, everything else I have at hand here is likely as slow or definitely slower (I usually don't need more power). 
 #argh: I have to perform a #Linux #kernel bisection on my Thinkpad T14s G1 (AMD) with Fedora's full-blown distro config, as the problem does not occur with a config trimmed by localmodconfig. 😟 

[1] resume broke with #LinuxKernel 6.6-rc 
 2/ And the winner of this bisection is:

92e24e0e57f72e ("Input: psmouse - add delay when
deactivating for SMBus mode") [merged for v6.6-rc1]

Report: https://lore.kernel.org/all/ca0109fa-c64b-43c1-a651-75b294d750a1@leemhuis.info/ 
 nostr:npub1cm7wlyhq6f0yhmert2lsm45s3ej26dl4whu2y8n4w04gqhg3ctxsyn32y8 to be fair: all of those dr... 
 @f7edc411 no idea about that dvb-udb thingy, but for the other stuff I guess you are right. 
 This is what #Debian removes from the #Linux #kernel sources to comply with the DFSG.

This is why:

"""[…] The IETF draft for CIPSO is under a non-free license. The nvidia and riva drivers contain obfuscated source code. The other files contain executable code as static data, without any source for it. […]""" (https://groups.google.com/g/linux.debian.kernel/c/Pqw8klO72FE)

Got curious (while waiting for the compiler) after seeing a LKML discussion regarding the Appletalk FW license in the #LinuxKernel: https://lore.kernel.org/all/6100798b-ab1d-262a-fd5b-435d6dfc4a53@redhat.com/

https://cdn.fosstodon.org/media_attachments/files/111/130/790/354/777/832/original/369b6ed513c0a9a6.png 
 2/ For the record: Greg submitted a patch for review that removes the appletalk driver with its dubious firmware code from the #Linux #kernel:

https://lore.kernel.org/all/20230927090029.44704-2-gregkh@linuxfoundation.org/ 
 https://www.kerno.io/blog/programming-the-kernel-with-ebpf

"""In this issue, we’ll explore eBPF (Extended Berkeley Packet Filter), […] 

TLDR

    eBPF is a mechanism that makes the [#Linux] #kernel dynamically programmable without modifying the source code.
    eBPF is safe, fast, incredibly flexible, and extensible.
    eBPF has been running in production for over half a decade at internet scale on millions of servers.
    eBPF use cases range from observability, networking, security, tracing, and profiling.""" #LinuxKernel 
 Things I like to see: if a #Linux #kernel regression fix is applied three minutes after the initial submission[1]. Thx @5c2e25ae! 

Things I hate: when submitted regression fixes don't even get a reply within a few days; not sure how often that happens, but I got the feeling that I sooner or later will have to add those to the list of tracked #LinuxKernel regression to prevent them from falling through the cracks.

[1] https://lore.kernel.org/all/169400719806.700937.1715411703006180940.b4-ty@kernel.dk/

[2] like https://lore.kernel.org/all/20230901122424.247070-1-daniel@zonque.org/ (also from yesterday)

https://cdn.fosstodon.org/media_attachments/files/111/022/866/734/213/840/original/bb894f7d43d853f9.png 
 #bcachefs won't make it into #Linux #kernel 6.6, but is not far off. For details see Linus replies starting here:

https://lore.kernel.org/all/CAHk-=wjUX287gJCKDXUY02Wpot1n0VkjQk-PmDOmrsrEfwPfPg@mail.gmail.com/t/#u

"""I suspect any further changes are better done in-tree. The out-of-tree thing has been done.

[…] issues that I have with this, and Christoph did mention a big one: it's not been in linux-next.

So these kinds of "I'll just ignore _all_ basic rules" kinds of issues do annoy me.

[…] if you actually want this
upstream, you need to work with upstream […]""" 
 Note the replies-to-self from Linus, like https://lore.kernel.org/all/CAHk-=whaiVhuO7W1tb8Yb-CuUHWn7bBnJ3bM7bvcQiEQwv_WrQ@mail.gmail.com/t/#u

""""Oh, and the fact that it hasn't been in linux-next became immediately clear, and it's a real practical problem.

I get a compile error when just doing a basic built-test: […] 

and that compile error is actually a sign of a pretty serious bug.

BTREE_NODE_UNLOCKED is of the wrong enum type, and has a value (-1) that simply cannot be represented in a 'enum six_lock_type'.""" 
Event not found
 @Conor Dooley 

Of course it's silly and over complication. But at the same it makes something explicit that in an ideal world might be wise for everyone to make explicit, as people will forget to spell it out (and maintainers will forget to ask which of the two it is).