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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/