Page MenuHomeFreeBSD

LinuxKPI: Factor out vmf_insert_pfn_prot() routine
ClosedPublic

Authored by wulf on Sep 23 2021, 12:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 31, 6:54 PM
Unknown Object (File)
Mar 7 2024, 7:51 PM
Unknown Object (File)
Dec 23 2023, 12:41 AM
Unknown Object (File)
Dec 22 2023, 10:37 PM
Unknown Object (File)
Dec 14 2023, 8:42 PM
Unknown Object (File)
Nov 27 2023, 7:01 PM
Unknown Object (File)
Nov 21 2023, 2:18 AM
Unknown Object (File)
Nov 8 2023, 6:45 AM

Details

Summary

from GEM and TTM page fault handlers and move it in to base system. This
code is tightly integrated with LKPI mmap support to belong to drm-kmod.

As this routine requires associated vm_object to be locked, it got
additional _locked suffix.

Diff Detail

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

Event Timeline

wulf requested review of this revision.Sep 23 2021, 12:43 AM

Looks good. Was this code tested?

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

<tab> character after define?

This revision is now accepted and ready to land.Sep 23 2021, 7:26 AM

Looks good. Was this code tested?

The code itself existed for a long time [1][2]

But results of refactoring were tested on GEM(i915) only yet.

[1] https://github.com/freebsd/drm-kmod/blob/5.5-stable/drivers/gpu/drm/i915/intel_freebsd.c#L167
[2] https://github.com/freebsd/drm-kmod/blob/5.5-stable/drivers/gpu/drm/ttm/ttm_bo_vm.c#L316

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

I don't really understand the namespacing rules for the linuxkpi. Is lkpi_* for functions that are not compatible with Linux but nonetheless are useful in ported code?

206

It would be useful to have some comment explaining why this is here, IMHO. I presume it's to avoid races around vm_pfn_count?

Clarify _Static_assert reason

This revision now requires review to proceed.Sep 24 2021, 3:48 PM
sys/compat/linuxkpi/common/include/linux/mm.h
206

It would be useful to have some comment explaining why this is here, IMHO. I presume it's to avoid races around vm_pfn_count?

It is done by performance reasons. Description is updated.

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

IMO linux_* belongs to linuxolator. And new LKPI code should use lkpi_

markj added inline comments.
sys/compat/linuxkpi/common/include/linux/mm.h
207

or "Consider use of the locked version"

This revision is now accepted and ready to land.Sep 28 2021, 5:16 PM