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
Unknown Object (File)
Jan 12 2024, 7:46 AM
Unknown Object (File)
Dec 20 2023, 4:27 AM
Unknown Object (File)
Dec 20 2023, 12:51 AM
Unknown Object (File)
Aug 27 2023, 10:33 PM
Unknown Object (File)
Jul 9 2023, 6:24 PM
Unknown Object (File)
Jul 8 2023, 7:30 PM
Unknown Object (File)
Jul 8 2023, 7:29 PM
Unknown Object (File)
Jul 8 2023, 7:28 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