Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2185067ybi; Sun, 16 Jun 2019 23:54:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqydIdnSk11uKipjr9KHf0BvG3iMBoMdY2iQSGWlM676dRYnTgEvhx3vNLJzdMfglgJ+SAoS X-Received: by 2002:a65:4544:: with SMTP id x4mr48774275pgr.323.1560754499341; Sun, 16 Jun 2019 23:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560754499; cv=none; d=google.com; s=arc-20160816; b=ecA8zZRFGynp1iqlT0LhsDY9HFouIcAgV4C8PI1LmjF91Y5qQQEitRpFeP63g5BbYR qaUGmntQKFA021rCSM/AuKKE24R7OXOK/Y4ZN8goV+O7WgTzyD3m3AmIlNoO6N56Ss0R Bw88gAGO+hqDFkyutJ3mh7W2el1CNQUXI4GHEqytUW52vMHFdmb8vKd3SHcCzXMj6N8V r0AbsQ4b/NaKK+kL9U0nv8XXHghmOgc4eqVUIPJfIi0cKDQ0LayQGojQhGYC0XU/8BZ8 +5PwG+SlJ694q7pEBlC1gYqkR+lz39YHJ/XDdAh9OjKW+glgfx7eDuFEdUJzORYxFc27 2pfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=YvmswtQ24ZW+HPbnzj6bpTo8+v2gOCrHe4cI3T/Ysfg=; b=CB2rekWbDzGWHU4a72bW+SqPdm0mlKWczt+odsMpodQH0sbvYcn6R7dAueBmGqLW0L PV4tz1CHJ31Ovq37NboTAEbsajaqEl7oGskIAtP96CfBWO55k1s6yE9Pr8wv3ieB+CMe wBZLY/PZZEm+0aoDTgBtnby+/JGpG7IN+VKxVp/an10b7hQrqir7svHKdGm2Lq596Y1s bep0Qd4QsLMmFJT5IdEaRJcsEAGHfA4+sFH25l06SApfWtYlyuSpobxcIcCgcfBg4IvI rqCGOwBOFDfOqxEmXE86S0rqGiOaokp5PKaNFZNUHcRgyUuOnbriM1XeeRck/ySkJv0i A6bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si9879444pgl.467.2019.06.16.23.54.43; Sun, 16 Jun 2019 23:54:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726128AbfFQGyM (ORCPT + 99 others); Mon, 17 Jun 2019 02:54:12 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42708 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725778AbfFQGyM (ORCPT ); Mon, 17 Jun 2019 02:54:12 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5H6qoDk140366 for ; Mon, 17 Jun 2019 02:54:10 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2t632awnyf-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 17 Jun 2019 02:54:10 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Jun 2019 07:54:08 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 17 Jun 2019 07:54:02 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5H6s1U951839090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jun 2019 06:54:01 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3762AAE05D; Mon, 17 Jun 2019 06:54:01 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9FEDBAE051; Mon, 17 Jun 2019 06:53:59 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.8.53]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 17 Jun 2019 06:53:59 +0000 (GMT) Date: Mon, 17 Jun 2019 09:53:57 +0300 From: Mike Rapoport To: "Alastair D'Silva" Cc: alastair@d-silva.org, Andrew Morton , David Hildenbrand , Oscar Salvador , Michal Hocko , Pavel Tatashin , Wei Yang , Juergen Gross , Qian Cai , Thomas Gleixner , Ingo Molnar , Josh Poimboeuf , Jiri Kosina , Peter Zijlstra , Mukesh Ojha , Arun KS , Mike Rapoport , Baoquan He , Logan Gunthorpe , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] mm/hotplug: Avoid RCU stalls when removing large amounts of memory References: <20190617043635.13201-1-alastair@au1.ibm.com> <20190617043635.13201-5-alastair@au1.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190617043635.13201-5-alastair@au1.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 19061706-0012-0000-0000-00000329BB60 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061706-0013-0000-0000-00002162D170 Message-Id: <20190617065357.GD16810@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-17_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906170064 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 17, 2019 at 02:36:30PM +1000, Alastair D'Silva wrote: > From: Alastair D'Silva > > When removing sufficiently large amounts of memory, we trigger RCU stall > detection. By periodically calling cond_resched(), we avoid bogus stall > warnings. > > Signed-off-by: Alastair D'Silva > --- > mm/memory_hotplug.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index e096c987d261..382b3a0c9333 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -578,6 +578,9 @@ void __remove_pages(struct zone *zone, unsigned long phys_start_pfn, > __remove_section(zone, __pfn_to_section(pfn), map_offset, > altmap); > map_offset = 0; > + > + if (!(i & 0x0FFF)) No magic numbers please. And a comment would be appreciated. > + cond_resched(); > } > > set_zone_contiguous(zone); > -- > 2.21.0 > -- Sincerely yours, Mike.