lib/genalloc.c: include vmalloc.h
diff mbox series

Message ID 20190105212118.61022-1-olof@lixom.net
State In Next
Commit 35004f2e55807a1a1491db24ab512dd2f770a130
Headers show
Series
  • lib/genalloc.c: include vmalloc.h
Related show

Commit Message

Olof Johansson Jan. 5, 2019, 9:21 p.m. UTC
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 <sjhuang@iluvatar.ai>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexey Skidanov <alexey.skidanov@intel.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
---
 lib/genalloc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Linus Torvalds Jan. 5, 2019, 9:35 p.m. UTC | #1
On Sat, Jan 5, 2019 at 1:21 PM Olof Johansson <olof@lixom.net> wrote:
>
> 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
Olof Johansson Jan. 5, 2019, 9:44 p.m. UTC | #2
On Sat, Jan 5, 2019 at 1:35 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> On Sat, Jan 5, 2019 at 1:21 PM Olof Johansson <olof@lixom.net> wrote:
> >
> > 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
Andrew Morton Jan. 7, 2019, 10:56 p.m. UTC | #3
On Sat, 5 Jan 2019 13:35:33 -0800 Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Sat, Jan 5, 2019 at 1:21 PM Olof Johansson <olof@lixom.net> wrote:
> >
> > 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.
peter enderborg Jan. 10, 2019, 1:13 p.m. UTC | #4
On 1/7/19 11:56 PM, Andrew Morton wrote:
> On Sat, 5 Jan 2019 13:35:33 -0800 Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>> On Sat, Jan 5, 2019 at 1:21 PM Olof Johansson <olof@lixom.net> wrote:
>>> 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.
>
Is it now OK to use vmalloc in fast path's on all platforms?
Andrew Morton Jan. 10, 2019, 11:51 p.m. UTC | #5
On Thu, 10 Jan 2019 14:13:44 +0100 peter enderborg <peter.enderborg@sony.com> wrote:

> On 1/7/19 11:56 PM, Andrew Morton wrote:
> > On Sat, 5 Jan 2019 13:35:33 -0800 Linus Torvalds <torvalds@linux-foundation.org> wrote:
> >
> >> On Sat, Jan 5, 2019 at 1:21 PM Olof Johansson <olof@lixom.net> wrote:
> >>> 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.
> >
> 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?

Patch
diff mbox series

diff --git a/lib/genalloc.c b/lib/genalloc.c
index f365d71cdc774..7e85d1e37a6ea 100644
--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -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)
 {