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: 1997911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id D06353FC85 for ; Thu, 17 Jan 2013 20:32:28 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tvw4a-0008Oh-Qu; Thu, 17 Jan 2013 20:28:28 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tvw4X-0008OP-H6 for linux-arm-kernel@lists.infradead.org; Thu, 17 Jan 2013 20:28:26 +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 Subject: Re: [PATCH v2] mm: dmapool: use provided gfp flags for all dma_alloc_coherent() calls 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130117_152825_827879_4A3F66BB X-CRM114-Status: GOOD ( 17.86 ) X-Spam-Score: 1.1 (+) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.187 listed in list.dnswl.org] 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 , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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);