From patchwork Mon Jun 24 16:33:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13709849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 759E7C2BD09 for ; Mon, 24 Jun 2024 16:34:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84AEA6B0399; Mon, 24 Jun 2024 12:34:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 735876B039B; Mon, 24 Jun 2024 12:34:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55D716B039E; Mon, 24 Jun 2024 12:34:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 36E906B0399 for ; Mon, 24 Jun 2024 12:34:02 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 88D211211DE for ; Mon, 24 Jun 2024 16:34:01 +0000 (UTC) X-FDA: 82266329082.28.8A9B222 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf10.hostedemail.com (Postfix) with ESMTP id 8FA86C0011 for ; Mon, 24 Jun 2024 16:33:59 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="t0NSb+/X"; spf=pass (imf10.hostedemail.com: domain of 39Z95ZggKCFY76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=39Z95ZggKCFY76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719246825; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GVvAVLVgyp7BPn3YqnrE+Un4CdtD1Zv3a2093D82WyY=; b=UMW30nnCkdps/f7dFSDR9ZNeQyM2jsppljlnCg/uc5D9RHUP6udDEq7VnJEacrNESFWIM3 PS+gb3Zj2z2gSxhWEOBkHD6jsRU4IJGsAVYMImtx+l81xwbNnFkZwsH3Ej7ZmSOaWLsNOw Bi1p0GqSjOayq4ZSO6tXI/q3MAnaw1Y= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719246826; a=rsa-sha256; cv=none; b=vJ4QXbAIeQ/NA3azROhiMCyHvd6W2TdnIqnAeg5x+/SjQGKN836FKH2xiuOHGM7kgXNj/g LzIHj4wySo0+pFOwzJ2zYyp5gUj7/cQiiBHUA65Zrdnfg+x7CS/caABQ319yr168f4Rwrw THq3hESBzWZ1qPSxAz3U/O9y1mAh4WA= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="t0NSb+/X"; spf=pass (imf10.hostedemail.com: domain of 39Z95ZggKCFY76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=39Z95ZggKCFY76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1f733390185so39421625ad.3 for ; Mon, 24 Jun 2024 09:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719246838; x=1719851638; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=GVvAVLVgyp7BPn3YqnrE+Un4CdtD1Zv3a2093D82WyY=; b=t0NSb+/XSI9Nb0m2aI7u4z2ljCg2tpwPw2yZLi+uwEBZoscGJA0hNA8lUsIbrTYlzI rgfIMFT3yI064eduLdCNkhmt22NAjr2Fz6tFBtHSzBE7dR27rGut27i7YGm6f7FwoVlr Cmt/4rZjPvSegVLSJzkt1hsSDdHNxTWp+yinIOl0m/Ne16AS1ZBMhNHQJK2DFjitCijm qkQAP/bVLlhiDnZld3YQWYG3GkZoyUkrILR1jyXTXp1Hqmi/7hgPPKyKPjfMpstiMG8o QshovWklNnydS17GbEC4hJsxFLV5nadFhrjozWXn+etHWCRPpfP/sTPgeQsZtcrTAT+m QMaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246838; x=1719851638; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GVvAVLVgyp7BPn3YqnrE+Un4CdtD1Zv3a2093D82WyY=; b=CVks+HdHCNz2nsItK4gqeU5Py+QXiNbG45k5hEdAKHodc2C1/yaVZhJZpP9H1vHV18 Tip4mO7dnQmtCQ/xQKwbqwCAECoEA0H87nQLgcpd9S/TInlwsr2W4LsJjb4ZoamoU3AT I5YJPJXMyNbvZ3PU5wE7FH4F0wUjZmAXA6E2sdqYu+GVNNAnxqR4opRTGPCo2zV0CKpm HdtUGCdXfXcoJ6sX4a/uX6aLVqsv1Yrsss/F8UFH/c4Ep5q0etfN5AjZMllkobj+mmwA /t8tagf8VqGlyUXJ/VVq4idau75G6CPkey7ifTE3yfhTmWLZOnhcxLrSKoDcGwWlw7ZW Tgxg== X-Forwarded-Encrypted: i=1; AJvYcCV4un2h6y6W9D41n1GGrexJviMkqKiCjhzbr8vj9lKXO6REGvvmS10QEOmKyO0Z8BOvFulltlZ0STjp3Ymo7E5XYNU= X-Gm-Message-State: AOJu0YxvmkJwtpguh9+raFf5DnMsi4k66SY+h999WBAzM3RsYLiyfCgo ER8x9WiZr7vwon5TxKpAoA+d61cEBeEWEJsIV3I0i5Zkf6hGxsNE4bDZOOuf9LX4ic9SwLyxgrR ZxN1fBlaA1g== X-Google-Smtp-Source: AGHT+IFQ03M3aTRppiNCfLsuYEASJusj+ybeUo8fprfJ1Y1kR44v8CZCgZBXMkKg6JbKjrrKoR1HPHTKxUnd6g== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:902:e74c:b0:1f9:c823:d3 with SMTP id d9443c01a7336-1fa1d516b81mr196425ad.6.1719246837884; Mon, 24 Jun 2024 09:33:57 -0700 (PDT) Date: Mon, 24 Jun 2024 16:33:48 +0000 In-Reply-To: <20240624163348.1751454-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240624163348.1751454-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240624163348.1751454-5-jiaqiyan@google.com> Subject: [PATCH v5 4/4] docs: mm: add enable_soft_offline sysctl From: Jiaqi Yan To: nao.horiguchi@gmail.com, linmiaohe@huawei.com, jane.chu@oracle.com, ioworker0@gmail.com Cc: muchun.song@linux.dev, akpm@linux-foundation.org, shuah@kernel.org, corbet@lwn.net, osalvador@suse.de, rientjes@google.com, duenwen@google.com, fvdl@google.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, Jiaqi Yan X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8FA86C0011 X-Stat-Signature: c7sntncq1zfec4euqehamitiiys67csr X-HE-Tag: 1719246839-550489 X-HE-Meta: U2FsdGVkX199PzO1vsZNj8hZe7QolOXFZjzhG1N2je8nTGR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C5uSBoNCTcLFO+fsdh59YX5b7kw8StGC4hyNemE0qsYw10WDtrFAHGVnxycrxq/DgEeYd/57+IhbYxVLSTVc7msxuePZ3N8beiaY0PQ34uqSbbqE1uRf5x2dC3fNDH3fHKXgTaGCX54vDbsMhAsXdexT1D3xhvBXyh9WGspBj0Q5T/+oYA/e8hwxN7aTHHqpBiOSmQFPKICHbXj2g8VQLXhxW8y4XO/zgmR9hvjjx6uUENnO71V9pz/rUckyAMfKLBE53LHtjixvkhz5bW5ZlWYShuI3tf2O2X4+rCDviln/1H2sV435LtcnhNAiacH2preponrk2FOfzeTq4+iw9WgZhepQ5xWdil4aiIDt/rPJWUghakeVjWNVHxIna6AbuvZn/Ps88lEPCU9Dof0v/dxSxS+k1ZsH9kk8B+032RxDVNfJBNa8KDEFROQHdzOf5Z3mehPq2/m11+mw2dU/kKCpcClz2tm2yvW9XgQ8vLmulo3VnqCDs9tZRWH8kNBfPX5b6zC8CiRoh4r4u47aQ== 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: List-Subscribe: List-Unsubscribe: Add the documentation for soft offline behaviors / costs, and what the new enable_soft_offline sysctl is for. Acked-by: Oscar Salvador Signed-off-by: Jiaqi Yan Acked-by: Miaohe Lin --- Documentation/admin-guide/sysctl/vm.rst | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst index e86c968a7a0e..71463a7b3e2a 100644 --- a/Documentation/admin-guide/sysctl/vm.rst +++ b/Documentation/admin-guide/sysctl/vm.rst @@ -36,6 +36,7 @@ Currently, these files are in /proc/sys/vm: - dirtytime_expire_seconds - dirty_writeback_centisecs - drop_caches +- enable_soft_offline - extfrag_threshold - highmem_is_dirtyable - hugetlb_shm_group @@ -267,6 +268,37 @@ used:: These are informational only. They do not mean that anything is wrong with your system. To disable them, echo 4 (bit 2) into drop_caches. +enable_soft_offline +=================== +Correctable memory errors are very common on servers. Soft-offline is kernel's +solution for memory pages having (excessive) corrected memory errors. + +For different types of page, soft-offline has different behaviors / costs. +- For a raw error page, soft-offline migrates the in-use page's content to + a new raw page. +- For a page that is part of a transparent hugepage, soft-offline splits the + transparent hugepage into raw pages, then migrates only the raw error page. + As a result, user is transparently backed by 1 less hugepage, impacting + memory access performance. +- For a page that is part of a HugeTLB hugepage, soft-offline first migrates + the entire HugeTLB hugepage, during which a free hugepage will be consumed + as migration target. Then the original hugepage is dissolved into raw + pages without compensation, reducing the capacity of the HugeTLB pool by 1. + +It is user's call to choose between reliability (staying away from fragile +physical memory) vs performance / capacity implications in transparent and +HugeTLB cases. + +For all architectures, enable_soft_offline controls whether to soft offline +memory pages. When setting to 1, kernel attempts to soft offline the pages +whenever it thinks needed. When setting to 0, kernel returns EOPNOTSUPP to +the request to soft offline the pages. Its default value is 1. + +It is worth mentioning that after setting enable_soft_offline to 0, the +following requests to soft offline pages will not be performed: +- Request to soft offline pages from RAS Correctable Errors Collector. +- On ARM, the request to soft offline pages from GHES driver. +- On PARISC, the request to soft offline pages from Page Deallocation Table. extfrag_threshold =================