From patchwork Mon Nov 19 14:42:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 12939 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 33B0523FC0 for ; Mon, 19 Nov 2012 14:43:22 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id B0E31A1873F for ; Mon, 19 Nov 2012 14:43:21 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so6526048iej.11 for ; Mon, 19 Nov 2012 06:43:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:cc:subject:x-beenthere:x-mailman-version :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=WRxKReXr6t4+iejMUSqCgOdntO68hTU+uyWFwN+Dsuk=; b=TSJe1U9n7tCFu/uY6B2nj0pmpOIlTdApBy8WQeCPnjLyWFLguokBHt0L7CIfK7qYEE svCLS+7QtKpauPq9jVl+AfX8/q8nRttYvn157/auRrs28aXrIa+VzrZkgwO3CSAZLgGT 0mt7vK/iV9B9tcF/nFgegsoERzqIHJ4f6aGNW+3R8CccINeqCh/h8pu1+lxOALCfjKqL 2vnD7qCKmsmFHOcilsBSYIPAjuoPQbjpQR0XsrUUW9Gdhkf0o8v4f0YyUNaY05qQ1UhC mM2itzBdKkzzPzqFFKSCy9IZwnH3nxRaRmcxwBpTGiiM1fO1VZfA1dSsa8/lavKP1sxo PpIQ== Received: by 10.50.173.34 with SMTP id bh2mr6676914igc.70.1353336201188; Mon, 19 Nov 2012 06:43:21 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp168929igt; Mon, 19 Nov 2012 06:43:20 -0800 (PST) Received: by 10.204.143.147 with SMTP id v19mr612365bku.32.1353336199501; Mon, 19 Nov 2012 06:43:19 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id iu7si15678238bkc.150.2012.11.19.06.43.17; Mon, 19 Nov 2012 06:43:19 -0800 (PST) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TaSZ9-0002HE-8D; Mon, 19 Nov 2012 14:43:15 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TaSZ6-0002GX-TE for linaro-mm-sig@lists.linaro.org; Mon, 19 Nov 2012 14:43:13 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MDQ00074OVTFU40@mailout1.samsung.com> for linaro-mm-sig@lists.linaro.org; Mon, 19 Nov 2012 23:43:09 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-90-50aa457daafd Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id F6.91.12699.D754AA05; Mon, 19 Nov 2012 23:43:09 +0900 (KST) Received: from localhost.localdomain ([106.116.147.30]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MDQ009RJOVLMY70@mmp1.samsung.com> for linaro-mm-sig@lists.linaro.org; Mon, 19 Nov 2012 23:43:09 +0900 (KST) From: Marek Szyprowski To: linux-mm@kvack.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org Date: Mon, 19 Nov 2012 15:42:49 +0100 Message-id: <1353336169-23868-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <50A7D524.2060809@gmail.com> References: <50A7D524.2060809@gmail.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAJMWRmVeSWpSXmKPExsVy+t9jAd1a11UBBnPbBCy+XHnI5MDocfvf Y+YAxigum5TUnMyy1CJ9uwSujCOTf7AXXOaqeNJ0jK2B8RZHFyMnh4SAicSztXfYIWwxiQv3 1rOB2EICixglVi6z7WLkArJXMUncOPEaLMEmYCjR9bYLzBYRCJP407iNFcRmFvjBJNHQEtzF yMEhLJAm8WdJHkiYRUBVYkbXMyYQm1fAQ+LB42+MICUSAgoScybZgIQ5BTQlnpxazQSxVkNi T+cF5gmMvAsYGVYxiqYWJBcUJ6XnGukVJ+YWl+al6yXn525iBPv7mfQOxlUNFocYBTgYlXh4 PSasDBBiTSwrrsw9xCjBwawkwvtKaVWAEG9KYmVValF+fFFpTmrxIUZpDhYlcd5mj5QAIYH0 xJLU7NTUgtQimCwTB6dUA+O8wsBoz8/KxkX/o+4u9TjhmH31YH94R53UgryeCA1bzQdrPJcz XF6d++RAv3R3v5b2llDrQz4f/+TOMxHhnBMRHdtmvetlzamK0kOXe3tFNs1frPziiu+BxV8O qtkmcwQ9iNquwXQkdzX7sY97r7y22ib8eMPTxJmLOvaetpk1rWRj4OZtei+UWIozEg21mIuK EwFkHxWo8wEAAA== Cc: Arnd Bergmann , Bartlomiej Zolnierkiewicz , Mel Gorman , Michal Nazarewicz , Minchan Kim , Kyungmin Park , Andrew Morton Subject: [Linaro-mm-sig] [PATCH] mm: cma: skip watermarks check for already isolated blocks in split_free_page() fix X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQlYB6I1q+2XEt1DGZpPlGuNyOWDHXN9g6ReFLorKpcTrVb/rkO5bDP/3R35kNasiTPuOsVU Cleanup and simplify the code which uses page migrate type. Signed-off-by: Marek Szyprowski --- mm/page_alloc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6b990cb..f05365f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1393,12 +1393,15 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype) zone = page_zone(page); order = page_order(page); + mt = get_pageblock_migratetype(page); - if (get_pageblock_migratetype(page) != MIGRATE_ISOLATE) { + if (mt != MIGRATE_ISOLATE) { /* Obey watermarks as if the page was being allocated */ watermark = low_wmark_pages(zone) + (1 << order); if (!zone_watermark_ok(zone, 0, watermark, 0, 0)) return 0; + + __mod_zone_freepage_state(zone, -(1UL << order), mt); } /* Remove page from free list */ @@ -1406,10 +1409,6 @@ int capture_free_page(struct page *page, int alloc_order, int migratetype) zone->free_area[order].nr_free--; rmv_page_order(page); - mt = get_pageblock_migratetype(page); - if (unlikely(mt != MIGRATE_ISOLATE)) - __mod_zone_freepage_state(zone, -(1UL << order), mt); - if (alloc_order != order) expand(zone, page, alloc_order, order, &zone->free_area[order], migratetype);