From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED0E8C31E54 for ; Mon, 17 Jun 2019 08:22:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4E2121C38 for ; Mon, 17 Jun 2019 08:22:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560759722; bh=6KHkhl2yUddnhuVguNE898kFnkPgg4HNqSCEyc4821U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=0OcS3v96REMtA6dT1rzynGeEctdx+WSmb59V0Mjg9A2aS7jgOcsrGTaKGTUrMkGmu /KnJOvFWeABKAHNOlBDKG9d/CcrH9L6o9+q8j8TaAhD42l9Q5rSbSIAXoXATvBKd1N h73OhroAk+US1MYJ78J+FkmtWIjRHoZynRa0uUPA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726540AbfFQIWB (ORCPT ); Mon, 17 Jun 2019 04:22:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:52094 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725791AbfFQIWB (ORCPT ); Mon, 17 Jun 2019 04:22:01 -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 642EFAF4C; Mon, 17 Jun 2019 08:21:59 +0000 (UTC) Date: Mon, 17 Jun 2019 10:21:56 +0200 From: Michal Hocko To: Alastair D'Silva Cc: 'Alastair D'Silva' , '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: <20190617082156.GA1492@dhcp22.suse.cz> References: <20190617043635.13201-1-alastair@au1.ibm.com> <20190617043635.13201-5-alastair@au1.ibm.com> <20190617074715.GE30420@dhcp22.suse.cz> <068b01d524e2$4a5f5c30$df1e1490$@d-silva.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <068b01d524e2$4a5f5c30$df1e1490$@d-silva.org> 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 17:57:16, Alastair D'Silva wrote: > > -----Original Message----- > > From: Michal Hocko > > Sent: Monday, 17 June 2019 5:47 PM > > 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 > > > > 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? > > I was getting stalls when removing ~1TB of memory. Have debugged what is the source of the stall? We do cond_resched once a memory section which should be a constant unit of work regardless of the total amount of memory to be removed. -- Michal Hocko SUSE Labs