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=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 1DBBDC33CB6 for ; Wed, 22 Jan 2020 19:09:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EA46724673 for ; Wed, 22 Jan 2020 19:09:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA46724673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 851DA6B0005; Wed, 22 Jan 2020 14:09:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 801B96B0006; Wed, 22 Jan 2020 14:09:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F0C66B0007; Wed, 22 Jan 2020 14:09:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 5A1D16B0005 for ; Wed, 22 Jan 2020 14:09:07 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id E9FC2181AEF0B for ; Wed, 22 Jan 2020 19:09:06 +0000 (UTC) X-FDA: 76406207892.10.scene36_1551e8aa0ec49 X-HE-Tag: scene36_1551e8aa0ec49 X-Filterd-Recvd-Size: 4885 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Wed, 22 Jan 2020 19:09:06 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id y11so277709wrt.6 for ; Wed, 22 Jan 2020 11:09:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jDrouBSrTch1oRjGKu1kF0MMLpGbHzjzsyn2ncqxth4=; b=BzoQMf4rsYuNb46TNmWH/xo3Bm5uODMMgninSrOetFXbq66Y+4BVIzCfsggnUXHuA9 PFN3mAzQrvsW3JgyWyR/DNuvLEFsJH73OD4nKnM8eXrMjDh6XJZ5eR3rbrRnmc4Bzpnk +AGWwhZE65Z3JkrJbme1w1VmerDTV2MQKE3/BjM4f0I5lVnC6KXjcAIgEH6Of/8HuwEp X9C9mdktnRl+jrRBvctLmQYsYtN4yJnD+zEXMWy7UKo8Pf2B9f/CN3bSJkiwfPGU2GCa Dy09lNpPOeUToeOEW9haeLtx/0ZduQfgh0JSATZTMeIkE01IAmcNv8hIGSsMuTJ5eID/ uL/A== X-Gm-Message-State: APjAAAX92reLMkWKzqUgHq1rCHwQfg0vf0xCqdiLs7JWJ5Yka2ETSk4g Lq/hGQbff3JNvVIQjqJclbEEhAo6 X-Google-Smtp-Source: APXvYqzMXEKmV9WZyNBUnEiqdP7WtvzjVGR6C9yz/OiUdoKzI0eFO2vOshMLGfSUDVyLMFtEMLdlbg== X-Received: by 2002:adf:e290:: with SMTP id v16mr13251085wri.16.1579720145425; Wed, 22 Jan 2020 11:09:05 -0800 (PST) Received: from localhost (ip-37-188-226-95.eurotel.cz. [37.188.226.95]) by smtp.gmail.com with ESMTPSA id x11sm5147651wmg.46.2020.01.22.11.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 11:09:04 -0800 (PST) Date: Wed, 22 Jan 2020 20:09:03 +0100 From: Michal Hocko To: David Hildenbrand Cc: Dan Williams , Linux Kernel Mailing List , Linux MM , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , Leonardo Bras , Nathan Lynch , Allison Randal , Nathan Fontenot , Thomas Gleixner , Stephen Rothwell , Anshuman Khandual , lantianyu1986@gmail.com, linuxppc-dev Subject: Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul Message-ID: <20200122190903.GD29276@dhcp22.suse.cz> References: <20200121120714.GJ29276@dhcp22.suse.cz> <20200122104230.GU29276@dhcp22.suse.cz> <98b6c208-b4dd-9052-43f6-543068c649cc@redhat.com> <816ddd66-c90b-76f1-f4a0-72fe41263edd@redhat.com> <20200122164618.GY29276@dhcp22.suse.cz> <626d344e-8243-c161-cd07-ed1276eba73d@redhat.com> <20200122183809.GB29276@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed 22-01-20 19:46:15, David Hildenbrand wrote: > On 22.01.20 19:38, Michal Hocko wrote: [...] > > How exactly is check + offline more optimal then offline which makes > > check as its first step? I will get to your later points after this is > > clarified. > > Scanning (almost) lockless is more efficient than bouncing back and > forth with the device_hotplug_lock, mem_hotplug_lock, cpu_hotplug_lock > and zone locks - as far as I understand. All but the zone lock shouldn't be really contended and as such shouldn't cause any troubles. zone->lock really depends on the page allocator usage of course. But as soon as we have a contention then it is just more likely that the result is less reliable. I would be also really curious about how much actual time could be saved by this - some real numbers - because hotplug operations shouldn't happen so often that this would stand out. At least that is my understanding. > And as far as I understood, that was the whole reason of the original > commit. Well, I have my doubts but it might be just me and I might be wrong. My experience from a large part of the memory hotplug functionality is that it was driven by a good intention but without a due diligence to think behind the most obvious usecase. Having a removable flag on the memblock sounds like a neat idea of course. But an inherently racy flag is just borderline useful. Anyway, I will stop at this moment and wait for real usecases. Thanks! -- Michal Hocko SUSE Labs