From patchwork Wed Jun 26 05:08:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13712310 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 6F6B5C27C4F for ; Wed, 26 Jun 2024 05:08:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 518FC6B009B; Wed, 26 Jun 2024 01:08:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A0606B009E; Wed, 26 Jun 2024 01:08:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F39F6B009F; Wed, 26 Jun 2024 01:08:33 -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 053FC6B009B for ; Wed, 26 Jun 2024 01:08:32 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A1DA21209AE for ; Wed, 26 Jun 2024 05:08:32 +0000 (UTC) X-FDA: 82271859264.01.E3DEF41 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf13.hostedemail.com (Postfix) with ESMTP id DED092000E for ; Wed, 26 Jun 2024 05:08:30 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=tLGT8x+J; spf=pass (imf13.hostedemail.com: domain of 3TaJ7ZggKCLoonfvn3fslttlqj.htrqnsz2-rrp0fhp.twl@flex--jiaqiyan.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3TaJ7ZggKCLoonfvn3fslttlqj.htrqnsz2-rrp0fhp.twl@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=1719378490; 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=fs5YbFk0qJzpaxZmqawYh52QCdlQJr8uKPRepM7gFQs=; b=3TCy4T5ZrQb5m3CyXtmIfE3eLrmO93rb6UydilpVTIWBSx3k/Yc0Vh4Rol1fzM5UvJFIs0 5vEc/2pg4YCpa3hKdnffefbdz144eJgc0Y4Q/l7JY17HlXi0Y+0mjW1YL51kcW+RnbTD5j JQJMM6mMoFYb893YnRKMkzvf6i2Odck= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=tLGT8x+J; spf=pass (imf13.hostedemail.com: domain of 3TaJ7ZggKCLoonfvn3fslttlqj.htrqnsz2-rrp0fhp.twl@flex--jiaqiyan.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3TaJ7ZggKCLoonfvn3fslttlqj.htrqnsz2-rrp0fhp.twl@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719378490; a=rsa-sha256; cv=none; b=xumujRsbLNSDZr9BoZl5MqdPAY50GQL968Ng/iKwvPdqGJL6hJ7rye2xChFBToMxRf6vBh MOg/G1QYn68wDAN9KanwERXNzx0bZfCvvgdarYAifoUmqSFCjZ2PQN1B/ES9JABv/Q/ZAJ KkbDwDayH//Xrbr9ydokHeswN0+q3rY= Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e032d4cf26aso2115202276.3 for ; Tue, 25 Jun 2024 22:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719378510; x=1719983310; 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=fs5YbFk0qJzpaxZmqawYh52QCdlQJr8uKPRepM7gFQs=; b=tLGT8x+JAaC6/4XxD+LWHPVhnhDaxcfyEBiRcmILng4JI7RN0tc4CwXfa9zsho7tV8 KGeFwzFa5xTw+bvr82xlACiqz32oMH8EFU5Kr3AxoSvmbk1CWwrelyqi8rbioMCZ7HU9 uMG7LEimqEEPWrX/ig1WBaJk4pX4OPzVJUHTHZZ8PagpjeqNxN9xFX2P3lnJohsSbEHD si/gYy2ALA7YfEhFV5w+9hPtzKoE0wUj4DtsqZpJemoJ4mJgoudHCuQ4MpuVrR8MmNf6 RXyvCWEVtL2MCM6B4haGWEAxaEZrd6+KuH3a7cHmGM6oky9ajcrsz7hQ/2IzIwT7sroX pDsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719378510; x=1719983310; 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=fs5YbFk0qJzpaxZmqawYh52QCdlQJr8uKPRepM7gFQs=; b=OKtAaj9vI6XOSDIlIvEoDvn/V46IK6axoR5JTd8uyj6u3RgH93Rfu4ds8ZjLFysH70 4yXteDQHF+9BjaO+313rPP6sIRZnFA2GVVa7qObmZ9V96rYHHXQ6WkniIhOukvewxX7w zojVNIZqBy5nD9Dgqa5HMRSiChQpugqx3s38gB+YyoVNgqB9Vq1NfcDmFsdOD5Ur+5Ut qCCckdol2rbZsfMCZ8U7BfxIF15ho47j27VZKaoyLlYqRwTh5SXfFnaozDMYgaFfIG2L HM4E8JUV30DXNwUUeBoNh0Of66JxMrmtM7fJ2+ymUaKv3SKcG054O3CF9fDui7QHYPpO ORjg== X-Forwarded-Encrypted: i=1; AJvYcCVrfJ4AVHXdgplqRj36whTFTxbQRZu6BwC9ulTkzoSfWdeobCBNrfuZeLGG6PW/4s7yInPsFIZDgESuRGSOu1jXdO8= X-Gm-Message-State: AOJu0Yz9lkYWfcDb5OHnA7xlZCIVwMlQ87L0upvAp3IHZGKCeVgYVhbo k3WF5gNdWkCRjYwUJb6KnerorUYVV0bYMzk0oiX55aT2SNBGVDSv8+2anicv/NN43mLGFwA+k3q 1JH3gtEpnHg== X-Google-Smtp-Source: AGHT+IFbYtXNPHY4Pw0FRa6rRjfHtPjWM7CA5XFPN+LXvpcfxkrH7JF+YaAawTMCM5hKGPwKQTJAsq2tclvKYg== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a05:6902:2b0a:b0:dff:83e:b259 with SMTP id 3f1490d57ef6-e0304040464mr362430276.6.1719378509753; Tue, 25 Jun 2024 22:08:29 -0700 (PDT) Date: Wed, 26 Jun 2024 05:08:18 +0000 In-Reply-To: <20240626050818.2277273-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240626050818.2277273-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240626050818.2277273-5-jiaqiyan@google.com> Subject: [PATCH v6 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, rdunlap@infradead.org, ioworker0@gmail.com, 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: rspam06 X-Rspamd-Queue-Id: DED092000E X-Stat-Signature: iatmig4y8uf3hduinizy81ecridkkrcc X-Rspam-User: X-HE-Tag: 1719378510-791310 X-HE-Meta: U2FsdGVkX1+99E68shHPvmdfEeLIWtK8U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YY9gNRf+8VWpY8L3TpyJL/jzzXO4xVI+iyrNM/Qw7H25SygeI6kSgKf6DiImwj/Ne9YzCyxImBMq/sUTczCPgDvuqV5R3dOJtZxZ4KA5qnDT5f94F/NBigseWY1m3kwynT9NKJn4QG3J32K5KwMPbisQQcxM3nV9/2jqcx/40s5B64t113qSftZojVYaUC4uJZx3oS1uCl5/qo6q8AF9OpDJN5feq2/4orhqqLTVyw3IGUVN9Vyw3AGI6uFD81HTDqMxndeVeTSsX0SgMs1Cv1cF4FA1wsx1wOKhjdHQkUrjUKC3CnajYF2oNo6q+fxSJ+w+TPBh8BhR/l+aIYfJmmFNVBG9noaCe3+d2lwNEupI17vS9Lfy9EuxY+K9oWiC3HnTMhwZsHopun4qB/nzVWvDoMrIv3xE6+xap7eQO9n9cuZSP+EZ3wJ+Eq6besEeEer48fre1UDojpExtWvsQLimQ2ReWMuuNyoXhTtS7HrDFFyBOKU5vRhQAYABr1K/w3gUOOvziUpYOaIEHceLYdY4CzOEWvUjCeLxsdKHze7BuF3s339p8= 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 --- 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 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 =================