Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp325681pxk; Thu, 3 Sep 2020 00:11:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxVrIT6zIWjB8qiW41YMeq3MNWtDwPcpq65DpUmv9QSp+jlDnBlD4Lx4/lZKHpOByRkAHB X-Received: by 2002:a17:907:9ed:: with SMTP id ce13mr709924ejc.180.1599117059797; Thu, 03 Sep 2020 00:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599117059; cv=none; d=google.com; s=arc-20160816; b=VgMRFo7gk3nu/5zHyMctcemltGUdPZRpw8cPq2lYswks1+CTZWSTy7GwbttPFA/zig umjPMutRCKl7xP5N3Ega1xYqfRwIlTvqG1oNIsfLaboEOxfGKIRjT7jJHr1F5ZTKWoSK vFdEjBDy2m7j9DuiFJ0Sj/vpPVbBnlK1YH0ejldz7s0QSR+Ufm96MPEzUoSeSRDVKb14 V5isNLKTh0z8oRE+hE7kI9k4wgEbBs6Ly+6x6zaSmh69Kb36JklkAm6WClDKRcyCmGHO pG0FkRlD3xvIiXG7IznbPsZd/YrcERE99C0nmfM2ESMmd2Rxq2DG4bNlFKYG9AKwuPsR UWIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=kdi1wwU169+HsIT9c5VuY5TjKz/TYibaMFg3+i5iqb0=; b=WAR3bxZsLUs5ytZiBM3eYg4TXlb3oxc4MLeyAZSukkryLe8OQPU3iHPRYJJ6bpYIFA DcBE41NMh/A15TzsaZd+Mj+RezmjgAzMwdjRxtqcToQBYXcp+uI6YBzzQzOvK6rMDrKd zh72sh4ZLfq+F/RaIlaD6bDUHgIXTofOrPLLukT9fkhBVzPHzI0NNccNBi5IYoDKeicc AUtruDPwjTTTEmBmfypDpKpAYMNIz4XyZrq5lVS/gjcnyblV6v55PploXlHF1TDcve9m l6vy0kOSl6lipFVSKK4KCqyFzVReFJ0UDco5XtESx6K4hTf4VTp83xbSnsSSAEkVEsB5 ZyrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h25si1344160eje.30.2020.09.03.00.10.36; Thu, 03 Sep 2020 00:10:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727825AbgICHHg (ORCPT + 99 others); Thu, 3 Sep 2020 03:07:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:43916 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbgICHHf (ORCPT ); Thu, 3 Sep 2020 03:07:35 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 855D3AD21; Thu, 3 Sep 2020 07:07:35 +0000 (UTC) Date: Thu, 3 Sep 2020 09:07:33 +0200 From: Michal Hocko To: Pavel Tatashin Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org Subject: Re: [PATCH] mm/memory_hotplug: drain per-cpu pages again during memory offline Message-ID: <20200903070733.GO4617@dhcp22.suse.cz> References: <20200901124615.137200-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200901124615.137200-1-pasha.tatashin@soleen.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 01-09-20 08:46:15, Pavel Tatashin wrote: [...] > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index e9d5ab5d3ca0..d6d54922bfce 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -1575,6 +1575,15 @@ static int __ref __offline_pages(unsigned long start_pfn, > /* check again */ > ret = walk_system_ram_range(start_pfn, end_pfn - start_pfn, > NULL, check_pages_isolated_cb); > + /* > + * per-cpu pages are drained in start_isolate_page_range, but if > + * there are still pages that are not free, make sure that we > + * drain again, because when we isolated range we might > + * have raced with another thread that was adding pages to > + * pcp list. I would also add * Forward progress should be still guaranteed because * pages on the pcp list can only belong to MOVABLE_ZONE * because has_unmovable_pages explicitly checks for * PageBuddy on freed pages on other zones. > + */ > + if (ret) > + drain_all_pages(zone); > } while (ret); > > /* Ok, all of our target is isolated. > -- > 2.25.1 > -- Michal Hocko SUSE Labs