Page MenuHomeFreeBSD

LinuxKPI: Implement smp_*mb barriers with atomic_thread_fence_*
ClosedPublic

Authored by wulf on Dec 6 2021, 10:04 AM.
Tags
None
Referenced Files
F106166363: D33296.diff
Thu, Dec 26, 11:47 AM
Unknown Object (File)
Fri, Nov 29, 1:37 AM
Unknown Object (File)
Nov 12 2024, 8:59 PM
Unknown Object (File)
Oct 5 2024, 3:05 PM
Unknown Object (File)
Sep 28 2024, 9:15 PM
Unknown Object (File)
Sep 25 2024, 7:34 PM
Unknown Object (File)
Sep 25 2024, 5:36 AM
Unknown Object (File)
Sep 24 2024, 7:12 PM

Diff Detail

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

Event Timeline

wulf requested review of this revision.Dec 6 2021, 10:04 AM

Please make sure:

make buildkernel WITH_OFED=YES

passes on i386 and amd64 at least.

This revision is now accepted and ready to land.Dec 6 2021, 10:17 AM
bz requested changes to this revision.Dec 6 2021, 2:15 PM
bz added a subscriber: bz.
bz added inline comments.
sys/compat/linuxkpi/common/include/asm/barrier.h
30

Can you prefix that with LINUXKPI please?

38

What about aarch64? Is that relevant there as well on Linux?

This revision now requires changes to proceed.Dec 6 2021, 2:15 PM
sys/compat/linuxkpi/common/include/asm/barrier.h
30

All other files in asm subdirectory have _ASM_ prefix. Why this one should have LINUXKPI?

38

What about aarch64? Is that relevant there as well on Linux?

On aarch64 CPU barriers are still aliased to IO barriers like in our current drm-kmod or good old legacy drm2.

Can we use native CPU barriers for aarch64 and other architectures? Most probably, yes. But I am not skilled enough to check that quickly.
Our implementation differs from Linux even in simple amd64 case which I checked. E.g. we use PCPU area address while Linux uses stack pointer for lock; addl $0,mem command in smp_mb().

Or should we just take this block from OpenBSD entirely?It looks like they extracted it from Linux.

bz added inline comments.
sys/compat/linuxkpi/common/include/asm/barrier.h
30

I would just hope all newly added header files would use _LINUXKPI_ as a prefix to keep the namespace clean(er) than before.

38

Thanks for the reply and looking at it. Go with what you have then.

This revision is now accepted and ready to land.Dec 6 2021, 10:38 PM