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=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 7C005C433ED for ; Mon, 12 Apr 2021 16:02:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 24C2B61278 for ; Mon, 12 Apr 2021 16:02:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24C2B61278 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9A9A36B006C; Mon, 12 Apr 2021 12:02:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 95A526B006E; Mon, 12 Apr 2021 12:02:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D3E76B0070; Mon, 12 Apr 2021 12:02:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 620AC6B006C for ; Mon, 12 Apr 2021 12:02:13 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1093845BB for ; Mon, 12 Apr 2021 16:02:13 +0000 (UTC) X-FDA: 78024181746.18.813BD9C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 0D7B9A0009D9 for ; Mon, 12 Apr 2021 16:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618243331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=78X0OYDfE/7+/Hlen2MBzJuZuksJMmznz4Te2YiIK6g=; b=BuYGwB0U3BeGPRwq/4OtG9RFBdRbL6P2HcEc2KvV72IASsrfzMCOpJNlCHG0KW4NZAENnA HmRfgnMxvme4TAqxZaUJZ34BoQMegYbqY9wGB4ZzOiCv8HgdLfrqrFr14zvYZumbl4VPU1 r7wN2A5t6VpfF5UssVlbu/uDV06dBjQ= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-535-to8gvnkcMDKj73USXc5vRA-1; Mon, 12 Apr 2021 12:02:10 -0400 X-MC-Unique: to8gvnkcMDKj73USXc5vRA-1 Received: by mail-wm1-f72.google.com with SMTP id v5-20020a05600c2145b029012bdd9ddcb7so434381wml.1 for ; Mon, 12 Apr 2021 09:02:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=78X0OYDfE/7+/Hlen2MBzJuZuksJMmznz4Te2YiIK6g=; b=o0pKjzw5YI0luFwp1h4rG1JsMAzPSpJG0GRxQiSAPtmpS9vBCXsNjEjclNg2GfKZnK i3vfCz3KbEAr/bNGA4LOqEZ1esjyGMGNHiyDiAVjNjv/+7c/vBiSurxF9pOh1mnO/Scd OeHwfWPsiUF7jA8HJ+N4AjSxGaGVl+uyNVAnb8R82UZ1flWmBACkMNlLjC0mqy/l2orO TCOVcHADAPuCT5qtd8ThjE9bNrd6GrmOep/EAoexFmcfktEgjJ/9obMGy85u2YZtTAQy iiC1z2KqGcuQ7xvxQs89j5TsERiiXm/U7uWZxEeKz/uQJrfGIqPEix9QCPhj8eMA4nZV nAGw== X-Gm-Message-State: AOAM533BF2d1AOHx454SQ0rpH/Lph9bok+mp0CJRL2N93to0xhRWcjvw UDykmdZ32MK+jayT44ogDWwzHd+pFfqMyudDcfatCeBSopgHcJ99A//qy7FRp6aMYz/8N/9kCUO kPpMqp7pfw1k= X-Received: by 2002:a5d:4584:: with SMTP id p4mr3809788wrq.383.1618243329106; Mon, 12 Apr 2021 09:02:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzS9w1z1n9yjWbp5Jp8RHXvNAVH1prig0Za5BI1pIb58C3NvGBrdnTP1V5Unu8Jv0gTQySv9g== X-Received: by 2002:a5d:4584:: with SMTP id p4mr3809750wrq.383.1618243328840; Mon, 12 Apr 2021 09:02:08 -0700 (PDT) Received: from [192.168.3.132] (p5b0c66cb.dip0.t-ipconnect.de. [91.12.102.203]) by smtp.gmail.com with ESMTPSA id v7sm16331006wrs.2.2021.04.12.09.02.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Apr 2021 09:02:08 -0700 (PDT) Subject: Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove To: Mel Gorman Cc: Vlastimil Babka , Andrew Morton , Oscar Salvador , "Michael S. Tsirkin" , Alexander Duyck , Minchan Kim , Michal Hocko , Linux-MM , LKML References: <20210412120842.GY3697@techsingularity.net> <20210412140852.GZ3697@techsingularity.net> <20210412152737.GB3697@techsingularity.net> From: David Hildenbrand Organization: Red Hat Message-ID: <9ecdd427-8eee-c3c8-414f-501f62245585@redhat.com> Date: Mon, 12 Apr 2021 18:02:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210412152737.GB3697@techsingularity.net> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0D7B9A0009D9 X-Stat-Signature: fgpokyszsmhpos7fbyhkqh8puj455rse X-Rspamd-Server: rspam02 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618243326-434706 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 12.04.21 17:27, Mel Gorman wrote: > 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. What can happen is that memblock allocations are still placed into the MOVABLE zone -- even with "movablenode" IIRC. Memory hot(un)plug is usually best tested in QEMU via pc-dimm devices. -- Thanks, David / dhildenb