From patchwork Wed Nov 27 01:50:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?546L6LSH?= X-Patchwork-Id: 11263211 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5ECE14ED for ; Wed, 27 Nov 2019 01:51:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD0072068E for ; Wed, 27 Nov 2019 01:51:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbfK0Bvf (ORCPT ); Tue, 26 Nov 2019 20:51:35 -0500 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:49171 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbfK0Bve (ORCPT ); Tue, 26 Nov 2019 20:51:34 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0TjBZuPt_1574819487; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0TjBZuPt_1574819487) by smtp.aliyun-inc.com(127.0.0.1); Wed, 27 Nov 2019 09:51:29 +0800 Subject: [PATCH v2 2/3] sched/numa: expose per-task pages-migration-failure From: =?utf-8?b?546L6LSH?= To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Luis Chamberlain , Kees Cook , Iurii Zaikin , =?utf-8?q?Michal_Koutn=C3=BD?= , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, "Paul E. McKenney" References: <743eecad-9556-a241-546b-c8a66339840e@linux.alibaba.com> <207ef46c-672c-27c8-2012-735bd692a6de@linux.alibaba.com> Message-ID: <3931bf05-2939-0499-7660-8cc9a6f71c9a@linux.alibaba.com> Date: Wed, 27 Nov 2019 09:50:01 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <207ef46c-672c-27c8-2012-735bd692a6de@linux.alibaba.com> Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org NUMA balancing will try to migrate pages between nodes, which could caused by memory policy or numa group aggregation, while the page migration could failed too for eg when the target node run out of memory. Since this is critical to the performance, admin should know how serious the problem is, and take actions before it causing too much performance damage, thus this patch expose the counter as 'migfailed' in '/proc/PID/sched'. Cc: Peter Zijlstra Cc: Michal Koutný Suggested-by: Mel Gorman Signed-off-by: Michael Wang Acked-by: Mel Gorman --- kernel/sched/debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index f7e4579e746c..73c4809c8f37 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -848,6 +848,7 @@ static void sched_show_numa(struct task_struct *p, struct seq_file *m) P(total_numa_faults); SEQ_printf(m, "current_node=%d, numa_group_id=%d\n", task_node(p), task_numa_group_id(p)); + SEQ_printf(m, "migfailed=%lu\n", p->numa_faults_locality[2]); show_numa_stats(p, m); mpol_put(pol); #endif