Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-20 Thread Suren Baghdasaryan
On Tue, Jan 19, 2021 at 7:39 PM Hyesoo Yu  wrote:
>
> On Tue, Jan 19, 2021 at 12:36:40PM -0800, Minchan Kim wrote:
> > On Tue, Jan 19, 2021 at 10:29:29AM -0800, John Stultz wrote:
> > > On Tue, Jan 12, 2021 at 5:22 PM Minchan Kim  wrote:
> > > >
> > > > From: Hyesoo Yu 
> > > >
> > > > This patch supports chunk heap that allocates the buffers that
> > > > arranged into a list a fixed size chunks taken from CMA.
> > > >
> > > > The chunk heap driver is bound directly to a reserved_memory
> > > > node by following Rob Herring's suggestion in [1].
> > > >
> > > > [1] 
> > > > https://lore.kernel.org/lkml/20191025225009.50305-2-john.stu...@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d
> > > >
> > > > Signed-off-by: Hyesoo Yu 
> > > > Signed-off-by: Hridya Valsaraju 
> > > > Signed-off-by: Minchan Kim 

After addressing John's comments feel free to add Reviewed-by: Suren
Baghdasaryan 

> > > > ---
> > > ...
> > > > +static int register_chunk_heap(struct chunk_heap *chunk_heap_info)
> > > > +{
> > > > +   struct dma_heap_export_info exp_info;
> > > > +
> > > > +   exp_info.name = cma_get_name(chunk_heap_info->cma);
> > >
> > > One potential issue here, you're setting the name to the same as the
> > > CMA name. Since the CMA heap uses the CMA name, if one chunk was
> > > registered as a chunk heap but also was the default CMA area, it might
> > > be registered twice. But since both would have the same name it would
> > > be an initialization race as to which one "wins".
> >
> > Good point. Maybe someone might want to use default CMA area for
> > both cma_heap and chunk_heap. I cannot come up with ideas why we
> > should prohibit it atm.
> >
> > >
> > > So maybe could you postfix the CMA name with "-chunk" or something?
> >
> > Hyesoo, Any opinion?
> > Unless you have something other idea, let's fix it in next version.
> >
>
> I agree that. It is not good to use heap name directly as cma name.
> Let's postfix the name with '-chunk'
>
> Thanks,
> Regards.


Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-19 Thread Hyesoo Yu
On Tue, Jan 19, 2021 at 12:36:40PM -0800, Minchan Kim wrote:
> On Tue, Jan 19, 2021 at 10:29:29AM -0800, John Stultz wrote:
> > On Tue, Jan 12, 2021 at 5:22 PM Minchan Kim  wrote:
> > >
> > > From: Hyesoo Yu 
> > >
> > > This patch supports chunk heap that allocates the buffers that
> > > arranged into a list a fixed size chunks taken from CMA.
> > >
> > > The chunk heap driver is bound directly to a reserved_memory
> > > node by following Rob Herring's suggestion in [1].
> > >
> > > [1] 
> > > https://lore.kernel.org/lkml/20191025225009.50305-2-john.stu...@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d
> > >
> > > Signed-off-by: Hyesoo Yu 
> > > Signed-off-by: Hridya Valsaraju 
> > > Signed-off-by: Minchan Kim 
> > > ---
> > ...
> > > +static int register_chunk_heap(struct chunk_heap *chunk_heap_info)
> > > +{
> > > +   struct dma_heap_export_info exp_info;
> > > +
> > > +   exp_info.name = cma_get_name(chunk_heap_info->cma);
> > 
> > One potential issue here, you're setting the name to the same as the
> > CMA name. Since the CMA heap uses the CMA name, if one chunk was
> > registered as a chunk heap but also was the default CMA area, it might
> > be registered twice. But since both would have the same name it would
> > be an initialization race as to which one "wins".
> 
> Good point. Maybe someone might want to use default CMA area for
> both cma_heap and chunk_heap. I cannot come up with ideas why we
> should prohibit it atm.
> 
> > 
> > So maybe could you postfix the CMA name with "-chunk" or something?
> 
> Hyesoo, Any opinion?
> Unless you have something other idea, let's fix it in next version.
>

I agree that. It is not good to use heap name directly as cma name.
Let's postfix the name with '-chunk'

Thanks,
Regards.


Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-19 Thread Minchan Kim
On Tue, Jan 19, 2021 at 10:29:29AM -0800, John Stultz wrote:
> On Tue, Jan 12, 2021 at 5:22 PM Minchan Kim  wrote:
> >
> > From: Hyesoo Yu 
> >
> > This patch supports chunk heap that allocates the buffers that
> > arranged into a list a fixed size chunks taken from CMA.
> >
> > The chunk heap driver is bound directly to a reserved_memory
> > node by following Rob Herring's suggestion in [1].
> >
> > [1] 
> > https://lore.kernel.org/lkml/20191025225009.50305-2-john.stu...@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d
> >
> > Signed-off-by: Hyesoo Yu 
> > Signed-off-by: Hridya Valsaraju 
> > Signed-off-by: Minchan Kim 
> > ---
> ...
> > +static int register_chunk_heap(struct chunk_heap *chunk_heap_info)
> > +{
> > +   struct dma_heap_export_info exp_info;
> > +
> > +   exp_info.name = cma_get_name(chunk_heap_info->cma);
> 
> One potential issue here, you're setting the name to the same as the
> CMA name. Since the CMA heap uses the CMA name, if one chunk was
> registered as a chunk heap but also was the default CMA area, it might
> be registered twice. But since both would have the same name it would
> be an initialization race as to which one "wins".

Good point. Maybe someone might want to use default CMA area for
both cma_heap and chunk_heap. I cannot come up with ideas why we
should prohibit it atm.

> 
> So maybe could you postfix the CMA name with "-chunk" or something?

Hyesoo, Any opinion?
Unless you have something other idea, let's fix it in next version.


Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-19 Thread John Stultz
On Tue, Jan 12, 2021 at 5:22 PM Minchan Kim  wrote:
>
> From: Hyesoo Yu 
>
> This patch supports chunk heap that allocates the buffers that
> arranged into a list a fixed size chunks taken from CMA.
>
> The chunk heap driver is bound directly to a reserved_memory
> node by following Rob Herring's suggestion in [1].
>
> [1] 
> https://lore.kernel.org/lkml/20191025225009.50305-2-john.stu...@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d
>
> Signed-off-by: Hyesoo Yu 
> Signed-off-by: Hridya Valsaraju 
> Signed-off-by: Minchan Kim 
> ---
...
> +static int register_chunk_heap(struct chunk_heap *chunk_heap_info)
> +{
> +   struct dma_heap_export_info exp_info;
> +
> +   exp_info.name = cma_get_name(chunk_heap_info->cma);

One potential issue here, you're setting the name to the same as the
CMA name. Since the CMA heap uses the CMA name, if one chunk was
registered as a chunk heap but also was the default CMA area, it might
be registered twice. But since both would have the same name it would
be an initialization race as to which one "wins".

So maybe could you postfix the CMA name with "-chunk" or something?

thanks
-john


Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-19 Thread Minchan Kim
On Tue, Jan 12, 2021 at 05:21:43PM -0800, Minchan Kim wrote:
> From: Hyesoo Yu 
> 
> This patch supports chunk heap that allocates the buffers that
> arranged into a list a fixed size chunks taken from CMA.
> 
> The chunk heap driver is bound directly to a reserved_memory
> node by following Rob Herring's suggestion in [1].
> 
> [1] 
> https://lore.kernel.org/lkml/20191025225009.50305-2-john.stu...@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d
> 
> Signed-off-by: Hyesoo Yu 
> Signed-off-by: Hridya Valsaraju 
> Signed-off-by: Minchan Kim 

DMABUF folks,

It would be great if you guys give any comments.


Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-13 Thread Minchan Kim
On Wed, Jan 13, 2021 at 11:11:56AM +0800, kernel test robot wrote:
> Hi Minchan,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on next-20210112]
> [cannot apply to s390/features robh/for-next linux/master linus/master 
> hnaz-linux-mm/master v5.11-rc3 v5.11-rc2 v5.11-rc1 v5.11-rc3]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:
> https://github.com/0day-ci/linux/commits/Minchan-Kim/Chunk-Heap-Support-on-DMA-HEAP/20210113-092747
> base:df869cab4b3519d603806234861aa0a39df479c0
> config: mips-allyesconfig (attached as .config)
> compiler: mips-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # 
> https://github.com/0day-ci/linux/commit/531ebc21d3c2584784d44714e3b4f1df46b80eee
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review 
> Minchan-Kim/Chunk-Heap-Support-on-DMA-HEAP/20210113-092747
> git checkout 531ebc21d3c2584784d44714e3b4f1df46b80eee
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
> ARCH=mips 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot 
> 
> All warnings (new ones prefixed by >>):
> 
>drivers/dma-buf/heaps/chunk_heap.c: In function 'chunk_heap_do_vmap':
>drivers/dma-buf/heaps/chunk_heap.c:215:24: error: implicit declaration of 
> function 'vmalloc'; did you mean 'kvmalloc'? 
> [-Werror=implicit-function-declaration]
>  215 |  struct page **pages = vmalloc(sizeof(struct page *) * npages);
>  |^~~
>  |kvmalloc

Looks like we need vmalloc.h.


> >> drivers/dma-buf/heaps/chunk_heap.c:215:24: warning: initialization of 
> >> 'struct page **' from 'int' makes pointer from integer without a cast 
> >> [-Wint-conversion]
>drivers/dma-buf/heaps/chunk_heap.c:228:10: error: implicit declaration of 
> function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
>  228 |  vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
>  |  ^~~~
>  |  kmap

We need vmap, not kmap.

>drivers/dma-buf/heaps/chunk_heap.c:228:30: error: 'VM_MAP' undeclared 
> (first use in this function); did you mean 'VM_MTE'?
>  228 |  vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
>  |  ^~
>  |  VM_MTE

Looks like bot was confused since we have missed the vmalloc.h
In next spin, let's fix it.

>drivers/dma-buf/heaps/chunk_heap.c:228:30: note: each undeclared 
> identifier is reported only once for each function it appears in
>drivers/dma-buf/heaps/chunk_heap.c:229:2: error: implicit declaration of 
> function 'vfree'; did you mean 'kvfree'? 
> [-Werror=implicit-function-declaration]
>  229 |  vfree(pages);
>  |  ^
>  |  kvfree
>drivers/dma-buf/heaps/chunk_heap.c: In function 'chunk_heap_vunmap':
>drivers/dma-buf/heaps/chunk_heap.c:268:3: error: implicit declaration of 
> function 'vunmap'; did you mean 'kunmap'? 
> [-Werror=implicit-function-declaration]
>  268 |   vunmap(buffer->vaddr);
>  |   ^~
>  |   kunmap
>cc1: some warnings being treated as errors
> 
> 
> vim +215 drivers/dma-buf/heaps/chunk_heap.c
> 
>210
>211static void *chunk_heap_do_vmap(struct chunk_heap_buffer 
> *buffer)
>212{
>213struct sg_table *table = >sg_table;
>214int npages = PAGE_ALIGN(buffer->len) / PAGE_SIZE;
>  > 215struct page **pages = vmalloc(sizeof(struct page *) * 
> npages);
>216struct page **tmp = pages;
>217struct sg_page_iter piter;
>218void *vaddr;
>219
>220if (!pages)
>221return ERR_PTR(-ENOMEM);
>222
>223for_each_sgtable_page(table, , 0) {
>224WARN_ON(tmp - pages >= npages);
>225*tmp++ = sg_page_iter_page();
>226}
>227
>228vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
>229vfree(pages);
>230
>231if (!vaddr)
>232return ERR_PTR(-ENOMEM);
>233
>234return vaddr;
>235}
>236
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org




Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-13 Thread Minchan Kim
On Tue, Jan 12, 2021 at 07:38:40PM -0800, Randy Dunlap wrote:
> On 1/12/21 5:21 PM, Minchan Kim wrote:
> > +config DMABUF_HEAPS_CHUNK
> > +   bool "DMA-BUF CHUNK Heap"
> > +   depends on DMABUF_HEAPS && DMA_CMA
> > +   help
> > + Choose this option to enable dma-buf CHUNK heap. This heap is backed
> > + by the Contiguous Memory Allocator (CMA) and allocates the buffers 
> > that
> > + arranged into a list of fixed size chunks taken from CMA.
> 
> maybe:
> are arranged into

Let me fix it.

Thanks, Randy. 


Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-12 Thread kernel test robot
Hi Minchan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20210112]
[cannot apply to s390/features robh/for-next linux/master linus/master 
hnaz-linux-mm/master v5.11-rc3 v5.11-rc2 v5.11-rc1 v5.11-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:
https://github.com/0day-ci/linux/commits/Minchan-Kim/Chunk-Heap-Support-on-DMA-HEAP/20210113-092747
base:df869cab4b3519d603806234861aa0a39df479c0
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# 
https://github.com/0day-ci/linux/commit/531ebc21d3c2584784d44714e3b4f1df46b80eee
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review 
Minchan-Kim/Chunk-Heap-Support-on-DMA-HEAP/20210113-092747
git checkout 531ebc21d3c2584784d44714e3b4f1df46b80eee
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All errors (new ones prefixed by >>):

   drivers/dma-buf/heaps/chunk_heap.c: In function 'chunk_heap_do_vmap':
>> drivers/dma-buf/heaps/chunk_heap.c:215:24: error: implicit declaration of 
>> function 'vmalloc'; did you mean 'kvmalloc'? 
>> [-Werror=implicit-function-declaration]
 215 |  struct page **pages = vmalloc(sizeof(struct page *) * npages);
 |^~~
 |kvmalloc
   drivers/dma-buf/heaps/chunk_heap.c:215:24: warning: initialization of 
'struct page **' from 'int' makes pointer from integer without a cast 
[-Wint-conversion]
>> drivers/dma-buf/heaps/chunk_heap.c:228:10: error: implicit declaration of 
>> function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
 228 |  vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
 |  ^~~~
 |  kmap
>> drivers/dma-buf/heaps/chunk_heap.c:228:30: error: 'VM_MAP' undeclared (first 
>> use in this function); did you mean 'VM_MTE'?
 228 |  vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
 |  ^~
 |  VM_MTE
   drivers/dma-buf/heaps/chunk_heap.c:228:30: note: each undeclared identifier 
is reported only once for each function it appears in
>> drivers/dma-buf/heaps/chunk_heap.c:229:2: error: implicit declaration of 
>> function 'vfree'; did you mean 'kvfree'? 
>> [-Werror=implicit-function-declaration]
 229 |  vfree(pages);
 |  ^
 |  kvfree
   drivers/dma-buf/heaps/chunk_heap.c: In function 'chunk_heap_vunmap':
>> drivers/dma-buf/heaps/chunk_heap.c:268:3: error: implicit declaration of 
>> function 'vunmap'; did you mean 'kunmap'? 
>> [-Werror=implicit-function-declaration]
 268 |   vunmap(buffer->vaddr);
 |   ^~
 |   kunmap
   cc1: some warnings being treated as errors


vim +215 drivers/dma-buf/heaps/chunk_heap.c

   210  
   211  static void *chunk_heap_do_vmap(struct chunk_heap_buffer *buffer)
   212  {
   213  struct sg_table *table = >sg_table;
   214  int npages = PAGE_ALIGN(buffer->len) / PAGE_SIZE;
 > 215  struct page **pages = vmalloc(sizeof(struct page *) * npages);
   216  struct page **tmp = pages;
   217  struct sg_page_iter piter;
   218  void *vaddr;
   219  
   220  if (!pages)
   221  return ERR_PTR(-ENOMEM);
   222  
   223  for_each_sgtable_page(table, , 0) {
   224  WARN_ON(tmp - pages >= npages);
   225  *tmp++ = sg_page_iter_page();
   226  }
   227  
 > 228  vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
 > 229  vfree(pages);
   230  
   231  if (!vaddr)
   232  return ERR_PTR(-ENOMEM);
   233  
   234  return vaddr;
   235  }
   236  
   237  static int chunk_heap_vmap(struct dma_buf *dmabuf, struct dma_buf_map 
*map)
   238  {
   239  struct chunk_heap_buffer *buffer = dmabuf->priv;
   240  void *vaddr;
   241  
   242  mutex_lock(>lock);
   243  if (buffer->vmap_cnt) {
   244  vaddr = buffer->vaddr;
   245  } else {
   246  vaddr = chunk_heap_do_vmap(buffer);
   247  if (IS_ERR(vaddr)) {
   248  mutex_unlock(>lock);
   249  
   250  return PTR_ERR(vaddr);
   251  }
   252  buffer->vaddr = vaddr;
   253  }
   254  buffer->vmap_cnt++;
   255  

Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-12 Thread Randy Dunlap
On 1/12/21 5:21 PM, Minchan Kim wrote:
> +config DMABUF_HEAPS_CHUNK
> + bool "DMA-BUF CHUNK Heap"
> + depends on DMABUF_HEAPS && DMA_CMA
> + help
> +   Choose this option to enable dma-buf CHUNK heap. This heap is backed
> +   by the Contiguous Memory Allocator (CMA) and allocates the buffers 
> that
> +   arranged into a list of fixed size chunks taken from CMA.

maybe:
  are arranged into

-- 
~Randy
You can't do anything without having to do something else first.
-- Belefant's Law


Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-12 Thread kernel test robot
Hi Minchan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on next-20210112]
[cannot apply to s390/features robh/for-next linux/master linus/master 
hnaz-linux-mm/master v5.11-rc3 v5.11-rc2 v5.11-rc1 v5.11-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:
https://github.com/0day-ci/linux/commits/Minchan-Kim/Chunk-Heap-Support-on-DMA-HEAP/20210113-092747
base:df869cab4b3519d603806234861aa0a39df479c0
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# 
https://github.com/0day-ci/linux/commit/531ebc21d3c2584784d44714e3b4f1df46b80eee
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review 
Minchan-Kim/Chunk-Heap-Support-on-DMA-HEAP/20210113-092747
git checkout 531ebc21d3c2584784d44714e3b4f1df46b80eee
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All warnings (new ones prefixed by >>):

   drivers/dma-buf/heaps/chunk_heap.c: In function 'chunk_heap_do_vmap':
   drivers/dma-buf/heaps/chunk_heap.c:215:24: error: implicit declaration of 
function 'vmalloc'; did you mean 'kvmalloc'? 
[-Werror=implicit-function-declaration]
 215 |  struct page **pages = vmalloc(sizeof(struct page *) * npages);
 |^~~
 |kvmalloc
>> drivers/dma-buf/heaps/chunk_heap.c:215:24: warning: initialization of 
>> 'struct page **' from 'int' makes pointer from integer without a cast 
>> [-Wint-conversion]
   drivers/dma-buf/heaps/chunk_heap.c:228:10: error: implicit declaration of 
function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
 228 |  vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
 |  ^~~~
 |  kmap
   drivers/dma-buf/heaps/chunk_heap.c:228:30: error: 'VM_MAP' undeclared (first 
use in this function); did you mean 'VM_MTE'?
 228 |  vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
 |  ^~
 |  VM_MTE
   drivers/dma-buf/heaps/chunk_heap.c:228:30: note: each undeclared identifier 
is reported only once for each function it appears in
   drivers/dma-buf/heaps/chunk_heap.c:229:2: error: implicit declaration of 
function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
 229 |  vfree(pages);
 |  ^
 |  kvfree
   drivers/dma-buf/heaps/chunk_heap.c: In function 'chunk_heap_vunmap':
   drivers/dma-buf/heaps/chunk_heap.c:268:3: error: implicit declaration of 
function 'vunmap'; did you mean 'kunmap'? 
[-Werror=implicit-function-declaration]
 268 |   vunmap(buffer->vaddr);
 |   ^~
 |   kunmap
   cc1: some warnings being treated as errors


vim +215 drivers/dma-buf/heaps/chunk_heap.c

   210  
   211  static void *chunk_heap_do_vmap(struct chunk_heap_buffer *buffer)
   212  {
   213  struct sg_table *table = >sg_table;
   214  int npages = PAGE_ALIGN(buffer->len) / PAGE_SIZE;
 > 215  struct page **pages = vmalloc(sizeof(struct page *) * npages);
   216  struct page **tmp = pages;
   217  struct sg_page_iter piter;
   218  void *vaddr;
   219  
   220  if (!pages)
   221  return ERR_PTR(-ENOMEM);
   222  
   223  for_each_sgtable_page(table, , 0) {
   224  WARN_ON(tmp - pages >= npages);
   225  *tmp++ = sg_page_iter_page();
   226  }
   227  
   228  vaddr = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
   229  vfree(pages);
   230  
   231  if (!vaddr)
   232  return ERR_PTR(-ENOMEM);
   233  
   234  return vaddr;
   235  }
   236  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org


.config.gz
Description: application/gzip