Page MenuHomeFreeBSD

vm: retire pa_lock
ClosedPublic

Authored by alc on Jun 9 2025, 9:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 28, 2:59 AM
Unknown Object (File)
Thu, Sep 25, 1:34 AM
Unknown Object (File)
Sep 3 2025, 4:28 PM
Unknown Object (File)
Aug 29 2025, 5:33 PM
Unknown Object (File)
Aug 25 2025, 1:05 PM
Unknown Object (File)
Aug 25 2025, 9:09 AM
Unknown Object (File)
Aug 24 2025, 10:48 PM
Unknown Object (File)
Aug 16 2025, 2:23 AM

Details

Test Plan

This compiles.

Diff Detail

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

Event Timeline

alc requested review of this revision.Jun 9 2025, 9:16 PM
sys/compat/linuxkpi/common/include/linux/highmem.h
82–83

This seems highly suspect, and warrants investigation.

sys/compat/linuxkpi/common/include/linux/highmem.h
84

This is a hack that I don't understand, but the change is probably ok.

sys/compat/linuxkpi/common/include/linux/mm.h
417

These are used by drm-kmod. I believe changing them to vm_page_tryxbusy() and vm_page_xunbusy() would be correct. I can test such a change.

sys/compat/linuxkpi/common/include/linux/mm.h
406–418

Is the out-of-tree i915kms driver that you mentioned using these?

sys/compat/linuxkpi/common/include/linux/mm.h
406–418

Yes, here: https://github.com/freebsd/drm-kmod/blob/master/drivers/gpu/drm/i915/gem/i915_gem_userptr.c#L209

It's more correct to use the busy lock there. I'm not convinced that that code is sane at all in any case, but now I'm not sure that the userptr code gets compiled in at all. All of this file is conditionally defined based on whether CONFIG_MMU_NOTIFIER is configured, and I can't see any evidence that it is.

Use busy style synchronization in linux emulation.

Delete more unused declarations from vm_page.h.

markj added inline comments.
sys/compat/linuxkpi/common/include/linux/mm.h
406–418

That code isn't compiled indeed, so we could drop these wrappers as well.

This revision is now accepted and ready to land.Jun 10 2025, 2:18 PM

Can we remove PA_LOCK_COUNT too? There is one use in a powerpc64 pmap to size the PV lock array, but substituting MAXCPU there would be more consistent with other platforms and would also avoid changing the size of the array.

This revision now requires review to proceed.Jun 10 2025, 5:44 PM
This revision is now accepted and ready to land.Jun 10 2025, 6:08 PM
This revision was automatically updated to reflect the committed changes.