Re: [S+Q 02/16] [PATCH 1/2] percpu: make @dyn_size always mean min dyn_size in first chunk init functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 27 Jun 2010, Tejun Heo wrote:

> >>  struct pcpu_alloc_info * __init pcpu_build_alloc_info(
> >> -				size_t reserved_size, ssize_t dyn_size,
> >> +				size_t reserved_size, size_t dyn_size,
> >>  				size_t atom_size,
> >>  				pcpu_fc_cpu_distance_fn_t cpu_distance_fn)
> >>  {
> >> @@ -1098,13 +1084,15 @@ struct pcpu_alloc_info * __init pcpu_bui
> >>  	memset(group_map, 0, sizeof(group_map));
> >>  	memset(group_cnt, 0, sizeof(group_map));
> >>  
> >> +	size_sum = PFN_ALIGN(static_size + reserved_size + dyn_size);
> >> +	dyn_size = size_sum - static_size - reserved_size;
> > 
> > Ok, so the only purpose of "dyn_size" is to store in the struct 
> > pcpu_alloc_info later.  Before this patch, ai->dyn_size would always be 0 
> > if that's what was passed to pcpu_build_alloc_info(), but due to this 
> > arithmetic it now requires that static_size + reserved_size to be pfn 
> > aligned.  Where is that enforced or do we not care?
> 
> I'm not really following you, but
> 
> * Nobody called pcpu_build_alloc_info() w/ zero dyn_size.  It was
>   either -1 or positive minimum size.
> 

Ok, the commit description said that passing pcpu_build_alloc_info() a 
dyn_size of 0 would force it to be 0, although the arithmetic introduced 
by this patch would not have necessarily set ai->dyn_size to be 0 when 
passed if static_size + reserved_size was not page aligned (size_sum 
could be greater than static_size + reserved_size).  Since there are no 
users passing a dyn_size of 0, my concern is addressed.

Thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]