Page MenuHomeFreeBSD

Fix domain selection in kmem_back().
ClosedPublic

Authored by markj on Sep 19 2018, 5:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 5:48 AM
Unknown Object (File)
Dec 12 2023, 2:36 AM
Unknown Object (File)
Nov 9 2023, 11:36 PM
Unknown Object (File)
Oct 2 2023, 6:58 AM
Unknown Object (File)
Sep 6 2023, 2:10 AM
Unknown Object (File)
Sep 1 2023, 9:28 PM
Unknown Object (File)
Sep 1 2023, 9:28 PM
Unknown Object (File)
Sep 1 2023, 9:28 PM
Subscribers

Details

Summary

The kmem API implementation attempts to ensure that all pages backing a
given large virtual page come from the same physical domain. Use the
virtual address to determine the domain.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Sep 19 2018, 8:10 PM
This revision was automatically updated to reflect the committed changes.
head/sys/vm/vm_kern.c
493

I don't see where domain is initialized to zero when vm_ndomains is 1.

markj added inline comments.
head/sys/vm/vm_kern.c
493

Thanks, fixed.

head/sys/vm/vm_kern.c
504–507

This doesn't honor the kernel policy, nor will it work once we have holes in the domain space.

You should be looking at the ordered list of domains in the policy assigned to the kernel_object at a minimum. I think the best solution would be to run the normal iterator within this outer loop so it is run once per QUANTUM and is allowed to make its own decisions about domains.

markj added inline comments.
head/sys/vm/vm_kern.c
504–507

The patch to handle empty domains has already been updated to handle kmem_back(). Using a domainset iterator here will require some refactoring since we don't hold the object lock; I will look into it.

markj marked an inline comment as done.Oct 1 2018, 9:44 PM
markj added inline comments.
head/sys/vm/vm_kern.c
504–507

BTW, none of the kmem_* functions hold the object lock when running the iterator, which will cause a problem similar to the one fixed by r338755 if we end up defining a kernel policy.