kmem_cache_ *是否创建连续内存? [英] kmem_cache_* creates contiguous memory?

查看:68
本文介绍了kmem_cache_ *是否创建连续内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是对的,假设用kmem_cache_createkmem_cache_alloc创建并分配的内存平板是连续的吗?

Am I right assuming that a memory slab created and allocated with kmem_cache_create and kmem_cache_alloc is contiguous?

推荐答案

  • kmem_cache由1个或多个平板组成.
  • 一个平板由1个或多个连续的页面组成.
  • 因此,当您调用kmem_cache_alloc时,它将在包含1个或多个连续页面的slab中返回一块内存.

    So when you call kmem_cache_alloc, it returns you a piece of memory in a slab which consists of 1 or more contiguous pages.

    但是,如果您两次调用kmem_cache_alloc,则您获得的2条内存可能是不连续的.

    But if you call kmem_cache_alloc twice, the 2 pieces of memory you get may not contiguous.

    kmem_cache_create仅创建和初始化kmem_cache的数据结构,不分配内存.

    And kmem_cache_create only creates and initializes the data structure for a kmem_cache and do not allocate the memories.

    这篇关于kmem_cache_ *是否创建连续内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆