]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
libceph: add ceph_kv{malloc,free}() and switch to them
authorIlya Dryomov <ilya.dryomov@inktank.com>
Thu, 9 Jan 2014 18:08:21 +0000 (20:08 +0200)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 14 Jan 2014 17:03:52 +0000 (19:03 +0200)
commit58c08486557701af87e29cc124190b6541317b7f
treef433f141d70591a611ad229e00b85e3c00a4decf
parentf2be82b0058e90b5d9ac2cb896b4914276fb50ef
libceph: add ceph_kv{malloc,free}() and switch to them

Encapsulate kmalloc vs vmalloc memory allocation and freeing logic into
two helpers, ceph_kvmalloc() and ceph_kvfree(), and switch to them.

ceph_kvmalloc() kmalloc()'s a maximum of 8 pages, anything bigger is
vmalloc()'ed with __GFP_HIGHMEM set.  This changes the existing
behaviour:

- for buffers (ceph_buffer_new()), from trying to kmalloc() everything
  and using vmalloc() just as a fallback

- for messages (ceph_msg_new()), from going to vmalloc() for anything
  bigger than a page

- for messages (ceph_msg_new()), from disallowing vmalloc() to use high
  memory

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
include/linux/ceph/buffer.h
include/linux/ceph/libceph.h
include/linux/ceph/messenger.h
net/ceph/buffer.c
net/ceph/ceph_common.c
net/ceph/messenger.c