Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2226004ybi; Mon, 17 Jun 2019 00:47:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHm7q2DEmkuV/Alza+Asglt2CvDM5ydmBb8Whr92VMdMHS10cuJ4SV6AHdFnytnfHbGoP/ X-Received: by 2002:a63:3141:: with SMTP id x62mr48776876pgx.282.1560757661755; Mon, 17 Jun 2019 00:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757661; cv=none; d=google.com; s=arc-20160816; b=PH3hzIfaZUKmaTxZHVoZ0hpvJGB7KD9vB7PlW6vThkL88+7dNu1k/iLQwE0NGyRaky 8/eFZZA2juTkBs+iJs/SpCz8ljW/6Yn0OygWIdsz1c9eaMuSKTQzYnkn7p3vh8CesEuv elAelPVLagF6c+SA3tUvMu3yD4uleKA52G65Jb5obACYMNnDwkuoqP0X3HS9nxRAtiaX ew2dty3txsGdPOa7MwJ180h4pOrbBemLsxrB58gDTejbD0mGBDe5xGyLFkLucOhKrMv6 K3aq9dtq0NQrGTcPkxta3qJXfNO8/d6z//ckYTvAMc3o9ep7/+4K3+CYouZDQg0Vc2wp qZ0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jt10alrLmmlP3c2hb7Di1CuGuH+MqUyA8r5czp39g6E=; b=RZaEAIXoLzllave8i3i8+N1G5PM2fDjLagV6QwTGtb/nAdvIaxfuygRWapFOzNrz+t F/xoxIZ4PFFXZOM26GGpjFBHewvYG8riKsNafGf6oNPEu2a2R59jTblhIRNtP9YugnHr 29hg4pzi3DlsJ71oCThz5efcJaMbuKtr4Ntx4K26dP5z+ceNdsgpV6F+qX+leiRJrEK3 bh4h8aOdpZGxURBanWBotxXmlHLXbEqWtoJsbgiVI3vpI6pybjeXiZMeYGV/LmwAJeCz KETuDV5TqGRYIexRCLHaQfdk9rrMkPCUY/z1DJ6tZ29TNeESINQBOuoi7zzqDw8e2TBG fq+Q== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cp14si10165215plb.183.2019.06.17.00.47.26; Mon, 17 Jun 2019 00:47:41 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727400AbfFQHrS (ORCPT + 99 others); Mon, 17 Jun 2019 03:47:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:39204 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726028AbfFQHrS (ORCPT ); Mon, 17 Jun 2019 03:47:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EEB10AFC3; Mon, 17 Jun 2019 07:47:16 +0000 (UTC) Date: Mon, 17 Jun 2019 09:47:15 +0200 From: Michal Hocko To: Alastair D'Silva Cc: alastair@d-silva.org, Arun KS , Mukesh Ojha , Logan Gunthorpe , Wei Yang , Peter Zijlstra , Ingo Molnar , linux-mm@kvack.org, Qian Cai , Thomas Gleixner , Andrew Morton , Mike Rapoport , Baoquan He , David Hildenbrand , Josh Poimboeuf , Pavel Tatashin , Juergen Gross , Oscar Salvador , Jiri Kosina , linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] mm/hotplug: Avoid RCU stalls when removing large amounts of memory Message-ID: <20190617074715.GE30420@dhcp22.suse.cz> 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.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 17-06-19 14:36:30, 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)) > + cond_resched(); We already do have cond_resched before __remove_section. Why is an additional needed? > } > > set_zone_contiguous(zone); > -- > 2.21.0 > -- Michal Hocko SUSE Labs