lkml.org 
[lkml]   [2015]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] perpuc: check pcpu_first_chunk and pcpu_reserved_chunk to avoid handling them twice
On Mon, Jul 20, 2015 at 10:55:29PM +0800, Baoquan He wrote:
> In pcpu_setup_first_chunk() pcpu_reserved_chunk is assigned to point to
> static chunk. While pcpu_first_chunk is got from below code:
>
> pcpu_first_chunk = dchunk ?: schunk;
>
> Then it could point to static chunk too if dynamic chunk doesn't exist. So
> in this patch adding a check in percpu_init_late() to see if pcpu_first_chunk
> is equal to pcpu_reserved_chunk. Only if they are not equal we add
> pcpu_reserved_chunk to the target array.

So, I don't think this is actually possible. dyn_size can't be zero
so if reserved chunk is created, dyn chunk is also always created and
thus first chunk can't equal reserved chunk. It might be useful to
add some comments explaining this or maybe WARN_ON() but I don't think
this path is necessary.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2015-07-21 17:41    [W:0.170 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site