Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753631AbbKXMgw (ORCPT ); Tue, 24 Nov 2015 07:36:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:51640 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753474AbbKXMgo (ORCPT ); Tue, 24 Nov 2015 07:36:44 -0500 From: Vlastimil Babka To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Andrew Morton , Joonsoo Kim , Minchan Kim , Sasha Levin , "Kirill A. Shutemov" , Mel Gorman , Michal Hocko , Vlastimil Babka Subject: [PATCH v2 0/9] page_owner improvements for debugging Date: Tue, 24 Nov 2015 13:36:12 +0100 Message-Id: <1448368581-6923-1-git-send-email-vbabka@suse.cz> X-Mailer: git-send-email 2.6.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3374 Lines: 68 This is the second version of patchset which originally aimed to improve the page_owner functionality. Thanks to feedback from v1 and some bugs I discovered along the way, it is now larger in scope and number of patches. It's based on next-20151124. For page_owner, the main changes are o Use static key to further reduce overhead when compiled in but not enabled. o Improve output wrt. page and pageblock migratetypes o Transfer the info on page migrations and track last migration reason. o Dump the info as part of dump_page() to hopefully help debugging. For the last point, Kirill requested a human readable printing of gfp_mask and migratetype after v1. At that point it probably makes a lot of sense to do the same for page alloc failure and OOM warnings. The flags have been undergoing revisions recently, and we might be getting reports from various kernel versions that differ. The ./scripts/gfp-translate tool needs to be pointed at the corresponding sources to be accurate. The downside is potentially breaking scripts that grep these warnings, but it's not a first change done there over the years. Note I'm not entirely happy about the dump_gfpflag_names() implementation, due to usage of pr_cont() unreliable on SMP (and I've seen spurious newlines in dmesg output, while being correct on serial console or /var/log/messages). It also doesn't allow plugging the gfp_mask translation into /sys/kernel/debug/page_owner where it also could make sense. Maybe a new *printf formatting flag? Too specialized maybe? Or just prepare the string in a buffer on stack with strscpy? Other changes since v1: o Change placement of page owner migration calls to cover missing cases (Hugh) o Move dump_page_owner() call up from dump_page_badflags(), so the latter can be used for adding debugging prints without page owner info (Kirill) Vlastimil Babka (9): mm, debug: fix wrongly filtered flags in dump_vma() mm, page_owner: print symbolic migratetype of both page and pageblock mm, page_owner: convert page_owner_inited to static key mm, page_owner: copy page owner info during migration mm, page_owner: track and print last migrate reason mm, debug: introduce dump_gfpflag_names() for symbolic printing of gfp_flags mm, page_owner: dump page owner info from dump_page() mm, page_alloc: print symbolic gfp_flags on allocation failure mm, oom: print symbolic gfp_flags in oom warning Documentation/vm/page_owner.txt | 9 +++-- include/linux/migrate.h | 6 ++- include/linux/mmdebug.h | 1 + include/linux/mmzone.h | 3 ++ include/linux/page_ext.h | 1 + include/linux/page_owner.h | 50 ++++++++++++++++++------- include/trace/events/gfpflags.h | 14 +++++-- mm/debug.c | 44 ++++++++++++++++------ mm/migrate.c | 23 ++++++++++-- mm/oom_kill.c | 10 +++-- mm/page_alloc.c | 18 ++++++++- mm/page_owner.c | 82 +++++++++++++++++++++++++++++++++++++---- mm/vmstat.c | 15 +------- 13 files changed, 213 insertions(+), 63 deletions(-) -- 2.6.3 -- 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/