From patchwork Fri Jun 28 20:59:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13716605 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 70205C2BD09 for ; Fri, 28 Jun 2024 21:00:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 847DF6B0098; Fri, 28 Jun 2024 17:00:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CCA46B009A; Fri, 28 Jun 2024 17:00:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55A616B009B; Fri, 28 Jun 2024 17:00:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2E9236B0098 for ; Fri, 28 Jun 2024 17:00:11 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D98031206BC for ; Fri, 28 Jun 2024 21:00:10 +0000 (UTC) X-FDA: 82281514980.17.F1C31AF Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) by imf07.hostedemail.com (Postfix) with ESMTP id 1710840010 for ; Fri, 28 Jun 2024 21:00:08 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=kxgToHib; spf=pass (imf07.hostedemail.com: domain of 3VyR_ZggKCNYBA2IAQ2F8GG8D6.4GEDAFMP-EECN24C.GJ8@flex--jiaqiyan.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=3VyR_ZggKCNYBA2IAQ2F8GG8D6.4GEDAFMP-EECN24C.GJ8@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=1719608394; 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=K55H9E0t59nm9KeHZLiBbB7OkhvKOcAfSENsb6p/u6w=; b=k4f0X30hHAYiapPZWIqGlFpv7IjGS0j2n25ANZYDGqktw6TpvZYVMZZSXQQLwUKi3G+Dgv d4QLXakUG2gDGA25tl0+zEE9DnnQfgTNXBTv3OjJ9TDEfu/0nU6ADDwLR8j0IYkwtUC2MW aDsYmiGStQj5sV/QVe3XAunEYBWbijc= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=kxgToHib; spf=pass (imf07.hostedemail.com: domain of 3VyR_ZggKCNYBA2IAQ2F8GG8D6.4GEDAFMP-EECN24C.GJ8@flex--jiaqiyan.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=3VyR_ZggKCNYBA2IAQ2F8GG8D6.4GEDAFMP-EECN24C.GJ8@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719608394; a=rsa-sha256; cv=none; b=czIXtarp0eNav6+y8Ge058dmOripUK6KbqMKh0WR/fmzutUsQZnpfZzzfuOUsS1KBwpc3p c5PuZqz68SWJkyGBlg+Jr/kxaA3bZ+Na9iTIqdt8SLN7T0JocorfqIl/I4+4LfvOgaOWOo vB4VTmi70USqUe9GuzvYZeN4lZzJc/Y= Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-7066693876aso902772b3a.3 for ; Fri, 28 Jun 2024 14:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719608408; x=1720213208; 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=K55H9E0t59nm9KeHZLiBbB7OkhvKOcAfSENsb6p/u6w=; b=kxgToHibns5aIEv0DDTd+gQdhJ2b116kq1eGLy4xhYUaizXa62LE4qMRYg1rwb9rwZ wPeiggHtTn1llfYB/siuCQu1Nro5II+fid2FBty+RzRqD2AFqbZujTyH3gd5oHYLm0Vr e9Y7Dtj5zNCgQcOr12vR10uhynN5gFCew/0TDF1awYK8xrO0IdLYoipb/xkUe/SwlFZa PBoE4R8F7OfadVDSEFhaIcYw0DtPyZToMifMRQ8jOBgKf4vQiqc6BPDTynWyuptltki/ errvTfsom/NdtDIhMYQKXoOZIEOSqn5xfy/Y+5n87Lm5/ZKcFsRlkGXtUsLxCnKs8IUb wzUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608408; x=1720213208; 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=K55H9E0t59nm9KeHZLiBbB7OkhvKOcAfSENsb6p/u6w=; b=DaneubHAUi7AT/utG1IpO6EFzyHlIL3RtYT8CTXur3xAa7vtQkqMOEVGmk3fW2T/Gw QuayKum0ujcUSHI1omc9xyf+IwHI4gp8iKx43HFByo4PN5I4bPlwBSNYvRuH+Ez6EYtM xyLVb/IRlVuXnOuCbkegvaioyjc1QjBKdY/pGogUp7mWXZhqeUOjQG9PaZEoaW9Eu1l4 xdioVfgORJJ2r4PrKkJ2A0eCv10MJGIwxlHLADAlzpR8lFOuesqlDWHNj3SRPrmjqX7F f3/K5hWAFaURCcI1Fdpwjiulyby0OfPMPCxCcKhcQJgAmXMUYL3S2ZhHD3bMJ8U8H1Zr ZnhA== X-Forwarded-Encrypted: i=1; AJvYcCUbtkX5S1hBnF2I/2VMHkc/mQWaCiXEkVweAKKJlikmVyL18Iv+PErI2bvBSe5yAg6L9DeZbZUbahwFjg+ONPxyR7c= X-Gm-Message-State: AOJu0YxbDJxnsIV8BPHcHfpV+d7Q04w9rBAKiP3vf/kxVPUBE9wI+fqt fgLPRJzZAMnQCOqPOeR4H61r7P7aDriIPNMnrjGoQMSl60/xAYLDkeP/VNdi4llzaxmZjJewNjl 84sX3k9F8bg== X-Google-Smtp-Source: AGHT+IFbZGpVVtA+GUKb/6c6jsaI0OiKjqock+AA+pWiWe+A5unyUwPSLs/SOm+K4zdLrXzAV8wcIH5VRSCYXg== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a05:6a00:3698:b0:706:6b52:43a7 with SMTP id d2e1a72fcca58-706746db53fmr184314b3a.3.1719608407790; Fri, 28 Jun 2024 14:00:07 -0700 (PDT) Date: Fri, 28 Jun 2024 20:59:58 +0000 In-Reply-To: <20240628205958.2845610-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240628205958.2845610-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.803.g4e1b14247a-goog Message-ID: <20240628205958.2845610-5-jiaqiyan@google.com> Subject: [PATCH v7 4/4] docs: mm: add enable_soft_offline sysctl From: Jiaqi Yan To: nao.horiguchi@gmail.com, linmiaohe@huawei.com Cc: jane.chu@oracle.com, ioworker0@gmail.com, muchun.song@linux.dev, akpm@linux-foundation.org, shuah@kernel.org, rdunlap@infradead.org, corbet@lwn.net, osalvador@suse.de, rientjes@google.com, duenwen@google.com, fvdl@google.com, ak@linux.intel.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, Jiaqi Yan X-Stat-Signature: otncubz888tyzzigpkjn1o8ojn4k5n3n X-Rspam-User: X-Rspamd-Queue-Id: 1710840010 X-Rspamd-Server: rspam02 X-HE-Tag: 1719608408-930522 X-HE-Meta: U2FsdGVkX1/XQT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Gd8ggWzbNnSYujuSyhkawMBnupns2m65q7N/KImsP0fYkUfqEPorPQetDL7G4K3meGCOc1ngJ+QJYNyeiVeH2eeNu7KUwHZodnutZpLWwK37stqmjH/7w6TkRhhd2gvRpQQbo0o0GfDwV2eagMjtRZZTfg4XhhYsaQOxzG2Qtv8UF4jgiDhmLof+XLsSJvuSKqKoQ/TybLk9KqCH++DU6tNFZqiwWatqCHJeNBqCqq/YhGAGa0dOE6OT54D/3BZTnGIZVteeTBkVh9Cy3vCqyYO9Ka6FiDtvuKqlkVqdhfe+vNMbayGr9GQYZ9sxVW0NuiiaPCS5bh/jvC2hvR2+q/bnWEbeRYNIAb+GLSG0XpAHnMXkC1HhCvy2E/kM71dYS+guZsQurvWQXfhFpNK1p6R9R5lgCF3IuRbAdFotO/ZTmmZSX02yvHTbvCKARo3HKXVKuuMjWXqn2o6Ouu5R6n8STzWqNBFwx6HCQCTRicO+lDtONBdm3nh+FpcGe6sVHqXVQustMmPmK1qf1mJvGrPBmX1yqGlbqV5dm5lnoQEZEJaBoP1kT/FS/qgMq6ask= 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 Acked-by: Miaohe Lin Signed-off-by: Jiaqi Yan Acked-by: David Rientjes --- 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..75e22137d849 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 set to 1, kernel attempts to soft offline the pages +whenever it thinks needed. When set 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 =================