Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2254164ybi; Mon, 17 Jun 2019 01:23:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfRJ2WYbrMyG1s7NEIzz1rcrUoLpLJZrpXCP75d5Cyz4e1wpB/p/k6tNKGhivaqvrzzUef X-Received: by 2002:a17:902:42e2:: with SMTP id h89mr25039885pld.77.1560759796217; Mon, 17 Jun 2019 01:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560759796; cv=none; d=google.com; s=arc-20160816; b=FL/85I/V5pOCqU3g2VfV0a6k0Hacm/2pDRJ9KvdvYTW4jM/sP91EF+y3yuPl6l28kW 4ikGZe8ETP0donLEpYtHqG4r8KzjwN8KhNJ5od3T8FxqQo5360tIaSnYtbkSoYo0biOp Ec0pNSmmqFfcWeh0pnq81WXjA2TAYnmOINaqUl5TqYQHnM3mY/ampAWPL2SkuE8QlFMe i8s3aItAltD2E/ZTGnZW/qCsq4/9Hbc5XrxIJ7oXu+oJT02CDqPDVxuVAkcrdOVZLw7Y 8oGUW97CYOor29VJMwh2uimP+vr+9+Czl25nIdV9dfl1rdvsT0DnPceA6PeSpPhglslU mH/g== 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=7ymvn5JUry7KtFqwp5cxRbfksIusBDKC6pSOP5eNR8Y=; b=fuRjpPd+ya7AZnmuWLMT6Pry6/WI9V0/asuZMwT3FE1QYI3bBzNdGj6ue9495RtU3y 2zwUI6F9vBPiUMDOyxEbcLBnFIYofSScuUjRSBfKmqguDMBAAyHjOh1TMHprjHUlDs7w 2lhCIiTwwBj71m0w60OI4NiwRRkKEdqYhgndY+gc5otQW+6wL3CAtUMEsTgegOO8GAmb ovR9uo7f15hD3czIlPa3Y+ERWES9iglqITKL/ivwx3g809SeRWtRTEp/QRgRwv5my+gy u9F7vghaJ+sMg0FOKqpgiQ0X7wUOO+d4HY0sXmj2o8ItLOae7/JxV6DpZlmwTNtXlzUB YUXQ== 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 5si10005634plx.200.2019.06.17.01.23.00; Mon, 17 Jun 2019 01:23:16 -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 S1726437AbfFQIWB (ORCPT + 99 others); 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