Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2188003ybi; Sun, 16 Jun 2019 23:59:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsuHJODTG/KCnNr/QPc4oS9iR+qSS7su6KoEMiFJHLAsb42Fukc71EtMJIVFplOsT1kdH0 X-Received: by 2002:a17:902:ea:: with SMTP id a97mr64950306pla.182.1560754750162; Sun, 16 Jun 2019 23:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560754750; cv=none; d=google.com; s=arc-20160816; b=exjRp5E7Dwvw03mSAxwzcaw3oPrRsS1VcgZyN355sC39D6RjAaxdByzhzXjxLydQtC NMRXWq8Y+BOtqanGnKT1N5PKRYi+AREEKU74kfKiEZwAU3RFCHJJx/pKsV6v0+vaYlu2 hR6UzF/LgShgR2E0NQO/mhPepnblxXnsEUecrM67lPUscQ+WEVpB0YuYUnlWOqh1r/mo Ncknvsi/CLiAVWijQ7ryzTmsiUI3ug/ZRDreqeqrM7X4veOGu66awSe/GJFdnL4beRgO CMAR6WIZlVM97S44yL9NTQROtrAZUDa+CrknVe3ffUV7cSHxDmOh0PgvA6PR+ekMe3Ye Qyiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=Qc0wKhR7TMnGEtRJEBVLBob7EkTOdf2YmOm3ZpgPv68=; b=Any77goIqOmE3avVaxArnehJfnrHBCnj9v8y2lDGHfllCh0Tn82rJ09sPZIaxH3jM/ d/cZpsNNp4VWdviCDV+v8WR8thfGFA8R6CVNhHbvjqmiN/i089oz4/YDQ+F2uukhu9N6 S6PaX12M/Bf/L9fsxG+DCDb6vcGrm3cIMPo+8BzPlN5D42xW7kS4kg6RsA3mD3uZN+tC Ew7qZCPb5LONtxvT81IK7/coX79+kamYHhCpIFiSpD4O4qUGAACuEzFr/0ZMAmMI9O87 pv/IRIfbgb+iI/iPjptOCjVjFkbIAuVQoQCNKQq9orGz4nJMU6CnFA+xFhtEwExQI46T rZbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@d-silva.org header.s=201810a header.b=KrCCbqJw; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si9958703pgk.528.2019.06.16.23.58.54; Sun, 16 Jun 2019 23:59:10 -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; dkim=pass header.i=@d-silva.org header.s=201810a header.b=KrCCbqJw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725919AbfFQG6u (ORCPT + 99 others); Mon, 17 Jun 2019 02:58:50 -0400 Received: from ushosting.nmnhosting.com ([66.55.73.32]:35392 "EHLO ushosting.nmnhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725778AbfFQG6u (ORCPT ); Mon, 17 Jun 2019 02:58:50 -0400 Received: from mail2.nmnhosting.com (unknown [202.169.106.97]) by ushosting.nmnhosting.com (Postfix) with ESMTPS id E03DF2DC007F; Mon, 17 Jun 2019 02:58:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d-silva.org; s=201810a; t=1560754726; bh=qtYoLQ9Jtz+QdOMQZQtS2I0PlmfBJLpviCQHIugyg54=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=KrCCbqJwEDVPV1oa+HDQWzTzSNiFMcYGZMMOmYQw9F/WU0Jd4mbKK/W8AOXM4EUKo 2FvKl6qyBtjfe8KwP88PsTOZUtfb1lAKkW+GyjR/YztolKQC2u2lUUgOK8+z0uNz4J heIGsVRcVkbaedZxOqjsigKFfYIwCfDjfUcdiedzqqwaR0H6flnOErGxjEB72K6Pwi hnKIJPA2PLyLlLICu+LYKqf92ky5qtgblyZ1hir94RpASmsX+yK9T2W1xlnEePXrWr Jjm95kC+O3yA0EfVTx7qgTnb1nVw6TO4XEzRdcRmQFoDKjpFKJKQiNFnx6x8sYBoSJ R50tcEWqLSW49YKe2nalt5ISXsrcOlJ4PCklJz+kkhsv364+gPdAfq/KebM41n/MRR pBmPcDdbJf0/BKltr9bwIm1Hq0wnzPwv81DkVG6PWTGwcwMAJh6rgZdMqxthd3kawu OdXg8gLwAPQlFgCHO1aSj08TT6/6qqFEzVQ1tNsUZYusRL67Jiq8XTm9x/S1p1ShgL mdfEj/o61fknpMcUGqQ2YqCmNhKllEDvSt1oczBtefKutI0qT3iDpF19pUfeWCXbcI w8n3qi6ggAcV8tEQevpUrxAF+jNxm4D/L78u7wXQsnUsA5eig/n2+Rz8ekfgXQYoce sShKw4GRp7OoxN+XmPZ+gEi4= Received: from adsilva.ozlabs.ibm.com (static-82-10.transact.net.au [122.99.82.10] (may be forged)) (authenticated bits=0) by mail2.nmnhosting.com (8.15.2/8.15.2) with ESMTPSA id x5H6wNQI056924 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Jun 2019 16:58:38 +1000 (AEST) (envelope-from alastair@d-silva.org) Message-ID: <790f8e0126abfa199cb690270c94ce163eca458d.camel@d-silva.org> Subject: Re: [PATCH 4/5] mm/hotplug: Avoid RCU stalls when removing large amounts of memory From: "Alastair D'Silva" To: Mike Rapoport Cc: 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 Date: Mon, 17 Jun 2019 16:58:22 +1000 In-Reply-To: <20190617065357.GD16810@rapoport-lnx> References: <20190617043635.13201-1-alastair@au1.ibm.com> <20190617043635.13201-5-alastair@au1.ibm.com> <20190617065357.GD16810@rapoport-lnx> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.2 (3.32.2-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail2.nmnhosting.com [10.0.1.20]); Mon, 17 Jun 2019 16:58:42 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-06-17 at 09:53 +0300, Mike Rapoport wrote: > 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. > Agreed, thanks for the review. -- Alastair D'Silva mob: 0423 762 819 skype: alastair_dsilva Twitter: @EvilDeece blog: http://alastair.d-silva.org