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=-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 22A4FC2D0DB for ; Wed, 22 Jan 2020 18:38:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E456B21734 for ; Wed, 22 Jan 2020 18:38:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E456B21734 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 77EED6B0006; Wed, 22 Jan 2020 13:38:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 707146B0007; Wed, 22 Jan 2020 13:38:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A84F6B000A; Wed, 22 Jan 2020 13:38:16 -0500 (EST) 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 409E66B0006 for ; Wed, 22 Jan 2020 13:38:16 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id EC50B2C2A for ; Wed, 22 Jan 2020 18:38:15 +0000 (UTC) X-FDA: 76406130150.10.lead73_2afed3cfa781f X-HE-Tag: lead73_2afed3cfa781f X-Filterd-Recvd-Size: 5713 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Wed, 22 Jan 2020 18:38:15 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id f129so149590wmf.2 for ; Wed, 22 Jan 2020 10:38:15 -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=966BgYgZRUlLppOTZ8GZw5dVZmBTcRyeqAhJa9bwYzU=; b=txjELb4hqFBfY0iDN5apTac7lnDKGF5oxEdDC63beQQHvLViLGPi9PVJ/ouryTPLbm prEEIHS715ISaWp/ardvv76gSUawTs5yq00PVKdMK1SQ+Rq2ND+/QHb1qxjyUFfFYlot 2TOOcJKtqR3omcAtDhni8BzLkoDpi3mudjifAH5HaNvtz4Sk8CuhBYFL14kNJHp0neq7 ULhzLe1FlEmdjyy354jTUll55TH73BRpKvm5xGHTFP6k6kzL9yJAdxgLphDGawpKn7wc FC4biKx1bqA2obJsOZBB+VzxhA6sLuEW4imIhLWH3Sip2JoxdF3+4omj+h9wfxj+qmO1 +uhg== X-Gm-Message-State: APjAAAU9Y1rEHjl+QJQGob7VKASR3+oKhjuunksqaFH630EVOHyqpWom TbhJypS/XeEpM4pAmYRWMxU= X-Google-Smtp-Source: APXvYqytlJusKX0Kz3YLI2vL5MLf0VI1Z1xBBIdMBORZVE6octNROw4k0V6HC2FB29J3ObqpMFnQGw== X-Received: by 2002:a05:600c:2c06:: with SMTP id q6mr4482299wmg.154.1579718294349; Wed, 22 Jan 2020 10:38:14 -0800 (PST) Received: from localhost (ip-37-188-245-167.eurotel.cz. [37.188.245.167]) by smtp.gmail.com with ESMTPSA id j12sm63168372wrw.54.2020.01.22.10.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 10:38:13 -0800 (PST) Date: Wed, 22 Jan 2020 19:38:09 +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: <20200122183809.GB29276@dhcp22.suse.cz> References: <20200120074816.GG18451@dhcp22.suse.cz> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <626d344e-8243-c161-cd07-ed1276eba73d@redhat.com> 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:15:47, David Hildenbrand wrote: > On 22.01.20 17:46, Michal Hocko wrote: > > On Wed 22-01-20 12:58:16, David Hildenbrand wrote: [...] > >> Especially interesting for IBM z Systems, whereby memory > >> onlining/offlining will trigger the actual population of memory in the > >> hypervisor. So if an admin wants to offline some memory (to give it back > >> to the hypervisor), it would use lsmem to identify such blocks first, > >> instead of trying random blocks until one offlining request succeeds. > > > > I am sorry for being dense here but I still do not understand why s390 > > It's good that we talk about it :) It's hard to reconstruct actual use > cases from tools and some documentation only ... > > Side note (just FYI): One difference on s390x compared to other > architectures (AFAIKS) is that once memory is offline, you might not be > allowed (by the hypervisor) to online it again - because it was > effectively unplugged. Such memory is not removed via remove_memory(), > it's simply kept offline. I have a very vague understanding of s390 specialities but this is not really relevant to the discussion AFAICS because this happens _after_ offlining. > > and the way how it does the hotremove matters here. Afterall there are > > no arch specific operations done until the memory is offlined. Also > > randomly checking memory blocks and then hoping that the offline will > > succeed is not way much different from just trying the offline the > > block. Both have to crawl through the pfn range and bail out on the > > unmovable memory. > > I think in general we have to approaches to memory unplugging. > > 1. Know explicitly what you want to unplug (e.g., a DIMM spanning > multiple memory blocks). > > 2. Find random memory blocks you can offline/unplug. > > > For 1, I think we both agree that we don't need this. Just try to > offline and you know if it worked. > > Now of course, for 2 you can try random blocks until you succeeded. From > a sysadmin point of view that's very inefficient. From a powerpc-utils > point of view, that's inefficient. 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. -- Michal Hocko SUSE Labs