From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751668AbcLEQQd (ORCPT ); Mon, 5 Dec 2016 11:16:33 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41228 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751176AbcLEQQa (ORCPT ); Mon, 5 Dec 2016 11:16:30 -0500 Date: Mon, 5 Dec 2016 08:16:29 -0800 From: "Paul E. McKenney" To: Michal Hocko Cc: Balbir Singh , Andrew Morton , Mel Gorman , Johannes Weiner , Vlastimil Babka , linux-mm , LKML , Boris Zhmurov , "Christopher S. Aker" , Donald Buczek , Paul Menzel Subject: Re: [PATCH] mm, vmscan: add cond_resched into shrink_node_memcg Reply-To: paulmck@linux.vnet.ibm.com References: <20161202095841.16648-1-mhocko@kernel.org> <20161205124955.GG30758@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161205124955.GG30758@dhcp22.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16120516-0016-0000-0000-000005562B32 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006198; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000194; SDB=6.00789634; UDB=6.00382309; IPR=6.00567373; BA=6.00004942; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013545; XFM=3.00000011; UTC=2016-12-05 16:16:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16120516-0017-0000-0000-000035370425 Message-Id: <20161205161629.GD3924@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-05_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1612050256 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 05, 2016 at 01:49:55PM +0100, Michal Hocko wrote: > [CC Paul - sorry I've tried to save you from more emails...] > > On Mon 05-12-16 23:44:27, Balbir Singh wrote: > > > > > > Hi, > > > there were multiple reportes of the similar RCU stalls. Only Boris has > > > confirmed that this patch helps in his workload. Others might see a > > > slightly different issue and that should be investigated if it is the > > > case. As pointed out by Paul [1] cond_resched might be not sufficient > > > to silence RCU stalls because that would require a real scheduling. > > > This is a separate problem, though, and Paul is working with Peter [2] > > > to resolve it. > > > > > > Anyway, I believe that this patch should be a good start because it > > > really seems that nr_taken=0 during the LRU isolation can be triggered > > > in the real life. All reporters are agreeing to start seeing this issue > > > when moving on to 4.8 kernel which might be just a coincidence or a > > > different behavior of some subsystem. Well, MM has moved from zone to > > > node reclaim but I couldn't have found any direct relation to that > > > change. > > > > > > [1] http://lkml.kernel.org/r/20161130142955.GS3924@linux.vnet.ibm.com > > > [2] http://lkml.kernel.org/r/20161201124024.GB3924@linux.vnet.ibm.com > > > > > > mm/vmscan.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > > index c05f00042430..c4abf08861d2 100644 > > > --- a/mm/vmscan.c > > > +++ b/mm/vmscan.c > > > @@ -2362,6 +2362,8 @@ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memc > > > } > > > } > > > > > > + cond_resched(); > > > + > > > > I see a cond_resched_rcu_qs() as a part of linux next inside the while > > (nr[..]) loop. > > This is a left over from Paul's initial attempt to fix this issue. I > expect him to drop his patch from his tree. He has considered it > experimental anyway. To prevent further confusion, I am dropping these patches from my tree: 80c099e11c19 ("mm: Prevent shrink_node() RCU CPU stall warnings") 34c53f5cd399 ("mm: Prevent shrink_node_memcg() RCU CPU stall warnings") If you need them, please feel free to pull them in. Given that I don't have those, I am dropping this one as well: f2a471ffc8a8 ("rcu: Allow boot-time use of cond_resched_rcu_qs()") If you need it, please let me know. > > Do we need this as well? > > Paul is working with Peter to make cond_resched general and cover RCU > stalls even when cond_resched doesn't schedule because there is no > runnable task. And 0day just told me that my current attempt gets a 227% increase in context switches on the unlink tests in LTP, so back to the drawing board... Thanx, Paul From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f198.google.com (mail-wj0-f198.google.com [209.85.210.198]) by kanga.kvack.org (Postfix) with ESMTP id 50DD26B0038 for ; Mon, 5 Dec 2016 11:16:33 -0500 (EST) Received: by mail-wj0-f198.google.com with SMTP id xr1so64773300wjb.7 for ; Mon, 05 Dec 2016 08:16:33 -0800 (PST) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id m76si659861wmi.48.2016.12.05.08.16.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2016 08:16:31 -0800 (PST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uB5G8anB101966 for ; Mon, 5 Dec 2016 11:16:29 -0500 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0b-001b2d01.pphosted.com with ESMTP id 2759gxr7ra-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 05 Dec 2016 11:16:29 -0500 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 5 Dec 2016 09:16:28 -0700 Date: Mon, 5 Dec 2016 08:16:29 -0800 From: "Paul E. McKenney" Subject: Re: [PATCH] mm, vmscan: add cond_resched into shrink_node_memcg Reply-To: paulmck@linux.vnet.ibm.com References: <20161202095841.16648-1-mhocko@kernel.org> <20161205124955.GG30758@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161205124955.GG30758@dhcp22.suse.cz> Message-Id: <20161205161629.GD3924@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Balbir Singh , Andrew Morton , Mel Gorman , Johannes Weiner , Vlastimil Babka , linux-mm , LKML , Boris Zhmurov , "Christopher S. Aker" , Donald Buczek , Paul Menzel On Mon, Dec 05, 2016 at 01:49:55PM +0100, Michal Hocko wrote: > [CC Paul - sorry I've tried to save you from more emails...] > > On Mon 05-12-16 23:44:27, Balbir Singh wrote: > > > > > > Hi, > > > there were multiple reportes of the similar RCU stalls. Only Boris has > > > confirmed that this patch helps in his workload. Others might see a > > > slightly different issue and that should be investigated if it is the > > > case. As pointed out by Paul [1] cond_resched might be not sufficient > > > to silence RCU stalls because that would require a real scheduling. > > > This is a separate problem, though, and Paul is working with Peter [2] > > > to resolve it. > > > > > > Anyway, I believe that this patch should be a good start because it > > > really seems that nr_taken=0 during the LRU isolation can be triggered > > > in the real life. All reporters are agreeing to start seeing this issue > > > when moving on to 4.8 kernel which might be just a coincidence or a > > > different behavior of some subsystem. Well, MM has moved from zone to > > > node reclaim but I couldn't have found any direct relation to that > > > change. > > > > > > [1] http://lkml.kernel.org/r/20161130142955.GS3924@linux.vnet.ibm.com > > > [2] http://lkml.kernel.org/r/20161201124024.GB3924@linux.vnet.ibm.com > > > > > > mm/vmscan.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > > index c05f00042430..c4abf08861d2 100644 > > > --- a/mm/vmscan.c > > > +++ b/mm/vmscan.c > > > @@ -2362,6 +2362,8 @@ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memc > > > } > > > } > > > > > > + cond_resched(); > > > + > > > > I see a cond_resched_rcu_qs() as a part of linux next inside the while > > (nr[..]) loop. > > This is a left over from Paul's initial attempt to fix this issue. I > expect him to drop his patch from his tree. He has considered it > experimental anyway. To prevent further confusion, I am dropping these patches from my tree: 80c099e11c19 ("mm: Prevent shrink_node() RCU CPU stall warnings") 34c53f5cd399 ("mm: Prevent shrink_node_memcg() RCU CPU stall warnings") If you need them, please feel free to pull them in. Given that I don't have those, I am dropping this one as well: f2a471ffc8a8 ("rcu: Allow boot-time use of cond_resched_rcu_qs()") If you need it, please let me know. > > Do we need this as well? > > Paul is working with Peter to make cond_resched general and cover RCU > stalls even when cond_resched doesn't schedule because there is no > runnable task. And 0day just told me that my current attempt gets a 227% increase in context switches on the unlink tests in LTP, so back to the drawing board... Thanx, Paul -- 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