Page MenuHomeFreeBSD

linuxkpi: stop inlining accesses to curthread->td_lkpi_task
ClosedPublic

Authored by kib on Aug 8 2026, 7:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 16, 2:19 AM
Unknown Object (File)
Fri, Sep 11, 5:27 PM
Unknown Object (File)
Fri, Sep 11, 12:22 PM
Unknown Object (File)
Fri, Sep 11, 12:59 AM
Unknown Object (File)
Thu, Sep 10, 10:26 PM
Unknown Object (File)
Thu, Sep 10, 9:54 PM
Unknown Object (File)
Thu, Sep 10, 9:51 PM
Unknown Object (File)
Tue, Sep 8, 7:46 PM
Subscribers

Details

Summary
This should provide much higher resistence against struct thread layout
changes for out-of-tree modules depending on linuxkpi.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Aug 8 2026, 7:05 PM

No objections from me reading this. Wait what others are saying.

This revision is now accepted and ready to land.Aug 8 2026, 10:07 PM

Oops, I forgot to submit, sorry.

sys/compat/linuxkpi/common/src/linux_compat.c
174

I don't really understand the namespacing in linuxkpi. When does one use linux_ vs. lkpi_ vs. __lkpi_?

Oops, I forgot to submit, sorry.

Sorry, committed a second before seeing your accept mail.

sys/compat/linuxkpi/common/src/linux_compat.c
174

I do not know either. I used __llkpi to clearly indicate that the symbol is in the implementation namespace.
The 'linux' prefix is useful for lot of other things in the modern time, so I think it is better to keep it alone for function that is presented everywhere in the code dealing with linuxkpi.

Oops, I forgot to submit, sorry.

In theory there is:

linux_ whichwe are trying to phase out as that is linuxolator really but there is lots of historic stuff like that.
linuxkpi_ and lkpi_ both came up and were used differently; the current way goes:
linuxkpi_ are all the pulbic LinuxKPI (Linux KPI) functions (#defined, aliased by an inline wrapper function).
lkpi_ is internal symbols which do not resemble Linux KPI. Due to history there is a bit of Linux KPI still.

I have a mostly done man page somewhere to document that; stay tuned for another few months ;(