Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs/core-api: memory-allocation: add mention of kmem_cache_create_userspace

Mention that when a part of a slab cache might be exported to the
userspace, the cache should be created using kmem_cache_create_usercopy()

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mike Rapoport and committed by
Jonathan Corbet
98e5f349 58f4df3c

+5 -3
+5 -3
Documentation/core-api/memory-allocation.rst
··· 113 113 114 114 If you need to allocate many identical objects you can use the slab 115 115 cache allocator. The cache should be set up with 116 - :c:func:`kmem_cache_create` before it can be used. Afterwards 117 - :c:func:`kmem_cache_alloc` and its convenience wrappers can allocate 118 - memory from that cache. 116 + :c:func:`kmem_cache_create` or :c:func:`kmem_cache_create_usercopy` 117 + before it can be used. The second function should be used if a part of 118 + the cache might be copied to the userspace. After the cache is 119 + created :c:func:`kmem_cache_alloc` and its convenience wrappers can 120 + allocate memory from that cache. 119 121 120 122 When the allocated memory is no longer needed it must be freed. You 121 123 can use :c:func:`kvfree` for the memory allocated with `kmalloc`,