Kernel 5.10
The kernel version with highest projected EOL (Dec, 2026) is now 5.10, and I tried to port mars to it.
This is of particular interest to me in order to upgrade debian to 11, and because I hope to have better block device encryption performance from the changes, present in this version, described in https://blog.cloudflare.com/speeding-up-linux-disk-encryption/
Mars to 5.10 is not trivial, and here are some thoughts that I would like to share. I am not sure I will be able to do anything working but at least, if I try, I would like to try in the right direction.
Besides trivial things, like patches with fuzz and help system syntax change, I found that:
- the pair of functions use_mm and unuse_mm, called from block/mars/kernel/mars.h are no longer present.
It is my understanding that this functions have been moved to kthread_use_mm and kthread_unuse_mm and prototypes are defined in linux/kthread.h, but are still the same functions. This is what I understand from https://lkml.org/lkml/2020/4/4/113
So I would trivially change block/mars/kernel/mars.h to use kthread_use_mm and kthread_unuse_mm.
- set_fs and get_fs are no longer present. They are used in block/mars/kernel/brick_say.c and block/mars/kernel/lib_mapfree.c in a few places, llike this:
oldfs = get_fs();
set_fs(KERNEL_DS);
/* do something */
set_fs(oldfs);
It is my understanding that this pattern should now become:
oldfs = force_uaccess_begin();
/* do something */
force_uaccess_end(oldfs);
-
block/mars/kernel/lib_mapfree.c uses smp_read_barrier_depends() which does not exist any more and, as far as I understand, was defined nonempty only for the alpha architecture. I do not know if there is still any interest in supporting alpha, anyway I think it should become smp_mb() .
-
mars uses kernel_setsockopt which has been removed. Other kernel subsystems needing it (SCTP is one) had to write their own fragments of this function. I'm afraid we will have to do something very similar to what SCTP people did. It could be a single function mimicking the old kernel_setsockopt, or a few small inline functions like what they did in include/net/sctp/sctp.h
Any thoughts?
Regards, Bergonz
Hi Bergonz,
I had worked on kernel 5.10 support almost a year ago. Unfortunately, this small sub-project got stuck due to lack of time :(
This will likely resume in the next few months. I just cannot promise you a deadline.
I already had a prototype of a prepatch version v3, but AFAICS it was not fully stable at that time. The problem is that some so-called "Frankenstein kernels" ;) e.g. from CentOS need also to be addressed by such a prepatch, and my internal #ifdefs need to adapt to different kernel sources as best as possible. So this needs a lot of time and a lot of testing.
Please stay somewhat patient.
I will post a new WIP-port-5.10 branch somewhen in future. Please support me by testing and reporting any bugs, before I can release it under the stable branch.
Anyway, thanks for your detailed feedback in your posting. I will carefully re-read your thoughts and discuss it when I will resume the porting branch.
Thanks and Cheers,
Thomas
I understand, or at least try to, how complicated it can be. I will stay tuned. Thanks,
Bergonz