Re: [PATCH v2 10/20] mm, hugetlb: remove resv_map_put()

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

 



On Wed, Aug 21, 2013 at 04:19:20PM +0530, Aneesh Kumar K.V wrote:
> Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> writes:
> 
> > In following patch, I change vma_resv_map() to return resv_map
> > for all case. This patch prepares it by removing resv_map_put() which
> > doesn't works properly with following change, because it works only for
> > HPAGE_RESV_OWNER's resv_map, not for all resv_maps.
> >
> > Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>
> >
> > diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> > index 73034dd..869c3e0 100644
> > --- a/mm/hugetlb.c
> > +++ b/mm/hugetlb.c
> > @@ -2212,15 +2212,6 @@ static void hugetlb_vm_op_open(struct vm_area_struct *vma)
> >  		kref_get(&resv->refs);
> >  }
> >
> > -static void resv_map_put(struct vm_area_struct *vma)
> > -{
> > -	struct resv_map *resv = vma_resv_map(vma);
> > -
> > -	if (!resv)
> > -		return;
> > -	kref_put(&resv->refs, resv_map_release);
> > -}
> 
> Why not have seperate functions to return vma_resv_map for
> HPAGE_RESV_OWNER and one for put ? That way we could have something like
> 
> resv_map_hpage_resv_owner_get()
> resv_map_hpge_resv_put() 

Because there is no place to call this function more than once.
IMO, in this simple case, open code is better to understand and better to
reduce code size.

> 
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx>

Thanks :)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  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]