From patchwork Thu Jun 20 18:48:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13706251 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 890B2C27C79 for ; Thu, 20 Jun 2024 18:49:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E616E6B013C; Thu, 20 Jun 2024 14:49:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B7DDC8D00A7; Thu, 20 Jun 2024 14:49:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C0018D00D5; Thu, 20 Jun 2024 14:49:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 200DC8D00A7 for ; Thu, 20 Jun 2024 14:49:09 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BE73CA07A3 for ; Thu, 20 Jun 2024 18:49:08 +0000 (UTC) X-FDA: 82252154376.23.4F54768 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf17.hostedemail.com (Postfix) with ESMTP id D730840013 for ; Thu, 20 Jun 2024 18:49:06 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=rkxK3y+i; spf=pass (imf17.hostedemail.com: domain of 3oXl0ZggKCKAJIAQIYANGOOGLE.COMLINUX-MMKVACK.ORG@flex--jiaqiyan.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3oXl0ZggKCKAJIAQIYANGOOGLE.COMLINUX-MMKVACK.ORG@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=1718909337; 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=TWFrrNyw1Nab21+ugVhetla5erwSeVLyLbHLnKsHR/o=; b=f5Ea4/uBaH9S9rXNe91wfbhLgup5S/IZgezkQntRTdsBe3+AAaxsj8QNXpb3l5RJrONTIA KyJIXaZXvj+yQA2ffMMlDMQjo1QEQF88nltTuXDc2fbqf0djaEyAjteCkX8UsPstVO9319 0xaF8KXAwSqn27Jwd7IkMEPZ8aGjMB4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718909337; a=rsa-sha256; cv=none; b=zpivmxmhNLvRnbIAhq8jn+QBSNOKAnsJzXSrgVPYC1jYNG3e1UaABdzdYvQAbZ+pJVRKra 2PVdZ2z/8xZJ+giEwFamM7MDou3DHKWmhuOYfvBUsYy1ekeCrd9MZBuHhuGuXrkA9Oi5Rq 3V/6d22i69NM7qIsI8K24T1KAFLC45A= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=rkxK3y+i; spf=pass (imf17.hostedemail.com: domain of 3oXl0ZggKCKAJIAQIYANGOOGLE.COMLINUX-MMKVACK.ORG@flex--jiaqiyan.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3oXl0ZggKCKAJIAQIYANGOOGLE.COMLINUX-MMKVACK.ORG@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62d054b1ceeso21485987b3.2 for ; Thu, 20 Jun 2024 11:49:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718909346; x=1719514146; 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=TWFrrNyw1Nab21+ugVhetla5erwSeVLyLbHLnKsHR/o=; b=rkxK3y+i3nCyu0piNvh9r70YcfkqDgepZuz8z/ldado2c8ZG/t4WF7BMnpkgbO8xB9 MGePCP98ShOzrsGi7waAtTzvVhSKYBDRtA77rLu9ncfUlvwg+MsGipVxJda6V5RDp1a+ 0tBgd6PyVU2Vggvmiuglwvt68OYzTPnzjJp20bVidF/qRY4O1ZK0QXZla288rJo1EMxA QPM9pfRWBRzQkURvemAHeqkDrNkkUuW7sOVxMGdjdj4Rvwby/Er2H1/V5RDdj4ky9kfE ZQ+W6ZqIdgl/2dz7Eq+g0ggfH2x0D/kRKIqsTUMVwOcQzUozsjx003KWWiilszucOyLS oOig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718909346; x=1719514146; 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=TWFrrNyw1Nab21+ugVhetla5erwSeVLyLbHLnKsHR/o=; b=Pkb+apeEuMx3NVre9opisVrvFZmHAHIlG6ouSHyT1cSCudW0IY5aewfU9iJy7rdE6A H39p18LpeY3ZLkXfQYJPxtTmTpOpciRgSUXdW3LL/iYiErKjcUcyfzTc5/evTYBgtg8d Rdk2UNs1KA9SBRZiwXdSvHmylDSZXFF8Zx12lbYI2SugPIQ0uyUd+2xfAk0eB/NFk0Ed nrec/AxQ1wi3dOprYwnvIASn7cacUbWfJH6zpAauvhMytSbs43805ZRaQNO66jGlG5Lq 7nB2hBw31/Gny+F8kk5A/RCN3Zp5KVyPe11SCkgtGj7ntozZfJzCqeDwmNhUxBYgyA/E oYsw== X-Forwarded-Encrypted: i=1; AJvYcCVx77h4ETv7nqMIFctSiodOjv4YAu+uqXGylETB/jz+tVwWI+ApHTIep6Dr0nqfhE3ORlYp1kWN87cqq6yMKt4AuZU= X-Gm-Message-State: AOJu0Yx7ldJT81kSSNrguQTimSmg05MtBa7qIH4NKdxy6uH7YmhnaNZ2 Y7hcXZ95IiQaCUEKI5Rz9OCNDgxFFMXwFbypI3OYuJ4cpRD116ejs/0TQTJEPP7OKpD9zw5YeQP Lk7rUasbQrg== X-Google-Smtp-Source: AGHT+IFRbsaa5YhIAN16G6oBhNsiWnJskLxaqW20TQItpx0rD0HFxamnsxbmBDl6kbfy5DURgNKiHDq5P351hA== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a05:6902:154e:b0:e02:b093:dc1f with SMTP id 3f1490d57ef6-e02be0f2578mr634179276.1.1718909345902; Thu, 20 Jun 2024 11:49:05 -0700 (PDT) Date: Thu, 20 Jun 2024 18:48:56 +0000 In-Reply-To: <20240620184856.600717-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240620184856.600717-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240620184856.600717-5-jiaqiyan@google.com> Subject: [PATCH v4 4/4] docs: mm: add enable_soft_offline sysctl From: Jiaqi Yan To: nao.horiguchi@gmail.com, linmiaohe@huawei.com, jane.chu@oracle.com, osalvador@suse.de Cc: muchun.song@linux.dev, akpm@linux-foundation.org, shuah@kernel.org, corbet@lwn.net, 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: D730840013 X-Stat-Signature: fkge8e9ibqzbkpkkqp5i9tas8w7yz6qr X-HE-Tag: 1718909346-546787 X-HE-Meta: U2FsdGVkX18ad3vGSvrvGdH/bbUmBY2no0Exa0Tl3Oahb+V3SFJd8fEpyvqt4qz4fyl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4APtsV+A2ji9J9vedS2ZHioMWnuvWlje4DtuuW9pJFTA/0PVWf7peLdQJLqs2akHMNK//WvdHKHuNt90SIPGHdneiZsXtR/Jz0W1VYhSwNyhOPpYTOxunxCmDMMjtiv3xIYLsofLeUNOuHR2KC20IoZ0dfCtgKPGQesrIeLxsxjAywktOx0DLFPi8Cd5aOuMMtK4H3i/vRd1oamJkncsGalN5t7exWSd415Ch+CYu+h3jBDyPO07HvMrgCm2QSxSqpWMvD0Sng7fgsBixiM+6dmURK0bXsLy64HP9JFk8nVtdHLubAePH4VkNeJKHNNoB03450NkOSDXKyvsaXXc4dVnbc1Hw/hsYUa7twsbdZeTBhTlfhDIJ9jT2yTLQSqlBuaLkun36DmXI+P+qhsigDmiBVauRyzAtYwWAGsJxHMZljkdg9kbXg6dCMgWbJROOT4v2+/booNQZFX17+2UsrdyjgMNdNgIP5izQB7YRV3XmkfPBJEvQJaQ== 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 --- 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 =================