Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp595321pxk; Thu, 3 Sep 2020 07:51:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbTbBrleICsBPTRdeZ9Q9aPe2ttSwakrA9ZhDt9rQ2545XQGwPbmt6M15pr1jTKWRXcLRS X-Received: by 2002:a17:906:6406:: with SMTP id d6mr2486696ejm.30.1599144710341; Thu, 03 Sep 2020 07:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599144710; cv=none; d=google.com; s=arc-20160816; b=orSO9NU8zKIMZ2rc2HIBrSW1KD7zDVMGHlsXrjS11G9Jiv5k4KNK8phQYnKN1gjIZ1 U7oGh2A+c18Jkm7U/Shanpfw0PcuQBxMLtP12og6HhVjlbfoIDwAD4wlvNvqNkbLt/8I CrZL0Xkn7g/tSVoz9QcSADAv8yWUqRv/2FzdrBpusxyXr18IY8YmCrs12tW7ISKAGfT3 IvKFCpsm2MZfW82JEF5Cj35fCqx1i5HFWfG9doTV7LPneIDuzN2FvStte5IGw3UvCsNl MOyQDb24zZbcp+H1Q0M5TnrXnrGaVY9Pu5nuh9lYEremVDiVE77ipid6ZGvXlHoJbF2d qlbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XsPnpLathKjXprbkqY+YKBNSJFUri0XqOdwMusVjvXU=; b=DgQ+uuJDBic3yqR60LJNr7Bsz+ez70PjHqHKOe8tjdsByE3YVYRcWkXo1VvBODaJDB cp2WwzXN270/u8HME3PCOk42h816AILNcjgvMUqZQW3U2eGnzZ5f1F5Jz8zN0ae7fuid jbDY1l3EMGdXSeMCXkqhtuN/2TiYxkMp0trapuQP9zTJL9fkGefzfpFI19sa+PssVvCH 4YYKecTJL5m5Zi9gv2yJC7VjeZ5qp+buGcbJS5Fm9Bl+1PcQTjSdB+afArt23cTemnps A0HgCL6iP/hhnIHKTFL/QbRpMocciA/h8zrOQIGMmC3PZND92yumfO2O0m1vGLpVKDwp 2ybg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b="gT/XthbV"; 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 h1si1970054edk.240.2020.09.03.07.51.27; Thu, 03 Sep 2020 07:51:50 -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; dkim=pass header.i=@soleen.com header.s=google header.b="gT/XthbV"; 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 S1729334AbgICOs5 (ORCPT + 99 others); Thu, 3 Sep 2020 10:48:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729283AbgICOWR (ORCPT ); Thu, 3 Sep 2020 10:22:17 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F2DCC061A15 for ; Thu, 3 Sep 2020 06:44:05 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id n22so2734996edt.4 for ; Thu, 03 Sep 2020 06:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XsPnpLathKjXprbkqY+YKBNSJFUri0XqOdwMusVjvXU=; b=gT/XthbVd8CL1/XQCWf2oVysDBfnhEQ2b93QTis/AEooCJw9Ac3pkjj2Sl/rWyMgvZ 0Vyf1iHaeFVj7xVcqYSEEn8LH0GUDNm81bHwVAf011MvPvb34vUAm7476fTz41Ks6r4g c04+FoDx3Zi5UjAxseKWfeLBnfMFmr3gw5/4SIlQYeY1/oMpkdtEL+M1Btf6Plsp3xz0 SaSm3YxrDJPpuG8IwiX1Iw5nkerOknoezzUiLAPOLfCEm6WVBV5NvEvKIdmRFf709593 GlIt9Ut4aXS5TKdKulFyXU1mdTegLQQJc3JXQ4D/KkbT+LOw5OmA5y+BzIFClqeSZMK8 8ljQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XsPnpLathKjXprbkqY+YKBNSJFUri0XqOdwMusVjvXU=; b=MYS5qXPUgwyxf9hQhu1WWN0KJLiZ4IEOY+qMCh8TKnevKDQwRKPYIaorEjfk0VEIQV RyIB9upi5xr6s3g2JVaZ9tbVPkARwVQJQSTg6qF0WLJsz4TfVyUHPAR7841d9ZwyNZHQ Tw+ktajnD/+NJOTjyhcnTNq0v6T3ADKQFf9oh6k1dYNonKQypSsano6//QrUmrkFip75 TjbxOFgFEMg3iBNo9iM9+HRaC9eXd5VERTzVGHYWBoEP1MOoEzoUfzO5Q7+U4VPvRM9f yeOa9H9ddxTxrxxJ9tfuL0OxxjrPMQPFrhKFJjFhXNNuMHNkGI3buOnOYv/Cr1O3TG2I AtCg== X-Gm-Message-State: AOAM532jwG+7XJFHZ8WR+B+ZVVulp6YEUBw1Ofeyf+aVP3wMrc3rf0Va YEYYFFisjxe10Ufeh1sPmXxX0W2R8WjB0VBK1JAx+w== X-Received: by 2002:a05:6402:1544:: with SMTP id p4mr2917778edx.346.1599140643210; Thu, 03 Sep 2020 06:44:03 -0700 (PDT) MIME-Version: 1.0 References: <20200901124615.137200-1-pasha.tatashin@soleen.com> <20200903070733.GO4617@dhcp22.suse.cz> In-Reply-To: <20200903070733.GO4617@dhcp22.suse.cz> From: Pavel Tatashin Date: Thu, 3 Sep 2020 09:43:27 -0400 Message-ID: Subject: Re: [PATCH] mm/memory_hotplug: drain per-cpu pages again during memory offline To: Michal Hocko Cc: LKML , Andrew Morton , linux-mm Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Michal, I will add your comments. Pasha On Thu, Sep 3, 2020 at 3:07 AM Michal Hocko wrote: > > 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