Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966132Ab3HIJaN (ORCPT ); Fri, 9 Aug 2013 05:30:13 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:52749 "EHLO LGEMRELSE7Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965887Ab3HIJ1O (ORCPT ); Fri, 9 Aug 2013 05:27:14 -0400 X-AuditID: 9c930197-b7b44ae00000347f-a8-5204b5ed2ecb From: Joonsoo Kim 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 Subject: [PATCH v2 10/20] mm, hugetlb: remove resv_map_put() Date: Fri, 9 Aug 2013 18:26:28 +0900 Message-Id: <1376040398-11212-11-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1376040398-11212-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1376040398-11212-1-git-send-email-iamjoonsoo.kim@lge.com> X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1621 Lines: 55 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 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); -} - static void hugetlb_vm_op_close(struct vm_area_struct *vma) { struct hstate *h = hstate_vma(vma); @@ -2237,7 +2228,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); @@ -3164,8 +3155,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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/