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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 1997AC47082 for ; Tue, 8 Jun 2021 15:26:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B7792611AE for ; Tue, 8 Jun 2021 15:26:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7792611AE 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 1A5E26B006C; Tue, 8 Jun 2021 11:26:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 156F66B0070; Tue, 8 Jun 2021 11:26:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F120B6B0071; Tue, 8 Jun 2021 11:26:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id C1C546B006C for ; Tue, 8 Jun 2021 11:26:26 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 562FB180AD81D for ; Tue, 8 Jun 2021 15:26:26 +0000 (UTC) X-FDA: 78230933172.33.760D161 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf04.hostedemail.com (Postfix) with ESMTP id E837D480 for ; Tue, 8 Jun 2021 15:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623165984; 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=Dons6tltBqQZH2QeFOcvai/iidvFY4QSS28eS4paeyM=; b=chtxg81ftIDNBSfxQ9tUgaDhzsHFaI227AIs3qggnTRzH7uibgA0AjO6mTh6UXkiQs3Sn7 rIpvy2JnbkErF4DuiaWd9ZNfzEu4Lyybi5SUcmzV/4S+x/2+ucIkzS5LZGKlrgr7/7SzKj ZxFpRVlkfSMyG6zYHSARBbrvXjxQgIE= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-37-A-pupUJEOveDNaTA35nEsA-1; Tue, 08 Jun 2021 11:26:23 -0400 X-MC-Unique: A-pupUJEOveDNaTA35nEsA-1 Received: by mail-wr1-f69.google.com with SMTP id r17-20020a5d52d10000b0290119976473fcso7398120wrv.15 for ; Tue, 08 Jun 2021 08:26:23 -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=Dons6tltBqQZH2QeFOcvai/iidvFY4QSS28eS4paeyM=; b=PBvp4Q0zDIqshyhzk4vtuBrQLof1Xvl4+4Fkq2GhjvkJSS/Vvkdcdt8zOgD2ieZeEP QTlhk7VJZKAISPKKetilmAS1N+YJZS7gp0E+tDH+nf3wcf9WM9df0AXjD65rO/+hKxrI M0hxCNBbdlks7KrbHAmdDV0oZGqq8eTSv7ZMg1Qeg3jpNPL+UZKnWKnFwUeGidjV4231 a7AfkI/GQNdE5PD71VEhok9ovgbDel7i2cyyM7kycryEReG4ROeuCTbcneTsJRDtF4iE GJ3TqJfInjLeSkFWxJPsAAlbaQLbjziftLD9W/2zpuWte1iIyBYCLq1Y75zXjDsk2nU7 DIPA== X-Gm-Message-State: AOAM532nOZIohXOEsjGtPh0Jk4jVn9rfnEvkdzfr+gGLKyKT9qwKOIrQ JsYR8dx4mPByPzs4yhph4cxY7VXpCyWJfy8bzyoEP7x7nzpyY/91afYg3qn9s68h2fIp03N2x+o 9lLYGLbeOIR4= X-Received: by 2002:a5d:6111:: with SMTP id v17mr13460433wrt.20.1623165982710; Tue, 08 Jun 2021 08:26:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOjgIg8iLQVnuaD504Axjb8TEod5Dwy+jHIuka6fqtUEQ8Kj0bM5dyezq9BOoxSDxPTKFL2A== X-Received: by 2002:a5d:6111:: with SMTP id v17mr13460418wrt.20.1623165982551; Tue, 08 Jun 2021 08:26:22 -0700 (PDT) Received: from [192.168.3.132] (p5b0c61cf.dip0.t-ipconnect.de. [91.12.97.207]) by smtp.gmail.com with ESMTPSA id h46sm23589783wrh.44.2021.06.08.08.26.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Jun 2021 08:26:22 -0700 (PDT) Subject: Re: [PATCH v2 2/2] memory-hotplug.rst: complete admin-guide overhaul To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Andrew Morton , Anshuman Khandual , Dave Hansen , Jonathan Corbet , Matthew Wilcox , Michal Hocko , Mike Kravetz , Mike Rapoport , Muchun Song , Oscar Salvador , Pavel Tatashin , Stephen Rothwell , linux-doc@vger.kernel.org References: <20210608133855.20397-1-david@redhat.com> <20210608133855.20397-3-david@redhat.com> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Tue, 8 Jun 2021 17:26:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210608133855.20397-3-david@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=chtxg81f; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf04.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-Stat-Signature: ed1rc7pynz634e4rhcjnww14spen8fjd X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E837D480 X-HE-Tag: 1623165982-569664 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 08.06.21 15:38, David Hildenbrand wrote: > The memory hot(un)plug documentation is outdated and incomplete. Most of > the content dates back to 2007, so it's time for a major overhaul. > > Let's rewrite, reorganize and update most parts of the documentation. In > addition to memory hot(un)plug, also add some details regarding > ZONE_MOVABLE, with memory hotunplug being one of its main consumers. > > Drop the file history, that information can more reliably be had from > the git log. > > The style of the document is also properly fixed that e.g., "restview" > renders it cleanly now. > > In the future, we might add some more details about virt users like > virtio-mem, the XEN balloon, the Hyper-V balloon and ppc64 dlpar. > > Acked-by: Michal Hocko > Cc: Andrew Morton > Cc: Oscar Salvador > Cc: Michal Hocko > Cc: Mike Kravetz > Cc: Mike Rapoport > Cc: Dave Hansen > Cc: Matthew Wilcox > Cc: Anshuman Khandual > Cc: Muchun Song > Cc: Pavel Tatashin > Cc: Jonathan Corbet > Cc: Stephen Rothwell > Cc: linux-doc@vger.kernel.org > Signed-off-by: David Hildenbrand After a follow-up discussion on v1, the following on top: diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst b/Documentation/admin-guide/mm/memory-hotplug.rst index 353b67e76439..15330ad4b764 100644 --- a/Documentation/admin-guide/mm/memory-hotplug.rst +++ b/Documentation/admin-guide/mm/memory-hotplug.rst @@ -35,7 +35,7 @@ used to expose persistent memory, other performance-differentiated memory and reserved memory regions as ordinary system RAM to Linux. Linux only supports memory hot(un)plug on selected 64 bit architectures, such as -x86_64, aarch64, ppc64, s390x and ia64. +x86_64, arm64, ppc64, s390x and ia64. Memory Hot(Un)Plug Granularity ------------------------------ @@ -178,9 +178,9 @@ Or one can explicitly request a kernel zone (usually ZONE_NORMAL) by:: % echo online_kernel > /sys/devices/system/memory/memoryXXX/state -In any case, if offline succeeds, the state of the memory block is changed to be -"online". If it fails, an error will be returned by the kernel via the system -call that triggered the respective file modification. +In any case, if onlining succeeds, the state of the memory block is changed to +be "online". If it fails, the state of the memory block will remain unchanged +and the above commands will fail. Onlining Memory Blocks Automatically ------------------------------------ @@ -234,8 +234,15 @@ Or alternatively:: % echo 0 > /sys/devices/system/memory/memoryXXX/online -If offline succeeds, the state of the memory block is changed to be "offline". -If it fails, an error will be returned by the kernel. +If offlining succeeds, the state of the memory block is changed to be "offline". +If it fails, the state of the memory block will remain unchanged and the above +commands will fail, for example, via:: + + bash: echo: write error: Device or resource busy + +or via:: + + bash: echo: write error: Invalid argument Observing the State of Memory Blocks ------------------------------------ @@ -535,7 +542,7 @@ block might fail: offlining; this applies to memory blocks present during boot only. - Special memory blocks prevented by the system from getting offlined. Examples - include any memory available during boot on aarch64 or memory blocks spanning + include any memory available during boot on arm64 or memory blocks spanning the crashkernel area on s390x; this usually applies to memory blocks present during boot only. -- Thanks, David / dhildenb