From patchwork Thu Jan 17 20:26:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 14104 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 C1D7323F02 for ; Thu, 17 Jan 2013 20:29:25 +0000 (UTC) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by fiordland.canonical.com (Postfix) with ESMTP id 31AE2A19D8A for ; Thu, 17 Jan 2013 20:29:25 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id l22so3016795vbn.0 for ; Thu, 17 Jan 2013 12:29:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:date:user-agent:references:in-reply-to :mime-version:message-id:x-provags-id:cc:subject:x-beenthere :x-mailman-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=5uUXDYD9Q5w6rjJp5mEvJ0DmxfKzZL+aqFDRrBKXpNw=; b=aW8y6irWB91zey0RsV8ouG8n4wBpw8soe+I+5ZG1qZb+CRPE0TIxUjCjL1mkp53ALM Gb3G4jvKrb51ThwWEWiCB2jhJ8H3z0ILogPmZ2WNXKlQPvOisq01cW8aVZFaUpZ/1HdY 3hLo1hhtvsoWxHS3fiMHFXpkFZfQ2cQOjkUiUaj4qkgS1MJQwkjPUehMOq3JbixnWRVR u0TJYCqwlSXY7lQGQR/Hd1ngmQD3QwdF7fwngbIRIq2ZXd3Q4IpO2Ja7gFJTmVLh3LYJ ZHYwpPhL6GcH3Uk6g4hYqRd5Ud7+gvKyQp1FP5uCmR67NJ9OzzcI0XKgyluSsRYDa9pt M3tQ== X-Received: by 10.220.238.139 with SMTP id ks11mr6804738vcb.49.1358454564545; Thu, 17 Jan 2013 12:29:24 -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.58.145.101 with SMTP id st5csp50223veb; Thu, 17 Jan 2013 12:29:23 -0800 (PST) X-Received: by 10.204.147.196 with SMTP id m4mr1851176bkv.121.1358454562154; Thu, 17 Jan 2013 12:29:22 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id hy12si2020622bkc.254.2013.01.17.12.29.20; Thu, 17 Jan 2013 12:29:22 -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 1Tvw5J-0000B9-1i; Thu, 17 Jan 2013 20:29:13 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Tvw5H-0000B4-LM for linaro-mm-sig@lists.linaro.org; Thu, 17 Jan 2013 20:29:11 +0000 Received: from klappe2.localnet (HSI-KBW-46-223-90-92.hsi.kabel-badenwuerttemberg.de [46.223.90.92]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MfZIB-1TYSyv17oh-00P5m2; Thu, 17 Jan 2013 21:26:50 +0100 From: Arnd Bergmann To: Soeren Moch Date: Thu, 17 Jan 2013 20:26:45 +0000 User-Agent: KMail/1.12.2 (Linux/3.7.0-7-generic; KDE/4.3.2; x86_64; ; ) References: <20121119144826.f59667b2.akpm@linux-foundation.org> <201301171049.30415.arnd@arndb.de> <50F800EB.6040104@web.de> In-Reply-To: <50F800EB.6040104@web.de> MIME-Version: 1.0 Message-Id: <201301172026.45514.arnd@arndb.de> X-Provags-ID: V02:K0:QibfHb/ih/cXuBq+/jOT21lQ/3GTRUrdXQI9q5vkgpX LLBWPXMiXYnO7EEuAAC1fRQtAOLBt3TRwlJ49D1C+EOgeQd9v7 RjxAqul/vHtvpT7PUaKXtkZ/SREXRjAvZQKa7IFfJHJoMARIAc rJ96BthU095HCUajZCEWiuyqrkZIwj2aUFXyxMYzvK3qIDbrZl vIhPnHX6rbhCo0rLCXzvnLYrWux56U1bp3r1ep2i4Svy67seX7 XDMv64xIsfnDw1F1sEoR82WaFdllyj7dR97f/u29mfL65malno TWbxnoFabmtxl4MVVRe+4uw29etyBVEh/vuW+5lunqVaZt5x61 n4FNW+52oD7D+BiAI7Eo= Cc: Thomas Petazzoni , Andrew Lunn , Jason Cooper , linux-arm-kernel@lists.infradead.org, Greg KH , linux-kernel@vger.kernel.org, Michal Hocko , linux-mm@kvack.org, Kyungmin Park , Mel Gorman , Andrew Morton , Sebastian Hesselbarth , linaro-mm-sig@lists.linaro.org, KAMEZAWA Hiroyuki Subject: Re: [Linaro-mm-sig] [PATCH v2] mm: dmapool: use provided gfp flags for all dma_alloc_coherent() calls 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: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQn/bP8G/bZ9WV6TfVVfNysvxNjKmxn140XQx/sOZMN2/klbbrNXsCPMe0+rehM6QZ/UrmZ4 On Thursday 17 January 2013, Soeren Moch wrote: > On 17.01.2013 11:49, Arnd Bergmann wrote: > > On Wednesday 16 January 2013, Soeren Moch wrote: > >>>> I will see what I can do here. Is there an easy way to track the buffer > >>>> usage without having to wait for complete exhaustion? > >>> > >>> DMA_API_DEBUG > >> > >> OK, maybe I can try this. > >>> > > > > Any success with this? It should at least tell you if there is a > > memory leak in one of the drivers. > > Not yet, sorry. I have to do all the tests in my limited spare time. > Can you tell me what to search for in the debug output? Actually now that I've looked closer, you can't immediately see all the mappings as I thought. But please try enabling DMA_API_DEBUG in combination with this one-line patch: That will show every single allocation that is currently active. This lets you see where all the memory went, and if there is a possible leak or excessive fragmentation. Arnd diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 6b2fb87..3df74ac 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -497,6 +497,7 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page) pr_err_once("ERROR: %u KiB atomic DMA coherent pool is too small!\n" "Please increase it with coherent_pool= kernel parameter!\n", (unsigned)pool->size / 1024); + debug_dma_dump_mappings(NULL); } spin_unlock_irqrestore(&pool->lock, flags);