Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756329AbbHGHVl (ORCPT ); Fri, 7 Aug 2015 03:21:41 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:36263 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752297AbbHGHVc (ORCPT ); Fri, 7 Aug 2015 03:21:32 -0400 X-AuditID: cbfee690-f796f6d000005054-e7-55c45c791a42 From: Pintu Kumar To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, minchan@kernel.org, dave@stgolabs.net, mhocko@suse.cz, koct9i@gmail.com, mgorman@suse.de, vbabka@suse.cz, js1304@gmail.com, hannes@cmpxchg.org, alexander.h.duyck@redhat.com, sasha.levin@oracle.com, cl@linux.com, fengguang.wu@intel.com, pintu.k@samsung.com Cc: cpgs@samsung.com, pintu_agarwal@yahoo.com, pintu.k@outlook.com, vishnu.ps@samsung.com, rohit.kr@samsung.com Subject: [PATCH 1/1] mm: vmstat: introducing vm counter for slowpath Date: Fri, 07 Aug 2015 12:38:54 +0530 Message-id: <1438931334-25894-1-git-send-email-pintu.k@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNIsWRmVeSWpSXmKPExsWyRsSkVrcy5kiowcMJChZz1q9hs/jzbzqL xfVvbxgtXh7StFh9cw2jxfvn65ktVm/ytZi5dy6rxcrOB6wWl3fNYbO4t+Y/q8Xkd88YLV41 f2e1WPb1PbvF+Y7LrBZ93w+zW3x7e5vd4nlzK4vF4iO3mS1mN/YxWkzpu8voIOpx+M17Zo+d s+6yeyze85LJY9OqTjaPTZ8msXucmPGbxePJlelMHh+f3mLx2Pz6BbPH+31X2Tz6tqxi9Jg6 u97jzIIj7B6bT1d7fN4k5zFr1mGmAIEoLpuU1JzMstQifbsEroyTje3sBfNEKnY097I2MN4R 6GLk5JAQMJGY2/uHEcIWk7hwbz1bFyMXh5DACka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QUrYhNQl/jx5jcjSEJE4AaTxPzP08ESzAKFEqcOzQezhQVcJLZtvMoIYrMI qEocebCCFcTmFXCWuHTyK5DNAbRNQWLOJJsJjNwLGBlWMUqkFiQXFCel5xrmpZbrFSfmFpfm pesl5+duYgQng2dSOxgP7nI/xCjAwajEw5v473CoEGtiWXFl7iFGCQ5mJRHeh/pAId6UxMqq 1KL8+KLSnNTiQ4ymQPsnMkuJJucDE1VeSbyhsYm5qbGppYmFiZmlkjiv7IbNoUIC6Yklqdmp qQWpRTB9TBycUg2MBpknJq29d/ek/BWJB0ke7c1MBz+Y34sqC9f5Zsk0tUkkR7F/StdtU7U7 9loFsbdKquaFWG38zG8elCoxdUWyhcWrOYen6M0+kbXv9SKRbelZEfv222zPeKskIchvFaNr 8LvXs1xsY/uLuBfqWkK27gyXp0jwbb0h8eREG0fiKRumuOxjL82UWIozEg21mIuKEwFMd9il HAMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2760 Lines: 82 This patch add new counter slowpath_entered in /proc/vmstat to track how many times the system entered into slowpath after first allocation attempt is failed. This is useful to know the rate of allocation success within the slowpath. This patch is tested on ARM with 512MB RAM. A sample output is shown below after successful boot-up: shell> cat /proc/vmstat nr_free_pages 4712 pgalloc_normal 1319432 pgalloc_movable 0 pageoutrun 379 allocstall 0 slowpath_entered 585 compact_stall 0 compact_fail 0 compact_success 0 >From the above output we can see that the system entered slowpath 585 times. But the existing counter kswapd(pageoutrun), direct_reclaim(allocstall), direct_compact(compact_stall) does not tell this value. >From the above value, it clearly indicates that the system have entered slowpath 585 times. Out of which 379 times allocation passed through kswapd, without performing direct reclaim/compaction. That means the remaining 206 times the allocation would have succeeded using the alloc_pages_high_priority. Signed-off-by: Pintu Kumar --- include/linux/vm_event_item.h | 2 +- mm/page_alloc.c | 2 ++ mm/vmstat.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 2b1cef8..9825f294 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -37,7 +37,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, #endif PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, - PAGEOUTRUN, ALLOCSTALL, PGROTATED, + PAGEOUTRUN, ALLOCSTALL, SLOWPATH_ENTERED, PGROTATED, DROP_PAGECACHE, DROP_SLAB, #ifdef CONFIG_NUMA_BALANCING NUMA_PTE_UPDATES, diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2024d2e..4a5d487 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3029,6 +3029,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, if (IS_ENABLED(CONFIG_NUMA) && (gfp_mask & __GFP_THISNODE) && !wait) goto nopage; + count_vm_event(SLOWPATH_ENTERED); + retry: if (!(gfp_mask & __GFP_NO_KSWAPD)) wake_all_kswapds(order, ac); diff --git a/mm/vmstat.c b/mm/vmstat.c index 1fd0886..1c54fdf 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -778,7 +778,7 @@ const char * const vmstat_text[] = { "kswapd_high_wmark_hit_quickly", "pageoutrun", "allocstall", - + "slowpath_entered", "pgrotated", "drop_pagecache", -- 1.7.9.5 -- 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/