From patchwork Mon Jun 17 17:05:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13701092 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 AD275C27C79 for ; Mon, 17 Jun 2024 17:06:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 997A76B0250; Mon, 17 Jun 2024 13:05:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F4C56B0251; Mon, 17 Jun 2024 13:05:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7218B6B0252; Mon, 17 Jun 2024 13:05:57 -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 4B4206B0250 for ; Mon, 17 Jun 2024 13:05:57 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F2D28120DE7 for ; Mon, 17 Jun 2024 17:05:56 +0000 (UTC) X-FDA: 82241007912.05.CBFD9EA Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf30.hostedemail.com (Postfix) with ESMTP id 31EDB80002 for ; Mon, 17 Jun 2024 17:05:54 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=mM5bNwBE; spf=pass (imf30.hostedemail.com: domain of 38mxwZggKCMcwvn3vBn0t11tyr.p1zyv07A-zzx8npx.14t@flex--jiaqiyan.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=38mxwZggKCMcwvn3vBn0t11tyr.p1zyv07A-zzx8npx.14t@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=1718643951; 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=lmqa+eDYiknLWtQ9zaPVQYbfuHlo6Q/kAey0Pd/nR7w=; b=nkvGybmh+OYvRKU8w7JuqGT42ZJxzRsmU2My47yDO6igM/GF0ZL3vKxrNs7jTgm7NA5RlU TLbRTpZI51dFMkM7idBrLAp4lCNjSYZr1BQaiSjpy/o55+mTb8rMif6bmjFeOJHs9xmU6K BpvqarYw4w67DklHsVYLg5TE2qHpVfw= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=mM5bNwBE; spf=pass (imf30.hostedemail.com: domain of 38mxwZggKCMcwvn3vBn0t11tyr.p1zyv07A-zzx8npx.14t@flex--jiaqiyan.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=38mxwZggKCMcwvn3vBn0t11tyr.p1zyv07A-zzx8npx.14t@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718643951; a=rsa-sha256; cv=none; b=eCKyZNh5rTVpFgkhYjDIpXfnRQse7q0H6SAQwl456ZvmQRQ3UUTspdYYP1cmy/o44lA4iG bVtGGJhKtkWOt0z5aC4gGcSO6Ku7tir69T0cx0VkplISnV7sC0TeFhfzC27Ta4hkr8LfI6 FGD5i4zjKUGBwISdFizvCXAvAau/CPk= Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-df79945652eso9476689276.0 for ; Mon, 17 Jun 2024 10:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718643954; x=1719248754; 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=lmqa+eDYiknLWtQ9zaPVQYbfuHlo6Q/kAey0Pd/nR7w=; b=mM5bNwBEvqjKrUwVol68jX9nD1fQmnpwyVTuPiTwSfvRlMoX5Wio1o68TpZCryI6kE J4Bc/z40RfPvxH/8v62c6OkBgmqsdhhvHbONg3Yn9mST81yMKdJnCs+XFuaiqB6Eey97 le2sMXbDY/GPvDqEd4p/47YxPl//ZyE/VzFkfGbRLP9GAZ3S1hyBud4j1G3a3DZ+XGzn IOF3ZS+3sZ8wW8sarinVxNiP5WmjrMygQ1EokeKBttmsMVwkvkH2zy8/b9IowOEuYBUg OZ4iza4yhTSrZBt9H7zoW0ORKVa2cG2qU5U1uw15sxSUt7DsvHPQmDuSXwwlk3Lmmg24 UuJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718643954; x=1719248754; 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=lmqa+eDYiknLWtQ9zaPVQYbfuHlo6Q/kAey0Pd/nR7w=; b=Tl++CVYN+IABBFrTJl5fQ1+NOoFKZOke+P/h2JiuPrjmqEItKNVRXoR5g4o8wzzgBt 6I2HGzM9QzQWikXsUmfSLh29RqsIzSGtwunw/sc2hVbp6vMEih+MeTPhkmL8Zp0JAORN 0r57TBsa29DtufivDjVSiffFmK+COWhKAyLLw+RaROfRPTOv9iGTgbEQ/UEmczhG9s+7 e28x9RbdLCtmlZdajAhMS3tqjeICILfoa6yEOT3mzfE2LkGSxz2R/NX07F9P4wokqKjp R+OD+F14DcTVKYxB7fnlY9Op6xlOwcpib8nlPDvhmxLGA+DEDr1OnCT3B1dDytm1Uv1C Erag== X-Forwarded-Encrypted: i=1; AJvYcCWGfbfsUAF3oS/XO+NV40ueP47iOY2beluI1h4u0lYaSXv9CO/guQ+vVTFKs5YX+ViFY6SeaWvq10MMtVH+Bn9GRNM= X-Gm-Message-State: AOJu0YyzkPn3Tq/a9l+/2SPALL4nRAU1TWEYt/R2Talf65AUCSKkzmwF D6GnWRWJpaV5kspwMWa/ZuBaVW2LuOx+KUO9axLvQ73xioXmuZ4/ltv0rRHv++EsigmzyY7zHrf 7gSaFctwOZg== X-Google-Smtp-Source: AGHT+IHINQQBbNRf7KhELYqBt0/Q0yNW0Gm7Uiwvy1m/YHP63sxC+8TwS3fjRLwHObbkJ8tAXyAlcAdEODvV0g== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a05:6902:1007:b0:dff:7d1:33a7 with SMTP id 3f1490d57ef6-dff1552cbabmr2952019276.12.1718643954195; Mon, 17 Jun 2024 10:05:54 -0700 (PDT) Date: Mon, 17 Jun 2024 17:05:45 +0000 In-Reply-To: <20240617170545.3820912-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240617170545.3820912-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.627.g7a2c4fd464-goog Message-ID: <20240617170545.3820912-4-jiaqiyan@google.com> Subject: [PATCH v3 3/3] 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-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 31EDB80002 X-Stat-Signature: gpckdt43jc61n51tgkw1zfnj7k3z96nw X-Rspam-User: X-HE-Tag: 1718643954-574200 X-HE-Meta: U2FsdGVkX18WI4pdDznT6Fulvij/hCVBRIqc98vbO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JPX9B2XHFBINO+hMcHH6Ric0udAAVQlIjuTYlTyH+JS8/OPmqhdawVvAgPnQTVZdjDAnepm4ai4XuH6S14KbFjjO1nlIEG/hb3+qdyXTeoYfHPlUQR/D4LK06Hf776KKMi5r0epjDXowKF8YTxTecQx29xVBnEfX90GoutjNtX5EkTLLofzi5s+tErIVp1AcJK3DOKO1LAcgWG5T96DxcO/8nNW2SOORdqOqTiegcAZF65thWh+HfMAzIPsWlKc9oNP9kzssNSAf+1Uuo8O2gK+5HZAwe9nMEVqxJ5EQq2qa2JPeWo8QfxLRcig/L6vePwNy34GDibxN8xKOOY02dDYfa2pG1Iljr2QyWKdAXk15pnLsVss0Ppvlxoq653pNo2nPfm+7/TmACEMVbGdUYxfGuSFIp01ZZ8pV3k0ue6Usp9TjL6/5ZFOkGp1Nu4ofuuRtBVbr9u5nw2LjPQ5oBpL93x610hEWMcZfHmR0annJdlHlLIeGzxqGZdJMLCXhCWXtqGUHTkxiebErkdw== 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. Signed-off-by: Jiaqi Yan Acked-by: Oscar Salvador --- Documentation/admin-guide/sysctl/vm.rst | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst index e86c968a7a0e..fc62fc272fc5 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,38 @@ 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: +- If RAS Correctable Errors Collector is running, its request to soft offline + pages will fail. +- On ARM, the request to soft offline pages from GHES driver will fail. +- On PARISC, the request to soft offline pages from Page Deallocation Table + will fail. extfrag_threshold =================