News for hackers. Stuff that matters.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by Tomte on Friday February 21, 2025 @01:07AM (#43124499)
And if no Rust developer has time or interest in those eight weeks? I don‘t claim that it can never work (or it cannot work in the common case), but as a hard rule it seems untenable.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by josefx on Friday February 21, 2025 @01:34AM (#43124642)
> And if no Rust developer has time or interest in those eight weeks?

What if Linus decided to go on a two month long vacation in the middle of the merge window?

> I don‘t claim that it can never work (or it cannot work in the common case), but as a hard rule it seems untenable.

There are quite a few rust developers already involved, if they cannot coordinate that at least some are available during a release critical two month period then none of them should be part of any professional project.

Re:Greg K-H: "Writing new code in Rust is a win for all of us" by sanxiyn on Friday February 21, 2025 @01:09AM (#43124507)
If so kernel is released with broken Rust. That is the policy, and I am flabbergasted why everyone is going "that policy must not be literal".
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by Tomte on Friday February 21, 2025 @01:14AM (#43124532)
Because if in a few years I have a device whose driver is written in Rust, a new kernel version might have simply dropped or broken my device driver, and I cannot use my device anymore. But sure, if R4L wants to stay a second-class citizen forever, it can still be acceptable.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by adgjlsfhk1 on Friday February 21, 2025 @01:48AM (#43124741)
this isn't policy forever. it's policy for now. if r4l succeeds, the policy will change.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by mschuster91 on Friday February 21, 2025 @03:14AM (#43125260)
> Because if in a few years I have a device whose driver is written in Rust, a new kernel version might have simply dropped or broken my device driver, and I cannot use my device anymore.

At least for Debian, all you need to do if you hit such a case is to simply go and choose the old kernel in the Grub screen. You don't even need to deal with installing an older package and dealing with version conflicts or other pains of downgrading.

Re:Greg K-H: "Writing new code in Rust is a win for all of us" by account42 on Friday February 21, 2025 @05:50AM (#43126157)
I hope you're not seriously suggesting this as a reasonable workflow.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by mschuster91 on Friday February 21, 2025 @06:05AM (#43126245)
For my server or laptop at home, sure. Why not. For servers in commercial fleets you should have staged rollouts as a policy anyway so if you do it right you shouldn't get hit.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by darthrupert on Friday February 21, 2025 @04:46AM (#43125765)
Distros should be your firewall against that sort of thing. Just don't use a distro with a non-existent kernel upgrade process.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by prmoustache on Friday February 21, 2025 @06:44AM (#43126444)
It is only a problem if you compile the kernel directly from the source tree instead of using the packages provided by your Linux distribution.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by Lutger on Friday February 21, 2025 @04:46AM (#43125761)
I'm not familiar with kernel development, but what's the difference anyway with C code? If you change the interface of some part, any users of it will be broken Rust or not. It will require coordination anyway.

It is customary for maintainers to fix _all_ usage of their code themselves? That doesn't seem scalable.

Re:Greg K-H: "Writing new code in Rust is a win for all of us" by cozzyd on Friday February 21, 2025 @06:00AM (#43126219)
Yes, that is the custom and is a key advantage of getting drivers in tree. I believe often the changes are applied automatically with a tool like coccinelle,
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by swiftcoder on Friday February 21, 2025 @05:22AM (#43125961)
Keep in mind that actual breaking changes are by design incredibly rare in a project like the linux kernel. If you have a decade's-worth of device drivers depending on your kernel subsystem's API, you don't get to break them, you have to introduce a new version instead.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by rcxdude on Friday February 21, 2025 @06:53AM (#43126494)
I think it's more a degree of how much effort it is to adjust to the new interface. If it's just 'added a new parameter to a function and there's an obvious default for existing code', then it'll (potentially mechanically) be applied to all the users. If it's 'completely changed around the abstraction and you need to think carefully about how to port your driver to the new interface', then that's something where there needs to be at least some longer-term migration plan, if only because there's not likely one person who can actually understand all the driver code and make the change.

(I do have experience with this causing regressions: someone updates a set of drivers to a new API, and because of the differences and lack of a good way to test, breaks some detail of the driver)

Re:Greg K-H: "Writing new code in Rust is a win for all of us" by cozzyd on Friday February 21, 2025 @05:58AM (#43126206)
This isn't true; internal API's change all the time (e.g. adding extra arguments) Try running out of tree drivers on bleeding edge kernels to see for yourself.
Re:Greg K-H: "Writing new code in Rust is a win for all of us" by tialaramex on Friday February 21, 2025 @08:18AM (#43127083)
Of course, for trivial mechanical changes like adding an argument the Rust binding changes are also trivial. If you've just spent half an hour walking through driver code for hardware you've never heard of changing stuff like

quaff(something, 5, Q_DOOP) ... into ... quaff(something, 5, 0, Q_DEFAULT | (Q_DOOP << 4))

Then it's not beyond the wits of a C programmer to realise that the Rust binding

quaff(var1, n, maybe_doop) ... can be ... quaff(var1, n, 0, Q_DEFAULT | (maybe_doop << 4))

Probably the Rust maintainer will be horrified and emit a patch to do something more idiomatic for binding your new API but there's an excellent chance that meanwhile your minimal patch builds and works since now it has the right number and type of arguments.

Re:Greg K-H: "Writing new code in Rust is a win for all of us" by mananaysiempre on Friday February 21, 2025 @06:30PM (#43134405)
> If you've just spent half an hour walking through driver code for hardware you've never heard of changing stuff [...].

Isn’t the point of Coccinelle that you don’t have to spend time walking through (C) driver code you’ve never heard of?

Re:Greg K-H: "Writing new code in Rust is a win for all of us" by tialaramex on Saturday February 22, 2025 @05:43AM (#43137852)
I have never used Coccinelle but yes, sort of. However, you're on the hook for the patch you submit, Coccinelle isn't a person so if you blindly send out a patch Coccinelle generated, without even eyeballing it, you should expect some risk of thrown tomatoes if (unknown to you) this utterly broke some clever code using your previous API in a way you hadn't anticipated in a driver you don't run.