Comment by adrian_b
1 day ago
I do not believe that it will be possible for "the Rust for Linux team to step in and make whatever changes to the Rust code are needed", because that is much easier said than done.
With this rule that the Rust developers must maintain their own code, they are in the same situation like the maintainers of out-of-kernel device drivers.
I have maintained out-of-kernel Linux device drivers, so I know that this is a huge PITA. Almost every new Linux kernel minor version was breaking the device drivers, due to interface changes like: moving definitions from one Linux kernel header to another, adding or deleting parameters to functions, adding or deleting members to structures.
It is not enough to say that the Rust developers must maintain their own code, but it is also necessary for the responsibilities of the maintainers of the kernel subsystems written in C to be changed. Whoever changes an interface should also have the obligation to write a concise migration guide in which to explain what must be done to convert the invocations of the old interfaces into invocations of the new interfaces.
Only in this case the Rust developers would be able to maintain their code. Otherwise, they would have to bombard the C developers with questions after each change, which I assume is what Christoph Hellwig fears.
Such a requirement will increase the workload for the C developers, so I am not surprised that they are reluctant to accept users who will maintain their own code.
I have not checked recently the kernel documentation, but I doubt that anything has changed. When I was maintaining device drivers, every time when they became broken the only thing that could be done was to scan the kernel E-mail lists, to find who and why has changed the interface. This provided some context about the purpose of the changes, but there has never been any information about how to migrate the existing code to use the new interfaces.
When function arguments or structure members were deleted, it was simpler, one could delete them also in the device drivers hoping that they will continue to work. That did not work always, because sometimes additional new interfaces had to be invoked, to compensate for the simplification of the old interfaces.
Much worse was when function arguments or structure members were added, because only seldom it was possible to guess what values should be put in them.
In many cases the only solution was to waste a lot of time with reading the source for the entire subsystem whose interface had changed, in order to understand which were the effects of the interface changes.
All this was simple, but very tedious. What could have been done in a few minutes, had a migration guide existed, could require many hours of work in the absence of adequate documentation.
Unless the requirements for the documentation of the internal interfaces change, this is exactly what the Rust developers will also have to do, with the additional difficulty that they may be not very proficient at reading the kernel C language sources.
If there would be a clear requirement for the C maintainers to write a migration guide whenever they change interfaces, that would help not only the maintainers of Rust Linux device drivers, but also the maintainers of any out-of-kernel Linux device drivers.
However, there have been some Linux developers who not only did not make easy the maintaining of out-of-kernel device drivers, but who have made efforts to make as difficult as possible the maintaining of out-of-kernel device drivers, apparently due to some misguided belief that this will hurt some evil corporations.
In my experience, most out-of-kernel device drivers are for obsolete devices or for devices with very few users, whose maintenance is not sponsored by any corporation. So this behavior of actively making difficult the maintenance of out-of-kernel device drivers hurts mostly hobbyists, or at most small businesses, because they do not have the resources to push device drivers into the official tree.
> I do not believe that it will be possible for "the Rust for Linux team to step in and make whatever changes to the Rust code are needed", because that is much easier said than done.
No, certainly not forever. In the short term I think it is a workable solution. I think that over time more and more maintainers will realize that maintaining Rust code is easier than maintaining C code, and that there is actually very little added burden to maintaining the Rust bindings and abstractions that wrap their C code. The Thus the Rust team will not have to do that job forever.
> Whoever changes an interface should also have the obligation to write a concise migration guide in which to explain what must be done to convert the invocations of the old interfaces into invocations of the new interfaces.
That is an excellent suggestion :)
The migration guide should be part of, or even the bulk of, a well–written commit message.
> However, there have been some Linux developers who not only did not make easy the maintaining of out-of-kernel device drivers, but who have made efforts to make as difficult as possible the maintaining of out-of-kernel device drivers, apparently due to some misguided belief that this will hurt some evil corporations.
And that doesn’t surprise me at all.