| #
bf4afc53 |
| 22-Feb-2026 |
Linus Torvalds <torvalds@linux-foundation.org> |
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly more complex cases spread over multiple lines would not be triggered: they definitely exist, but this covers the vast bulk of the cases, and the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
| #
69050f8d |
| 21-Feb-2026 |
Kees Cook <kees@kernel.org> |
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to avoid sc
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to avoid scalar types (which need careful case-by-case checking), and instead replace kmalloc-family calls that allocate struct or union object instances:
Single allocations: kmalloc(sizeof(TYPE), ...) are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...) are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...) are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning "TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
show more ...
|
| #
e44f47a9 |
| 19-Dec-2025 |
Thomas Hellström <thomas.hellstrom@linux.intel.com> |
drm/pagemap_util: Add a utility to assign an owner to a set of interconnected gpus
The hmm_range_fault() and the migration helpers currently need a common "owner" to identify pagemaps and clients wi
drm/pagemap_util: Add a utility to assign an owner to a set of interconnected gpus
The hmm_range_fault() and the migration helpers currently need a common "owner" to identify pagemaps and clients with fast interconnect. Add a drm_pagemap utility to setup such owners by registering drm_pagemaps, in a registry, and for each new drm_pagemap, query which existing drm_pagemaps have fast interconnects with the new drm_pagemap.
The "owner" scheme is limited in that it is static at drm_pagemap creation. Ideally one would want the owner to be adjusted at run-time, but that requires changes to hmm. If the proposed scheme becomes too limited, we need to revisit.
v2: - Improve documentation of DRM_PAGEMAP_OWNER_LIST_DEFINE(). (Matt Brost)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> # For merging through drm-xe. Link: https://patch.msgid.link/20251219113320.183860-11-thomas.hellstrom@linux.intel.com
show more ...
|
| #
77f14f2f |
| 19-Dec-2025 |
Thomas Hellström <thomas.hellstrom@linux.intel.com> |
drm/pagemap: Add a drm_pagemap cache and shrinker
Pagemaps are costly to set up and tear down, and they consume a lot of system memory for the struct pages. Ideally they should be created only when
drm/pagemap: Add a drm_pagemap cache and shrinker
Pagemaps are costly to set up and tear down, and they consume a lot of system memory for the struct pages. Ideally they should be created only when needed.
Add a caching mechanism to allow doing just that: Create the drm_pagemaps when needed for migration. Keep them around to avoid destruction and re-creation latencies and destroy inactive/unused drm_pagemaps on memory pressure using a shrinker.
Only add the helper functions. They will be hooked up to the xe driver in the upcoming patch.
v2: - Add lockdep checking for drm_pagemap_put(). (Matt Brost) - Add a copyright notice. (Matt Brost)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> # For merging through drm-xe. Link: https://patch.msgid.link/20251219113320.183860-8-thomas.hellstrom@linux.intel.com
show more ...
|