]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: try kmalloc, then vmalloc
authorSage Weil <sage@newdream.net>
Wed, 30 Sep 2009 18:43:31 +0000 (11:43 -0700)
committerSage Weil <sage@newdream.net>
Wed, 30 Sep 2009 18:43:31 +0000 (11:43 -0700)
"A still-lame-but-less-lame option here would be to attempt the kmalloc
(with __GFP_NOWARN) and if it failed, fall back to vmalloc." says akpm

src/TODO
src/kernel/buffer.c

index d7f1e8c1284bea7cdefdaf444a090b609cbdcc8f..55b53b7be4cb495399764ff4e5147d4ff03aa959 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -24,9 +24,11 @@ v0.16
 /- uninline frags
 /- uninline string hash
 - document data structures
-- audit all inline in kclient
+/- audit all inline in kclient
 - document on-wire protocol
-- ceph_buffer fixes
+- ceph_buffer and vmalloc?
+- ceph_i_test
+- bit ops in messenger
 
 bugs
 - mislinked directory?
index 635e7df4bd6cadf77f7565f710124717f6fab1a8..cf9aaccef22bad4d18f85f981a39f4561c389cdf 100644 (file)
@@ -18,8 +18,8 @@ struct ceph_buffer *ceph_buffer_new(gfp_t gfp)
 
 int ceph_buffer_alloc(struct ceph_buffer *b, int len, gfp_t gfp)
 {
-       if (len <= PAGE_SIZE) {
-               b->vec.iov_base = kmalloc(len, gfp);
+       b->vec.iov_base = kmalloc(len, gfp | __GFP_NOWARN);
+       if (b->vec.iov_base) {
                b->is_vmalloc = false;
        } else {
                b->vec.iov_base = __vmalloc(len, gfp, PAGE_KERNEL);