Skip to contentSkip to conversation

lib/genalloc.c: include vmalloc.h

PATCH In review Olof Johansson 4 participants 6 messages Jan 5, 2019 – Jan 10, 2019 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/genalloc.c: include vmalloc.h

Fixes build break on most ARM/ARM64 defconfigs:

lib/genalloc.c: In function 'gen_pool_add_virt':
lib/genalloc.c:190:10: error: implicit declaration of function 'vzalloc_node'; did you mean 'kzalloc_node'? lib/genalloc.c:190:8: warning: assignment to 'struct gen_pool_chunk *' from 'int' makes pointer from integer without a cast [-Wint-conversion] lib/genalloc.c: In function 'gen_pool_destroy':
lib/genalloc.c:254:3: error: implicit declaration of function 'vfree'; did you mean 'kfree'?

Fixes 6862d2fc8185 ('lib/genalloc.c: use vzalloc_node() to allocate the bitmap')
Cc Huang Shijie <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Alexey Skidanov <[email protected]>
---
 lib/genalloc.c | 1 +
 1 file changed, 1 insertion(+)
lib/genalloc.c +1 -0
index f365d71cdc774..7e85d1e37a6ea 100644
@@ -35,6 +35,7 @@
 #include <linux/interrupt.h>
 #include <linux/genalloc.h>
 #include <linux/of_device.h>
+#include <linux/vmalloc.h>
 
 static inline size_t chunk_size(const struct gen_pool_chunk *chunk)
 {
Signature · 1 line
2.11.0
#1 lore raw
Quoted 2 lines · Olof Johansson

Fixes build break on most ARM/ARM64 defconfigs:

Interesting.

Andrew, I thought ARM was one of the platforms that your tree compiled against? Or was some other change just hiding this?

Anyway, I'll apply as soon as the previous build test finishes.

Linus

#2 lore raw
Quoted 11 lines · Linus Torvalds
Quoted 2 lines · Olof Johansson

Fixes build break on most ARM/ARM64 defconfigs:

Interesting.

Andrew, I thought ARM was one of the platforms that your tree compiled against? Or was some other change just hiding this?

Anyway, I'll apply as soon as the previous build test finishes.

Looks like the patch might have been queued pretty recently, I don't see it in the Jan 3 linux-next tree.

I'm not familiar with Andrew's patch queues, but it seems to be there in the 'mmots' (Jan 4), but not in 'mmotm' (Dec 22).

-Olof

-Olof

maintainer
#3 lore raw
In reply to Linus Torvalds
Quoted 9 lines · On Sat, 5 Jan 2019 13:35:33 -0800 Linus Torvalds…
Quoted 2 lines · Olof Johansson

Fixes build break on most ARM/ARM64 defconfigs:

Interesting.

Andrew, I thought ARM was one of the platforms that your tree compiled against? Or was some other change just hiding this?

I've become a bit lazy with the cross-compiling because linux-next's build coverage is pretty broad. But Stephen's holiday interrupted things and this one fell in that window.

#4 lore raw
Quoted 4 lines · Andrew Morton
Quoted 2 lines · On Sat, 5 Jan 2019 13:35:33 -0800 Linus Torvalds…
Quoted 1 line · Olof Johansson

Fixes build break on most ARM/ARM64 defconfigs:

Quoted 9 lines
Quoted 5 lines

Interesting.

Andrew, I thought ARM was one of the platforms that your tree compiled against? Or was some other change just hiding this?

I've become a bit lazy with the cross-compiling because linux-next's build coverage is pretty broad. But Stephen's holiday interrupted things and this one fell in that window.

Is it now OK to use vmalloc in fast path's on all platforms?

maintainer
#5 lore raw
Quoted 7 lines · On Thu, 10 Jan 2019 14:13:44 +0100 peter enderborg <[email protected]>…
Quoted 6 lines · Andrew Morton
Quoted 4 lines · On Sat, 5 Jan 2019 13:35:33 -0800 Linus Torvalds…
Quoted 1 line · Olof Johansson

Fixes build break on most ARM/ARM64 defconfigs:

Interesting.

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

Andrew, I thought ARM was one of the platforms that your tree compiled against? Or was some other change just hiding this?

I've become a bit lazy with the cross-compiling because linux-next's build coverage is pretty broad. But Stephen's holiday interrupted things and this one fell in that window.

Is it now OK to use vmalloc in fast path's on all platforms?

I'd say not. It is slower than kmalloc and these changes did nothing to speed it up.

That being said, vmalloc is for "large" memory allocations and large amounts of memory take large amount of time to utilize, so unless the code is allocating then freeing memory without using it (don't do that) then vmalloc() can never be a "fast path" thing?