From: akpm@linux-foundation.org Subject: + mm-hugetlb-use-vma_resv_map-map-types-update.patch added to -mm tree Date: Mon, 03 Feb 2014 16:15:49 -0800 Message-ID: <52f03135.16edEjRgFofVP7Wr%akpm@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:47467 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753181AbaBDAPu (ORCPT ); Mon, 3 Feb 2014 19:15:50 -0500 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: mm-commits@vger.kernel.org, n-horiguchi@ah.jp.nec.com, davidlohr@hp.com, david@gibson.dropbear.id.au, aneesh.kumar@linux.vnet.ibm.com, iamjoonsoo.kim@lge.com Subject: + mm-hugetlb-use-vma_resv_map-map-types-update.patch added to -mm tree To: iamjoonsoo.kim@lge.com,aneesh.kumar@linux.vnet.ibm.com,david@gibson.dropbear.id.au,davidlohr@hp.com,n-horiguchi@ah.jp.nec.com From: akpm@linux-foundation.org Date: Mon, 03 Feb 2014 16:15:49 -0800 The patch titled Subject: mm, hugetlb: use vma_resv_map() map types has been added to the -mm tree. Its filename is mm-hugetlb-use-vma_resv_map-map-types-update.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-hugetlb-use-vma_resv_map-map-types-update.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-hugetlb-use-vma_resv_map-map-types-update.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Joonsoo Kim Subject: mm, hugetlb: use vma_resv_map() map types Util now, we get a resv_map by two ways according to each mapping type. This makes code dirty and unreadable. Unify it. Signed-off-by: Davidlohr Bueso Cc: Joonsoo Kim Cc: Aneesh Kumar K.V Cc: Naoya Horiguchi Cc: David Gibson Signed-off-by: Andrew Morton --- mm/hugetlb.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff -puN mm/hugetlb.c~mm-hugetlb-use-vma_resv_map-map-types-update mm/hugetlb.c --- a/mm/hugetlb.c~mm-hugetlb-use-vma_resv_map-map-types-update +++ a/mm/hugetlb.c @@ -2275,21 +2275,26 @@ static void hugetlb_vm_op_close(struct v struct hstate *h = hstate_vma(vma); struct resv_map *resv = vma_resv_map(vma); struct hugepage_subpool *spool = subpool_vma(vma); - unsigned long reserve, start, end; + unsigned long reserve; + unsigned long start; + unsigned long end; - if (!resv || !is_vma_resv_set(vma, HPAGE_RESV_OWNER)) + if (!resv) return; - start = vma_hugecache_offset(h, vma, vma->vm_start); - end = vma_hugecache_offset(h, vma, vma->vm_end); - - reserve = (end - start) - region_count(resv, start, end); - - kref_put(&resv->refs, resv_map_release); - - if (reserve) { - hugetlb_acct_memory(h, -reserve); - hugepage_subpool_put_pages(spool, reserve); + if (is_vma_resv_set(vma, HPAGE_RESV_OWNER)) { + start = vma_hugecache_offset(h, vma, vma->vm_start); + end = vma_hugecache_offset(h, vma, vma->vm_end); + + reserve = (end - start) - + region_count(resv, start, end); + + kref_put(&resv->refs, resv_map_release); + + if (reserve) { + hugetlb_acct_memory(h, -reserve); + hugepage_subpool_put_pages(spool, reserve); + } } } _ Patches currently in -mm which might be from iamjoonsoo.kim@lge.com are kthread-ensure-locality-of-task_struct-allocations.patch mm-hugetlb-unify-region-structure-handling.patch mm-hugetlb-improve-cleanup-resv_map-parameters.patch mm-hugetlb-fix-race-in-region-tracking.patch mm-hugetlb-fix-race-in-region-tracking-update.patch mm-hugetlb-remove-resv_map_put.patch mm-hugetlb-use-vma_resv_map-map-types.patch mm-hugetlb-use-vma_resv_map-map-types-update.patch mm-hugetlb-use-vma_resv_map-map-types-update-fix.patch mm-hugetlb-improve-page-fault-scalability.patch mm-hugetlb-improve-page-fault-scalability-fix.patch mm-hugetlb-improve-page-fault-scalability-update.patch