From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by kanga.kvack.org (Postfix) with ESMTP id B5A7D6B0038 for ; Wed, 18 Dec 2013 01:54:10 -0500 (EST) Received: by mail-pa0-f47.google.com with SMTP id kq14so5541785pab.20 for ; Tue, 17 Dec 2013 22:54:10 -0800 (PST) Received: from LGEAMRELO01.lge.com (lgeamrelo01.lge.com. [156.147.1.125]) by mx.google.com with ESMTP id wh6si13516242pac.306.2013.12.17.22.54.07 for ; Tue, 17 Dec 2013 22:54:08 -0800 (PST) From: Joonsoo Kim Subject: [PATCH v3 04/14] mm, hugetlb: remove resv_map_put() Date: Wed, 18 Dec 2013 15:53:50 +0900 Message-Id: <1387349640-8071-5-git-send-email-iamjoonsoo.kim@lge.com> In-Reply-To: <1387349640-8071-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1387349640-8071-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Rik van Riel , Mel Gorman , Michal Hocko , "Aneesh Kumar K.V" , KAMEZAWA Hiroyuki , Hugh Dickins , Davidlohr Bueso , David Gibson , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim , Wanpeng Li , Naoya Horiguchi , Hillf Danton , Joonsoo Kim 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. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Joonsoo Kim diff --git a/mm/hugetlb.c b/mm/hugetlb.c index cf0eaff..ef70b6f 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2282,15 +2282,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); -} - static void hugetlb_vm_op_close(struct vm_area_struct *vma) { struct hstate *h = hstate_vma(vma); @@ -2307,7 +2298,7 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) reserve = (end - start) - region_count(resv, start, end); - resv_map_put(vma); + kref_put(&resv->refs, resv_map_release); if (reserve) { hugetlb_acct_memory(h, -reserve); @@ -3245,8 +3236,8 @@ int hugetlb_reserve_pages(struct inode *inode, region_add(resv_map, from, to); return 0; out_err: - if (vma) - resv_map_put(vma); + if (vma && is_vma_resv_set(vma, HPAGE_RESV_OWNER)) + kref_put(&resv_map->refs, resv_map_release); return ret; } -- 1.7.9.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org