Skip to contentSkip to conversation

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

PATCH Applied Mike Rapoport 2 participants 2 messages Jan 14, 2019 – Jan 15, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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()

---
 Documentation/core-api/memory-allocation.rst | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Documentation/core-api/memory-allocation.rst +5 -3
index 8954a88..51a200d 100644
@@ -113,9 +113,11 @@ see :c:func:`kvmalloc_node` reference documentation. Note that
 
 If you need to allocate many identical objects you can use the slab
 cache allocator. The cache should be set up with
-:c:func:`kmem_cache_create` before it can be used. Afterwards
-:c:func:`kmem_cache_alloc` and its convenience wrappers can allocate
-memory from that cache.
+:c:func:`kmem_cache_create` or :c:func:`kmem_cache_create_usercopy`
+before it can be used. The second function should be used if a part of
+the cache might be copied to the userspace.  After the cache is
+created :c:func:`kmem_cache_alloc` and its convenience wrappers can
+allocate memory from that cache.
 
 When the allocated memory is no longer needed it must be freed. You
 can use :c:func:`kvfree` for the memory allocated with `kmalloc`,
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 4 lines · On Mon, 14 Jan 2019 13:47:34 +0200 Mike Rapoport <[email protected]> wrote:

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()

Hmm...I didn't know that :)

Applied, thanks.

jon