From patchwork Tue Jun 5 19:27:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 9123 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 D979A23E56 for ; Tue, 5 Jun 2012 19:27:19 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 8EC65A189C6 for ; Tue, 5 Jun 2012 19:27:19 +0000 (UTC) Received: by yhpp61 with SMTP id p61so4740104yhp.11 for ; Tue, 05 Jun 2012 12:27:19 -0700 (PDT) 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-ironport-av:from:to:date:message-id:x-mailer: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=FKpitTNXPDXPkms4hPfCvJpaDOK8NI9WTJpQhpkvUUk=; b=I9ZT2hRPgKG3Uq8t3rwF2x/PbB3RcJIWBy7b0Ahe7r0/b/Eeti8YvPhfkPfGkqhuCN Uob7hKZsKIfJyoVKPxmdU8XfFeDBJN1ppNEC1qJCVITowmGBNY6VZHHmQ8WMAqe4tGM1 uPbL9suPnQvGQqjzS1Mts989PXza55yMTRsH43MyakOfT7t/QHvAt/NZHjl2HyDxc261 Zr0IYtuU1fpV5a1231wxUHiPgJPZUvcCTi2wo3BffQBOILouA9XxWLJRGv/J09+KAOAe dGFac3nCPzxN5PDgvtYDv5di0y+P/Rwe8gFztmk6peqf6ZaNoiuSvuDyaTzQiIaQJw+T 6PnA== Received: by 10.50.40.193 with SMTP id z1mr4268215igk.0.1338924438847; Tue, 05 Jun 2012 12:27:18 -0700 (PDT) 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.231.24.148 with SMTP id v20csp43098ibb; Tue, 5 Jun 2012 12:27:17 -0700 (PDT) Received: by 10.204.154.140 with SMTP id o12mr10263886bkw.139.1338924436936; Tue, 05 Jun 2012 12:27:16 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id gw9si2032321bkc.129.2012.06.05.12.27.14; Tue, 05 Jun 2012 12:27:15 -0700 (PDT) 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 1SbzPL-00011P-DR; Tue, 05 Jun 2012 19:27:11 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SbzPK-00010k-1h for linaro-mm-sig@lists.linaro.org; Tue, 05 Jun 2012 19:27:10 +0000 X-IronPort-AV: E=McAfee;i="5400,1158,6733"; a="195703835" Received: from pdmz-css-vrrp.qualcomm.com (HELO mostmsg01.qualcomm.com) ([199.106.114.130]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 05 Jun 2012 12:27:07 -0700 Received: from lauraa-linux.qualcomm.com (pdmz-snip-v218.qualcomm.com [192.168.218.1]) by mostmsg01.qualcomm.com (Postfix) with ESMTPA id 7B84010004C4; Tue, 5 Jun 2012 12:27:07 -0700 (PDT) From: Laura Abbott To: linaro-mm-sig@lists.linaro.org, Marek Szyprowski Date: Tue, 5 Jun 2012 12:27:01 -0700 Message-Id: <1338924421-7942-1-git-send-email-lauraa@codeaurora.org> X-Mailer: git-send-email 1.7.8.3 Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [Linaro-mm-sig] [PATCH][RFC] mm: Don't put CMA pages on per-cpu lists 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: ALoCoQlnspT+bOXQIuEsP04VgDuvERQgDoWhJbeUHSnvsOrfqftFwhyOVZbOj33wQwa2L/CCY19m Currently, when freeing 0 order pages, CMA pages are treated the same as regular movable pages, which means they end up on the per-cpu page list. This means that the CMA pages are likely to be allocated for something other than contigous memory. This increases the chance that the next alloc_contig_range will fail because pages can't be migrated. Given the size of the CMA region is typically limited, it is best to optimize for success of alloc_contig_range as much as possible. Do this by freeing CMA pages directly instead of putting them on the per-cpu page lists. Signed-off-by: Laura Abbott --- mm/page_alloc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0e1c6f5..c9a6483 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1310,7 +1310,8 @@ void free_hot_cold_page(struct page *page, int cold) * excessively into the page allocator */ if (migratetype >= MIGRATE_PCPTYPES) { - if (unlikely(migratetype == MIGRATE_ISOLATE)) { + if (unlikely(migratetype == MIGRATE_ISOLATE) + || is_migrate_cma(migratetype)) { free_one_page(zone, page, 0, migratetype); goto out; }