From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 94E3DC433B4 for ; Mon, 12 Apr 2021 15:27:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E3AEA61287 for ; Mon, 12 Apr 2021 15:27:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3AEA61287 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 738486B0036; Mon, 12 Apr 2021 11:27:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E8996B006E; Mon, 12 Apr 2021 11:27:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 588C36B0070; Mon, 12 Apr 2021 11:27:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 37A5A6B0036 for ; Mon, 12 Apr 2021 11:27:43 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E45A11804809F for ; Mon, 12 Apr 2021 15:27:42 +0000 (UTC) X-FDA: 78024094764.27.DAD3862 Received: from outbound-smtp17.blacknight.com (outbound-smtp17.blacknight.com [46.22.139.234]) by imf27.hostedemail.com (Postfix) with ESMTP id 2426A80192C0 for ; Mon, 12 Apr 2021 15:27:31 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp17.blacknight.com (Postfix) with ESMTPS id 857711C5861 for ; Mon, 12 Apr 2021 16:27:39 +0100 (IST) Received: (qmail 25959 invoked from network); 12 Apr 2021 15:27:39 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 12 Apr 2021 15:27:39 -0000 Date: Mon, 12 Apr 2021 16:27:37 +0100 From: Mel Gorman To: David Hildenbrand Cc: Vlastimil Babka , Andrew Morton , Oscar Salvador , "Michael S. Tsirkin" , Alexander Duyck , Minchan Kim , Michal Hocko , Linux-MM , LKML Subject: Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove Message-ID: <20210412152737.GB3697@techsingularity.net> References: <20210412120842.GY3697@techsingularity.net> <20210412140852.GZ3697@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 2426A80192C0 X-Stat-Signature: 1t7ao98dnbcxcp5x1e656o56p3hkm9c1 Received-SPF: none (techsingularity.net>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=outbound-smtp17.blacknight.com; client-ip=46.22.139.234 X-HE-DKIM-Result: none/none X-HE-Tag: 1618241251-813885 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 Mon, Apr 12, 2021 at 04:12:11PM +0200, David Hildenbrand wrote: > > After v1 of the patch, the race was reduced to the point between the > > zone watermark check and the rmqueue_pcplist but yes, it still existed. > > Closing it completely was either complex or expensive. Setting > > zone->pageset = &boot_pageset before the free would shrink the race > > further but that still leaves a potential memory ordering issue. > > > > While fixable, it's either complex, expensive or both so yes, just leaving > > the pageset structures in place would be much more straight-forward > > assuming the structures were not allocated in the zone that is being > > hot-removed. As things stand, I had trouble even testing zone hot-remove > > as there was always a few pages left behind and I did not chase down > > why. > > Can you elaborate? I can reliably trigger zone present pages going to 0 by > just hotplugging a DIMM, onlining the memory block devices to the MOVABLE > zone, followed by offlining the memory block again. > For the machine I was testing on, I tried offlining all memory within a zone on a NUMA machine. Even if I used movable_zone to create a zone or numa=fake to create multiple fake nodes and zones, there was always either reserved or pinned pages preventing the full zone being removed. -- Mel Gorman SUSE Labs