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=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 DE4B9C433E2 for ; Fri, 4 Sep 2020 07:46:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8DB9E20791 for ; Fri, 4 Sep 2020 07:46:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DB9E20791 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E8CB28E0001; Fri, 4 Sep 2020 03:46:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E3B1D6B005C; Fri, 4 Sep 2020 03:46:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D515C8E0001; Fri, 4 Sep 2020 03:46:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id BE5D56B005A for ; Fri, 4 Sep 2020 03:46:55 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7B11A180AD806 for ; Fri, 4 Sep 2020 07:46:55 +0000 (UTC) X-FDA: 77224597590.19.vest00_2f1123f270b0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 4E2B51AD1B5 for ; Fri, 4 Sep 2020 07:46:55 +0000 (UTC) X-HE-Tag: vest00_2f1123f270b0 X-Filterd-Recvd-Size: 2899 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Sep 2020 07:46:54 +0000 (UTC) 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 90D89ACC8; Fri, 4 Sep 2020 07:46:54 +0000 (UTC) Date: Fri, 4 Sep 2020 09:46:53 +0200 From: Michal Hocko To: David Hildenbrand Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Wei Yang , Baoquan He , Pankaj Gupta , Oscar Salvador Subject: Re: [PATCH v2 03/10] mm/memory_hotplug: simplify page offlining Message-ID: <20200904074653.GD15277@dhcp22.suse.cz> References: <20200903145844.2ead558f5bc3ef3d5230d30f@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4E2B51AD1B5 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri 04-09-20 07:47:45, David Hildenbrand wrote: > > > > Am 03.09.2020 um 23:58 schrieb Andrew Morton : [...] > > @@ -1589,16 +1567,27 @@ int __ref offline_pages(unsigned long st > > reason = "failure to dissolve huge pages"; > > goto failed_removal_isolated; > > } > > - /* check again */ > > - ret = walk_system_ram_range(start_pfn, end_pfn - start_pfn, > > - NULL, check_pages_isolated_cb); > > - } while (ret); > > - > > - /* Ok, all of our target is isolated. > > - We cannot do rollback at this point. */ > > - walk_system_ram_range(start_pfn, end_pfn - start_pfn, > > - &offlined_pages, offline_isolated_pages_cb); > > - pr_info("Offlined Pages %ld\n", offlined_pages); > > + > > + /* > > + * 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. > > + * > > + * 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 (test_pages_isolated(start_pfn, end_pfn, MEMORY_OFFLINE)); > > I think we have to do > > ret = test_pages_isolated() > if (ret) Yes. -- Michal Hocko SUSE Labs