linuxkpi: is_vmalloc_addr() is true inside a live vmap() mapping #20
Loading…
Reference in a new issue
No description provided.
Delete branch "x230-lkpi-is-vmalloc-addr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
is_vmalloc_addr()wasfalse. i915 unmaps a GEM object's kernel mapping only when it is true (unmap_object()in__i915_gem_object_put_pages()), so every pinned mapping of an object outlived the object's pages: the pages were freed and their kernel mapping stayed.On a ThinkPad X230 (HD 4000, i915n) each attach left seven such mappings. A DTrace of
vmap()/vmap_pfn()andlkpi_vmap_remove()over attach, a GL client and detach showed seven maps and no removal:and unloading misc/linuxkpi after three attach cycles reported
linuxkpi: 26 vmap() ranges left, whilelkpi_pageshowed no page in use.lkpi_is_vmap_addr()looks the address up in the layer's vmap index (a mapping that starts there, or the nearest one below that covers it, contiguous mappings at the pages' own address included), andis_vmalloc_addr()is that.vmalloc()memory is kmem here and staysfalse;vfree()/kvfree()free either kind, and the only other user in the build, i915's shrinker (I915_SHRINK_VMAPS), wants vmap mappings. The self-test (st_vmap) checks a live mapping, the contiguous case, a removed mapping and kmalloc() memory (compiled; not run on the X230, which has no spare PCI function for the self-test driver). Host tests: 30 tests, 777 checks pass.Tested on the X230 (branch
x230-testatfb919c6): attach, 2000-frame GL run, detach: 7 maps, 7 removals; unloading linuxkpi reports no ranges left.