From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by kanga.kvack.org (Postfix) with ESMTP id C2F646B006E for ; Fri, 26 Dec 2014 09:40:27 -0500 (EST) Received: by mail-pa0-f54.google.com with SMTP id fb1so13282636pad.41 for ; Fri, 26 Dec 2014 06:40:27 -0800 (PST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com. [210.118.77.11]) by mx.google.com with ESMTPS id yg8si42082469pab.86.2014.12.26.06.40.25 for (version=TLSv1 cipher=RC4-MD5 bits=128/128); Fri, 26 Dec 2014 06:40:26 -0800 (PST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NH70064F2A5N210@mailout1.w1.samsung.com> for linux-mm@kvack.org; Fri, 26 Dec 2014 14:44:29 +0000 (GMT) From: "Stefan I. Strogin" Subject: [PATCH 0/3] mm: cma: /proc/cmainfo Date: Fri, 26 Dec 2014 17:39:01 +0300 Message-id: Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: "Stefan I. Strogin" , Joonsoo Kim , Andrew Morton , Marek Szyprowski , Michal Nazarewicz , aneesh.kumar@linux.vnet.ibm.com, Laurent Pinchart , Dmitry Safonov , Pintu Kumar , Weijie Yang , Laura Abbott , SeongJae Park , Hui Zhu , Minchan Kim , Dyasly Sergey , Vyacheslav Tyrtov Hello all, Here is a patch set that adds /proc/cmainfo. When compiled with CONFIG_CMA_DEBUG /proc/cmainfo will contain information about about total, used, maximum free contiguous chunk and all currently allocated contiguous buffers in CMA regions. The information about allocated CMA buffers includes pid, comm, allocation latency and stacktrace at the moment of allocation. Example: # cat /proc/cmainfo CMARegion stat: 65536 kB total, 248 kB used, 65216 kB max contiguous chunk 0x32400000 - 0x32401000 (4 kB), allocated by pid 63 (systemd-udevd), latency 74 us [] dma_generic_alloc_coherent+0x86/0x160 [] rpm_idle+0x1f/0x1f0 [] dma_generic_alloc_coherent+0x0/0x160 [] ohci_init+0x1fe/0x430 [ohci_hcd] [] dma_generic_alloc_coherent+0x0/0x160 [] ohci_pci_reset+0x4f/0x60 [ohci_pci] [] usb_add_hcd+0x1fc/0x900 [usbcore] [] pcibios_set_master+0x38/0x90 [] usb_hcd_pci_probe+0x176/0x4f0 [usbcore] [] pci_device_probe+0x6f/0xd0 [] sysfs_create_link+0x25/0x50 [] driver_probe_device+0x92/0x3b0 [] __mutex_lock_slowpath+0x5b/0x90 [] __driver_attach+0x0/0x80 [] __driver_attach+0x79/0x80 [] __driver_attach+0x0/0x80 0x32401000 - 0x32402000 (4 kB), allocated by pid 58 (systemd-udevd), latency 17 us [] dmam_coherent_release+0x0/0x90 [] __kmalloc_track_caller+0x31c/0x380 [] dma_generic_alloc_coherent+0x86/0x160 [] dma_generic_alloc_coherent+0x0/0x160 [] dmam_alloc_coherent+0xb6/0x100 [] ata_bmdma_port_start+0x43/0x60 [libata] [] ata_host_start.part.29+0xb8/0x190 [libata] [] pci_read+0x30/0x40 [] ata_pci_sff_activate_host+0x29/0x220 [libata] [] ata_bmdma_interrupt+0x0/0x1f0 [libata] [] pcibios_set_master+0x38/0x90 [] piix_init_one+0x44e/0x630 [ata_piix] [] mutex_lock+0x10/0x20 [] kernfs_activate+0x63/0xd0 [] kernfs_add_one+0xc3/0x130 [] pci_device_probe+0x6f/0xd0 <...> Dmitry Safonov (1): cma: add functions to get region pages counters Stefan I. Strogin (2): stacktrace: add seq_print_stack_trace() mm: cma: introduce /proc/cmainfo include/linux/cma.h | 2 + include/linux/stacktrace.h | 4 + kernel/stacktrace.c | 17 ++++ mm/cma.c | 236 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 259 insertions(+) -- 2.1.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751243AbaLZOk0 (ORCPT ); Fri, 26 Dec 2014 09:40:26 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:60960 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbaLZOkX (ORCPT ); Fri, 26 Dec 2014 09:40:23 -0500 X-AuditID: cbfec7f4-b7f126d000001e9a-c5-549d7354d17f From: "Stefan I. Strogin" To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: "Stefan I. Strogin" , Joonsoo Kim , Andrew Morton , Marek Szyprowski , Michal Nazarewicz , aneesh.kumar@linux.vnet.ibm.com, Laurent Pinchart , Dmitry Safonov , Pintu Kumar , Weijie Yang , Laura Abbott , SeongJae Park , Hui Zhu , Minchan Kim , Dyasly Sergey , Vyacheslav Tyrtov Subject: [PATCH 0/3] mm: cma: /proc/cmainfo Date: Fri, 26 Dec 2014 17:39:01 +0300 Message-id: X-Mailer: git-send-email 2.1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNLMWRmVeSWpSXmKPExsVy+t/xK7ohxXNDDBqOqljMWb+GzeLx63ks Fp9WPmWzWNndzGaxvXMGu0XnxCXsFpd3zWGzuLfmP6vF2iN32S0WHG9htVj29T27Rd/3w+wW k2dLWXw7OYfZ4tqOfiaLqTN+sFuc3HCW1WJDM5eDkMflvl4mj52z7rJ7zO6YyeqxaVUnm8em T5PYPbreXmHyODHjN4vHg0ObWTzW/XnF5HHw3R4mj74tqxg9Pm+S8+ja+Is1gDeKyyYlNSez LLVI3y6BK6P71yymgr0iFZMfVDYw7hLsYuTkkBAwkVj9ZTIThC0mceHeerYuRi4OIYGljBJv DtxlgnB6mST+nTvGDFLFJmApcWxeE1iHCFD37ua5jCBFzAKzWSUu/tnABpIQFtCWaGrdAlbE IqAqcW73VnYQm1fAQWLznq8sEOvkJDbs/s84gZF7ASPDKkbR1NLkguKk9FxDveLE3OLSvHS9 5PzcTYyQAP+yg3HxMatDjAIcjEo8vAnr5oQIsSaWFVfmHmKU4GBWEuGtMpsbIsSbklhZlVqU H19UmpNafIiRiYNTqoHRlzv/2sSJDzNWcVrM4DdyDYg+u3gKo/dW9Th/z2khPMXSQvPzL+1i UerhqGVgFLcO1/n+q8Kcv+HCmR2z1I0/KbwMr6i/pVA/07CMI126YIt/rmVJmkzDiqAzKfmt RbnfDgp3zouacP7FZEGzz8m7Mv6LntnOuHHJ/q3XnjXuObvL1diKP06JpTgj0VCLuag4EQBf NhjPTgIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello all, Here is a patch set that adds /proc/cmainfo. When compiled with CONFIG_CMA_DEBUG /proc/cmainfo will contain information about about total, used, maximum free contiguous chunk and all currently allocated contiguous buffers in CMA regions. The information about allocated CMA buffers includes pid, comm, allocation latency and stacktrace at the moment of allocation. Example: # cat /proc/cmainfo CMARegion stat: 65536 kB total, 248 kB used, 65216 kB max contiguous chunk 0x32400000 - 0x32401000 (4 kB), allocated by pid 63 (systemd-udevd), latency 74 us [] dma_generic_alloc_coherent+0x86/0x160 [] rpm_idle+0x1f/0x1f0 [] dma_generic_alloc_coherent+0x0/0x160 [] ohci_init+0x1fe/0x430 [ohci_hcd] [] dma_generic_alloc_coherent+0x0/0x160 [] ohci_pci_reset+0x4f/0x60 [ohci_pci] [] usb_add_hcd+0x1fc/0x900 [usbcore] [] pcibios_set_master+0x38/0x90 [] usb_hcd_pci_probe+0x176/0x4f0 [usbcore] [] pci_device_probe+0x6f/0xd0 [] sysfs_create_link+0x25/0x50 [] driver_probe_device+0x92/0x3b0 [] __mutex_lock_slowpath+0x5b/0x90 [] __driver_attach+0x0/0x80 [] __driver_attach+0x79/0x80 [] __driver_attach+0x0/0x80 0x32401000 - 0x32402000 (4 kB), allocated by pid 58 (systemd-udevd), latency 17 us [] dmam_coherent_release+0x0/0x90 [] __kmalloc_track_caller+0x31c/0x380 [] dma_generic_alloc_coherent+0x86/0x160 [] dma_generic_alloc_coherent+0x0/0x160 [] dmam_alloc_coherent+0xb6/0x100 [] ata_bmdma_port_start+0x43/0x60 [libata] [] ata_host_start.part.29+0xb8/0x190 [libata] [] pci_read+0x30/0x40 [] ata_pci_sff_activate_host+0x29/0x220 [libata] [] ata_bmdma_interrupt+0x0/0x1f0 [libata] [] pcibios_set_master+0x38/0x90 [] piix_init_one+0x44e/0x630 [ata_piix] [] mutex_lock+0x10/0x20 [] kernfs_activate+0x63/0xd0 [] kernfs_add_one+0xc3/0x130 [] pci_device_probe+0x6f/0xd0 <...> Dmitry Safonov (1): cma: add functions to get region pages counters Stefan I. Strogin (2): stacktrace: add seq_print_stack_trace() mm: cma: introduce /proc/cmainfo include/linux/cma.h | 2 + include/linux/stacktrace.h | 4 + kernel/stacktrace.c | 17 ++++ mm/cma.c | 236 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 259 insertions(+) -- 2.1.0