From patchwork Thu Jun 20 18:48:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13706247 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 9A3AAC2BB85 for ; Thu, 20 Jun 2024 18:49:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC8408D00D2; Thu, 20 Jun 2024 14:49:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D4CAC8D00A7; Thu, 20 Jun 2024 14:49:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB5B08D00D2; Thu, 20 Jun 2024 14:49:04 -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 752FE8D00A7 for ; Thu, 20 Jun 2024 14:49:04 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1F65012043D for ; Thu, 20 Jun 2024 18:49:04 +0000 (UTC) X-FDA: 82252154208.02.1717D62 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by imf28.hostedemail.com (Postfix) with ESMTP id 46995C0017 for ; Thu, 20 Jun 2024 18:49:02 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=kMh5Vu2G; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of 3nXl0ZggKCJwFE6MEU6JCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jiaqiyan.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3nXl0ZggKCJwFE6MEU6JCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jiaqiyan.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718909334; a=rsa-sha256; cv=none; b=fyEGkjQ9PU1CsXvxBZlz+QpKeG8Q9dV3OYws3Cz2BEQmDKxVkxWw8SkYQuZsayBr7we3vQ xwt8FF8qO8FvjDXG3eO57JcEceVTZ8Xka3Rhc75AmDZPEVYXjRq16rvyf7n805I2LkT46g 5CGPEUNsOBXwHy1vPrtFBF8kqbwSLUo= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=kMh5Vu2G; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of 3nXl0ZggKCJwFE6MEU6JCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jiaqiyan.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3nXl0ZggKCJwFE6MEU6JCKKCHA.8KIHEJQT-IIGR68G.KNC@flex--jiaqiyan.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718909334; 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=1wu1wVc+3ogmDWb1QmIkKTSRvM9RrOiJDS3aYm0qmOo=; b=lfwd2Vbph6kMUPQ0XrZn3QnEGakjQYLriHXCtq+qFXimWpa/MfvrKzVK7dbdgEG+gQLnLJ JTvyaHlxPsnbrnEp+bGQu2U+q3VfoYdCebDqypABOIA58Hm6Z7u2S/Vn/BDryZfcy2q0Ro acOr1CN0bPvMxsoCdm6YHTeatPgiyRI= Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-1f66f2e4cc7so18089515ad.3 for ; Thu, 20 Jun 2024 11:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718909341; x=1719514141; 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=1wu1wVc+3ogmDWb1QmIkKTSRvM9RrOiJDS3aYm0qmOo=; b=kMh5Vu2GvSMtQRzVISpzkZkUJ+hFFiBk4ycyQZjWuq6PJaDcnJUav+769pye/vECKI MKFxXqk9YHLANKwiLkWFOpGqpucHEOTcLEy9okq7/stPhl5G8wN+Ye+a9vISfVZPjjXZ o6esNf7vlroG3ZyV5JO3zP+a+9pkta5jdvTkOiRcFY76yS3BtnGZQD2qle9SsqlaiAsG 948pl9XZ724wqkCXNxJacp1yrY6qwuXj3zic21wW445dr26Ros5NF2ayl+d+m2yrQG0g CGQjpNULQYMZo6OSeladIj8OyVDBWqXNeq2ucMmI3dH7iAbHAQ8zkmWRjf+IhMbgVZ5P 6h5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718909341; x=1719514141; 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=1wu1wVc+3ogmDWb1QmIkKTSRvM9RrOiJDS3aYm0qmOo=; b=X1jE2Ofui4z3TtiC98HAjNfs+uNFswnCfvO/CkCuQReNd2vugwBZPee6I/1q4wXgaE UHSgTqZocL15tXLPORpHVa9hIeaZHJ+hhpcj9nhOWQHKyrjaf6NCD7mPsiGM1SEigx8t Dl0OJtgXEZ4Wzg9gZWvUqxrqokPWGiVyAMwJLdUNHCptTAOj7o1AgZZ4ewuAuDJRjHen 7SZn12M5UmxVyyAo3AbNaniIpWJXLQrVerEABfOpibF+NHaGHlTWlVGv7x9UK8q6q38J DHi5qVd2gNhyKp4oOM35MIt47TCn5Ij8wazsllaxLEb4ruFT3qSQEAoj61xpbZhcCt+T QSWw== X-Forwarded-Encrypted: i=1; AJvYcCU+I2wzpKSmwxV0BvGybahhwyl7xYmgHI5HTjjM24Cqp3WdszI0TaEU7KS+FPJaJsjx+w2R0Enej7x5wPFZ/KIYteQ= X-Gm-Message-State: AOJu0YwsMTFp378kXG2124pxZnC4Sdqosw409msV6e/Jf3D7hSx+GmHQ 9UzpDS8VTEwJIwa+tVHS6+7TrHgbUMJuRK04FxVlZ8NPDI6meEXjOv22LT3b6kR5hrQ/Hot6iz6 08YZNiTlFhQ== X-Google-Smtp-Source: AGHT+IEjuzQzaeOO0XPvpr1aZfzic9vLyfJJ9ryfPTpvci6d1NFaBB/sikXz1OAKxDRDMP415k8OVyAsWAiWxg== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:903:110d:b0:1f6:77fc:c576 with SMTP id d9443c01a7336-1f9aa39e4a8mr4906245ad.1.1718909341152; Thu, 20 Jun 2024 11:49:01 -0700 (PDT) Date: Thu, 20 Jun 2024 18:48:53 +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-2-jiaqiyan@google.com> Subject: [PATCH v4 1/4] mm/memory-failure: refactor log format in soft offline code 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-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 46995C0017 X-Stat-Signature: csqnwsmkd6mo4uqxzxpe7xubw1cycce4 X-Rspam-User: X-HE-Tag: 1718909342-473059 X-HE-Meta: U2FsdGVkX19kAH8qFaWuVZsFWNfvhDvikn6DWgANELbUKe9+G7Ro/minowJW52ie9CFby7cYz6PYFNk5m2pcwjfPv+08OpkdaCMpeZamMA1/mIsJGEkfgumqtgtWm5Gn9nFwv3L4Mkg9myaBI3dN2j+mk0I48ckyFnL4DfxdN2Cql69IOVlpVR29uJ7OhJgux46vHvlx68sHxn9g2L6qgnyBlxaWVue2IcvIZyH1i1+kStJAwjOaX2glepdWwNcMx9MOShNdDiT9tQmAtMTstXvBuRhPdoF5s32ztTLaie1W3srba/80aGF2NR8nK7uRd8XVeoA2hmZd1MFMLBif44thvBejmFZqmTGPgWjvBGdZyadHFxFpzF5DLDphFgZAnZzq2QAZdj46jVPxuoxtt2tzyiIeQ4a9f0dMzadRsHcz+9AF8pJdCPY25sjq3DW7l+uVAEqvJ9+NSRsafB7fZgVefNuQ7hMJ71S8qwvTTZwa4b8kiiLN70HJcHFJ9O6OoB3uCKbyMXuOx36dyMCIGKBXMqb6Nzu51uYf/bkYWlU/ePwbi9zv/5jzJ5t/JltTVpPoIz4GXSI8hdeanx3oFVVQ2r6cJjFa94X/Do5iP531u4+F+0fBQ4sWVgbgItcVT1yg1LuUvOg/kPqNNJD7RnTZsnqxTGSzwltdaqobRG5cd2T5Ececgmgov1+xQq377eIAO0kpI1BrWWlvTUiJyr/+AtCSRNT+Gn1e09c150pvpKlLYq6Wl/lBnGepfNzhvS51oFgP0X6oRjQWjka8pbWAmPVaX7zQ0s9PK14m2o0I9KoGeJettaFTHRoKLq4OxTuC4akcGSgIQkrR7x6kRaGuD8bH9u5N87zvhNPKa7FGW7kF1TC5/fAp4YbA7q3Hu8OWc77ItkdoBfgQCOGKFaVs2SyE1x5yrltdWhfaJjNmZFVi4PXIyd47hZgs5gM67XMQot0z3j79Lw52SI7 glUdd6Ea Drw/zm275Y+VeqIUcByO97A43SyoJk7dhs/q9IRkcY3onYMFES5OllopOfrzYJX/kC4L0QBKjEjjpO/T/1S8BjklhiaFZISa53FZRZAuWkEsy2H8xOR2Nj9mcTuyjZjwrXdfk5Q2G54VpN686qlJz2GAJzJbQeMLzWF2ohxLRB40x8mbI9DIwDSWkK74OXyj2igFCN84RZsimvJg3sGHycShkKBkokx579chzn7WVit8CgrwdgkjboWjPyzs6dNpmKj9fGGuH9r1AL+33RZApDlYXeQ0COG/LmrB5yUezgZ56ucON3iin0N9gN85+SWKGhZxphEQOFSLUwV4KyLvem3jkMTyCM5SK4kZUaWQ+Jb6vbdt5Tvv+deWxvJofs0KMmuLdvzHKVNu2yN2Lz7bhse5gQu1kvMfOG9VUjG57C2pkMOO0fUcBNUFAU394TXcYeUkx2UeidbhChwLjRCocb22c16gDmH5Gw2KxLXn08AdLJRVwRzWBMjh9lU6edlTYWFlyvaADAnzkSIO9Q4OGa+edCUZR5IDWkr+6uQxLJFumhglML78HN7BTRlp82XwBQaarU4SEiMQS6gmYlXx7RM6i0VZzlfh0ruLU 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: Logs from soft_offline_page and soft_offline_in_use_page have different formats than majority of the memory failure code: "Memory failure: 0x${pfn}: ${lower_case_message}" Convert them to the following format: "Soft offline: 0x${pfn}: ${lower_case_message}" No functional change in this commit. Signed-off-by: Jiaqi Yan Acked-by: Miaohe Lin --- mm/memory-failure.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index d3c830e817e3..2a097af7da0e 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2631,6 +2631,9 @@ int unpoison_memory(unsigned long pfn) } EXPORT_SYMBOL(unpoison_memory); +#undef pr_fmt +#define pr_fmt(fmt) "Soft offline: " fmt + static bool mf_isolate_folio(struct folio *folio, struct list_head *pagelist) { bool isolated = false; @@ -2686,7 +2689,7 @@ static int soft_offline_in_use_page(struct page *page) if (!huge && folio_test_large(folio)) { if (try_to_split_thp_page(page)) { - pr_info("soft offline: %#lx: thp split failed\n", pfn); + pr_info("%#lx: thp split failed\n", pfn); return -EBUSY; } folio = page_folio(page); @@ -2698,7 +2701,7 @@ static int soft_offline_in_use_page(struct page *page) if (PageHWPoison(page)) { folio_unlock(folio); folio_put(folio); - pr_info("soft offline: %#lx page already poisoned\n", pfn); + pr_info("%#lx page already poisoned\n", pfn); return 0; } @@ -2711,7 +2714,7 @@ static int soft_offline_in_use_page(struct page *page) folio_unlock(folio); if (ret) { - pr_info("soft_offline: %#lx: invalidated\n", pfn); + pr_info("%#lx: invalidated\n", pfn); page_handle_poison(page, false, true); return 0; } @@ -2728,13 +2731,13 @@ static int soft_offline_in_use_page(struct page *page) if (!list_empty(&pagelist)) putback_movable_pages(&pagelist); - pr_info("soft offline: %#lx: %s migration failed %ld, type %pGp\n", + pr_info("%#lx: %s migration failed %ld, type %pGp\n", pfn, msg_page[huge], ret, &page->flags); if (ret > 0) ret = -EBUSY; } } else { - pr_info("soft offline: %#lx: %s isolation failed, page count %d, type %pGp\n", + pr_info("%#lx: %s isolation failed, page count %d, type %pGp\n", pfn, msg_page[huge], page_count(page), &page->flags); ret = -EBUSY; } @@ -2786,7 +2789,7 @@ int soft_offline_page(unsigned long pfn, int flags) mutex_lock(&mf_mutex); if (PageHWPoison(page)) { - pr_info("%s: %#lx page already poisoned\n", __func__, pfn); + pr_info("%#lx: page already poisoned\n", pfn); put_ref_page(pfn, flags); mutex_unlock(&mf_mutex); return 0; From patchwork Thu Jun 20 18:48:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13706249 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 13EB3C2BA1A for ; Thu, 20 Jun 2024 18:49:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB8678D00D3; Thu, 20 Jun 2024 14:49:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A413F8D00A7; Thu, 20 Jun 2024 14:49:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 81FC48D00D3; Thu, 20 Jun 2024 14:49:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 601E68D00A7 for ; Thu, 20 Jun 2024 14:49:06 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D1DD91C08B6 for ; Thu, 20 Jun 2024 18:49:05 +0000 (UTC) X-FDA: 82252154250.15.1D7B1C6 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) by imf09.hostedemail.com (Postfix) with ESMTP id 05D09140014 for ; Thu, 20 Jun 2024 18:49:03 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=YFB9cSo5; spf=pass (imf09.hostedemail.com: domain of 3nnl0ZggKCJ0GF7NFV7KDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--jiaqiyan.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=3nnl0ZggKCJ0GF7NFV7KDLLDIB.9LJIFKRU-JJHS79H.LOD@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=1718909335; 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=2HH+9CcttK5GdfJZnghTUQdGY7/vHW0gb5YShHVqiKQ=; b=E5KDWF2ptqE6Al81KQ5DKIug9hptX+MbIhDuqjO/1+hNRTVNFJC5kNlnRvyzZ3PKi1lUvJ Cu5Pypb0XUSWvEmv/0otNuMC9c4ryPsEyrTIpB7JW9qCMb1KF5IEDMDg6oI5kvQzYz9xk/ 93ELxk9VqKbHXpUQqfFEnluoenjPCeY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718909335; a=rsa-sha256; cv=none; b=IbmIzgKoVBSDD2Xx+/ZtR3lLTB0Y/1EADmQF59X3rDv2rZmlIAjiZET9vBli4Y4m7u4Jst TZuXSYVGOb2SfXpf7KqCkFtWIsy8p9VTMW1Vdz5xl/hak4BvcLpXZpOqVnF2TvdOfQGJnn yEb2/cXJmkSgonVrxGEfQyAbkxeUx4w= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=YFB9cSo5; spf=pass (imf09.hostedemail.com: domain of 3nnl0ZggKCJ0GF7NFV7KDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--jiaqiyan.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=3nnl0ZggKCJ0GF7NFV7KDLLDIB.9LJIFKRU-JJHS79H.LOD@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-6c9b5e3dd67so1119177a12.0 for ; Thu, 20 Jun 2024 11:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718909343; x=1719514143; 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=2HH+9CcttK5GdfJZnghTUQdGY7/vHW0gb5YShHVqiKQ=; b=YFB9cSo5JyE4EC3cbBvhu5UK5w8lz9auEnZdVCHeXWURZR5MVgQbgwXMFopqTKs1NJ v2yQEFqWBqp4jbmbIwRp/6h7bINuU0BR0tL8x3xjIyQpgNm/vCJTpD3qxLjt/C59n86f b0kqgal23ZMuoqqx5iVQf+buhS9YFxduWBtLJJ1uyDKKmJ3Ds5s6Q+Vyfz+Ulq900Cvw PmryFvivPs+eONDydqKNgw2l8Ori8ZJOJr9wtM6fDRq526J8M1Rv//BcjUcp7Wbp3i7i DYCZny3sh2he1NHU916Qax3zESNbJdBdZ0iGmoJxMg1/l5kH62sHedzgsQRBNlcAFcM7 nFtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718909343; x=1719514143; 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=2HH+9CcttK5GdfJZnghTUQdGY7/vHW0gb5YShHVqiKQ=; b=JXD7N5Wz+kwgHLVqAjNeCCykhYnxMNmW1BoRMYy7AwOD2G2ig4D8jv4pXamSEzqank doOWJJZYzGy2f/2nfjQMWRP/wAQbSQ0hwocjlS/5JZSYJwxacBXHEW0/X8IEbqc3tFBQ MypnOy1ow2vOj2oQb2YwZhM+BXVsY8yj/oHPhzuhACld5MteZdvEElLF1rApi5fbNR1I pEUrwN2IGbgxU3XwW+NL5VovaCyy5sP5orocCTpkxPaim/Hepu2qmtcdp2KMwPlJKuoG Bvo42PiRY3Qo98O2Nl7ZczF/9EqdZiS7j1A36LOShPN2/TacoJtl4+MTjkDU2asTqZGu wTtg== X-Forwarded-Encrypted: i=1; AJvYcCVtg96PVdjalnuxW4bkgdtTL5uAZncGgEEkHI4nF7suSTDzoVbT/6RSQCAK2MxFgYDYmQOGaV4t4jj6rB1HwaS3MHY= X-Gm-Message-State: AOJu0YzrT/ANyRMekeadoawFvprt+kJuX1AiIFmCz53FklMsYqms17Wo 8I2EpzejcSyH43ttdiQlGhgSzRElbsgHC6URs5rVbY2eWKi4bu9AK744ObRZ6iYYKt+FglgeqLg YPxCx1ImDoA== X-Google-Smtp-Source: AGHT+IHCsKQY1SzbhPGtb+37q7POGRig59xntnButnizlbSZlNSEHkAssfeNabPHgq9LHWi5d8wkBGQwyLwzZA== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:903:124c:b0:1f6:ee9e:f602 with SMTP id d9443c01a7336-1f9aa3cd264mr166835ad.4.1718909342518; Thu, 20 Jun 2024 11:49:02 -0700 (PDT) Date: Thu, 20 Jun 2024 18:48:54 +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-3-jiaqiyan@google.com> Subject: [PATCH v4 2/4] mm/memory-failure: userspace controls soft-offlining pages 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-Rspamd-Queue-Id: 05D09140014 X-Stat-Signature: 914zo1xa1u79rni4umh8intmu6szqh66 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1718909343-435959 X-HE-Meta: U2FsdGVkX1/pcZADLlB3qhf/xF7xEAffkb/tvImuosecZIt+hJzquAqiu/R5175ldXZVttTbTr5I3ODosQg1IBDTyR+ErMnwiMYq/Q/WxYHKM/sj1QUeZpqloYrYZhc8jIhnFJlaX5HwFrd1nIfrO88IdaLgJi9dTojacGdgE5XW9BDKcWAanRNCeTS2tCG3eK7qZuH6+3rKei3fNWdyt597z9Qv6rURP1P/HrzXW/Fg30/snE9JDIjdDb8dZKimo82QZKKSRRvv1cmwgTNMVX1SQY/h4L875U3lPKEeAAyYd4TwpkxODtBCWucZ/MWkGxnePX2HnGF+dmU1Bnm3pRiuQb4Kr6AUH2Orfm7hw6xgDcRRjwSaXnSDe8xoZWPYxM4AbeRWRyOLLJQqZkHyBPjJGsmNeN5PlFHfQytKxo48TuB09vCnF9tkoV1t8XIxt+5358kLlk+Ery+M0GzCsnt040+AsEZaqo66npSap7JRk71a3ikZeoEvbUXoN7LKfXIFsKMlpVcf30jDBJ8pxAvA0EsfQjIrj58Ts3fczSKMU50zMkTmKSQaL8ghsclc2c2fNVF9+2Ba0nZnjeCr0qNd+S4fBxaqzZtEINdsmm6kfNeT2Ff8funnXflv4oVR0Bo0y2MO8q3FpV7lbIoiANGzDg+ke+C5aX3e5t9646zlkI+h+J7guQaSAEksflkLMDZKAOMdUhEV4J8lqEPOjZ9mUda6GdnuQAhHoyBu/dJRBagjYg+pYxtOAvNOLjZyWKOhcgLwVtQgPPOExQ0KtW6zkAXzuRwFriIpq5In9mQlJBTpjFc7PHYNL68SFhv2m+pC11BbFFHBe5Jb04Q60vA3j9ZUINDMCJ8TKQAfEZ+DhEwRLs4qdP4nWcBkcW7PHiCWa3jpY1+tNTCigS4GaUU3DKWWS8A+63EYBzQKWS2aA6LyVTushqKbnMUPJ2whNAssOZRQs3gus1pS4CM m8dzzov0 yj8STpWN/cVjkWhd4IP8Yz+GgLKOcNop9xQx5obGihVoGWFP5972AURjoIwnks4QjhUr6YdkILvWuRdIFs9QL1TsoZ7LfPrrWGsWvmhatrNTpWQ6+GQ5xceJTESIpBuXDqyBy7DpIMjwvlcO5PeTNRcqdGIw1ZfE1b+cEC7t8uuzH31YqH9tGdarYvOlmRutvbegMYlJCdNYQhLkhfYDYW5DeS49Whz34hmxIEkJRWQHM3zNSstnYAFZO7sQA/xAWTI1kxxgBFPyqm2a5QawmWrGB7ZZ+zj8vTcNbdAA9nNzH9czNmpkmXxMsT7SVROrlxDRVubYbDMn6KsuWokU2yO3gIRMujYGkzrjYi5h+o+9m2LWtMNXUtSvAH7UH4rQEUqJ0prYkqzMl+V+k882Z23JBspqdgtKzI/XzXUFXotq5mrJUw3B61tb276EdKKSt2WJ0cN+eZGRYiMkE9bpY+U+Jp06A56lsYeQlNgXdMwOF+EUeMm7/O1nZRjU6d2++/15BFWvrsfyl2zND2kykDjzsryRKlrnMxb1jYYgOaHMcW362U3s0HGiRqQTGLTvLc2lY6Kcc0h7NTy4dlD//bdMSw7tuD6YzumOB 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: Correctable memory errors are very common on servers with large amount of memory, and are corrected by ECC. Soft offline is kernel's additional recovery handling for memory pages having (excessive) corrected memory errors. Impacted page is migrated to a healthy page if inuse; the original page is discarded for any future use. The actual policy on whether (and when) to soft offline should be maintained by userspace, especially in case of an 1G HugeTLB page. Soft-offline dissolves the HugeTLB page, either in-use or free, into chunks of 4K pages, reducing HugeTLB pool capacity by 1 hugepage. If userspace has not acknowledged such behavior, it may be surprised when later failed to mmap hugepages due to lack of hugepages. In case of a transparent hugepage, it will be split into 4K pages as well; userspace will stop enjoying the transparent performance. In addition, discarding the entire 1G HugeTLB page only because of corrected memory errors sounds very costly and kernel better not doing under the hood. But today there are at least 2 such cases doing so: 1. when GHES driver sees both GHES_SEV_CORRECTED and CPER_SEC_ERROR_THRESHOLD_EXCEEDED after parsing CPER. 2. RAS Correctable Errors Collector counts correctable errors per PFN and when the counter for a PFN reaches threshold In both cases, userspace has no control of the soft offline performed by kernel's memory failure recovery. This commit gives userspace the control of softofflining any page: kernel only soft offlines raw page / transparent hugepage / HugeTLB hugepage if userspace has agreed to. The interface to userspace is a new sysctl at /proc/sys/vm/enable_soft_offline. By default its value is set to 1 to preserve existing behavior in kernel. When set to 0, soft-offline (e.g. MADV_SOFT_OFFLINE) will fail with EOPNOTSUPP. Signed-off-by: Jiaqi Yan Acked-by: Miaohe Lin --- mm/memory-failure.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 2a097af7da0e..623aa93aff5a 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -68,6 +68,8 @@ static int sysctl_memory_failure_early_kill __read_mostly; static int sysctl_memory_failure_recovery __read_mostly = 1; +static int sysctl_enable_soft_offline __read_mostly = 1; + atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0); static bool hw_memory_failure __read_mostly = false; @@ -141,6 +143,15 @@ static struct ctl_table memory_failure_table[] = { .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, }, + { + .procname = "enable_soft_offline", + .data = &sysctl_enable_soft_offline, + .maxlen = sizeof(sysctl_enable_soft_offline), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE, + } }; /* @@ -2749,8 +2760,9 @@ static int soft_offline_in_use_page(struct page *page) * @pfn: pfn to soft-offline * @flags: flags. Same as memory_failure(). * - * Returns 0 on success - * -EOPNOTSUPP for hwpoison_filter() filtered the error event + * Returns 0 on success, + * -EOPNOTSUPP for hwpoison_filter() filtered the error event, + * -EOPNOTSUPP if disabled by /proc/sys/vm/enable_soft_offline, * < 0 otherwise negated errno. * * Soft offline a page, by migration or invalidation, @@ -2786,6 +2798,13 @@ int soft_offline_page(unsigned long pfn, int flags) return -EIO; } + if (!sysctl_enable_soft_offline) { + pr_info_once("%#lx: disabled by /proc/sys/vm/enable_soft_offline\n", + pfn); + put_ref_page(pfn, flags); + return -EOPNOTSUPP; + } + mutex_lock(&mf_mutex); if (PageHWPoison(page)) { From patchwork Thu Jun 20 18:48:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13706250 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 157B9C27C79 for ; Thu, 20 Jun 2024 18:49:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A45668D00D4; Thu, 20 Jun 2024 14:49:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CBE48D00A7; Thu, 20 Jun 2024 14:49:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75C158D00D4; Thu, 20 Jun 2024 14:49:07 -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 51A368D00A7 for ; Thu, 20 Jun 2024 14:49:07 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 19EBC1C0CCC for ; Thu, 20 Jun 2024 18:49:07 +0000 (UTC) X-FDA: 82252154334.21.23E9593 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf20.hostedemail.com (Postfix) with ESMTP id 4D2D41C0013 for ; Thu, 20 Jun 2024 18:49:05 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=IVI7hklN; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of 3oHl0ZggKCJ8IH9PHX9MFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--jiaqiyan.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3oHl0ZggKCJ8IH9PHX9MFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--jiaqiyan.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718909334; 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=GluUuYGnYPAXtY8McTJbn0uUkSxMlhx0gcn6TfPCvPM=; b=eZNic+GcVux1QL62957YzWPwWerjKVsZTf4ALM74Bhjj5TKjT7UVa9TYM+8Ckeh0r0HPlY Pw8zQOl4T3Du4QcXjsMfoYBzYN0rg4AoxlFjby5eLOsefmL7tgEqbD5b/2TSCBPdku2HGX cJ3YqPFng9sEGRnfK1eHKQ3ClcO8Vgo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718909334; a=rsa-sha256; cv=none; b=GFBY2vNcJBlOWwETSDrouGAwN6njBInvnM7FDAac6bJMbnBbKiCW8JPk6YbDd7Tm28kOoC 8fyoXOUHbOSQwZP6qQnUMk6bIoriLCLX8EEu6cEn+Ev9/dXuJz/ahCQz/7Op7mKz3dX6l8 j96tMftjdkT4lZzJhponG+aUYPPB0WM= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=IVI7hklN; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of 3oHl0ZggKCJ8IH9PHX9MFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--jiaqiyan.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3oHl0ZggKCJ8IH9PHX9MFNNFKD.BNLKHMTW-LLJU9BJ.NQF@flex--jiaqiyan.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-63bab20bf5fso24434877b3.0 for ; Thu, 20 Jun 2024 11:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718909344; x=1719514144; 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=GluUuYGnYPAXtY8McTJbn0uUkSxMlhx0gcn6TfPCvPM=; b=IVI7hklNCOJstsePvic/1uItRxmGXhONAQQ9WOpMjRA+GKdMFHXf7am9siRdaZghrN zR/zywA0Yif/4ZCJy9VyQOflwh9v45cCgf3Nhw7HG6Bixlxyh3zG7nq8JXm6z6RSHfcg HU/CbCnXaVmOpmRzxQl2tK7b6C35qM81MbhiytGAtgXhJm8S8yf6zstqNls4XzUmrqjc pYB1F0CtBR5KECzIj8rdl+J9SkkzZns6rWhLTsEL/59mltEulELxx2iGuJJuujYI1RHL p2lOccLUH+6jqkZt+YjubzKBUBSBPn0G9EL5aC4L2CujYTpBPNA1BiKFjMAHo+wM05r1 9yUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718909344; x=1719514144; 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=GluUuYGnYPAXtY8McTJbn0uUkSxMlhx0gcn6TfPCvPM=; b=VSDuguHEPbIHOEatHRbO7RIgpvhaipWiL5fGNZl9UU2PCR+qI0WT6IgXS8IgQsf+j+ KemAFcRqbmmmvuCdN2W97isOvljF0cyxeCyhI9p7w/OKPRnfFlGe3iU3suHbcK/8WgI1 YG2qK3Kxtn4h4ZKdIQ6NjRKV/xlBowBsNmK/dOZHxQW2ASNhklLqFI/FJU+i40lC0rU4 Z7K6+rC8XUGZzNWeF1fFRsamHFiqxqZNYdV91nnV+F3+8SUxTB7kgxY1qUzjEjtZp58D 95I8HPN6sVj9qWSHIZXqD5eKBPAB1Ht4AGduMsSpt9GzOX40kOv2YZsoNFTaMVag5NPj BtGw== X-Forwarded-Encrypted: i=1; AJvYcCV6Uqf+W/3eWqFj7mBqJ+2qb1z8FJxbkxlPxLUdBcrYmLfvfaEcCWv52A/eUkH8fdH0l50HUe9NQOkU0HfAPjAui8U= X-Gm-Message-State: AOJu0YxGBatv586dB+DX5uUaEzydXddcIPNMrATf5ovjY43hoRPSKcPq t0txRJ1drR//vWn8j+Q3tIlmb1jnHqjGX3BqLclQDGktkVds3LcXoahlNTKBj4Q9B0mEIoz5Ga8 +MJAJnSQRUg== X-Google-Smtp-Source: AGHT+IH1H+EEho9ZhLrcfQe/2XQyLnmAe5O5gbj7AWpcOeZHKlVhg5MrlWvruN4X+wKm4dHo2f19KpMHsWqWLQ== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a05:690c:4b06:b0:62a:564d:aed1 with SMTP id 00721157ae682-63a8f9fa0d5mr11257047b3.8.1718909344302; Thu, 20 Jun 2024 11:49:04 -0700 (PDT) Date: Thu, 20 Jun 2024 18:48:55 +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-4-jiaqiyan@google.com> Subject: [PATCH v4 3/4] selftest/mm: test enable_soft_offline behaviors 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-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 4D2D41C0013 X-Stat-Signature: bdy4gc148y3ukrbf5c55qqyx4ife5qxi X-Rspam-User: X-HE-Tag: 1718909345-772713 X-HE-Meta: U2FsdGVkX1/Fad7cSw9Yj5Oz8FSOZdCijwEieHFI3QlxZOnraGZ+6LtV4vQ89PhhECq2vVLAmPa8+WS/jYHJgZCiGJ/H2TFH7efKRJBUv/jIslthdr3u437RbrMSsQdn0ycb/HY44W66Gy/IoU0TseWydDH2hTfZizz9jR9X6wV5dlkAQ09KpRehEysW2NFZvMXPHwNfMiYpQusqbY2TPrhlHShIeABoHzDn3DE2Znh2DGhqGtCFNLb46fUo35049ulDyqHJrdWTj/7IMrPKZEC1SIc+QOp2WWrCuV9IA7oPMagpWWTs8D0DUyshPsnJJCC7ItO89qWjPyIYExu1snf8jydupN7Bm3nXtWE3yRQC1bSPKF8zwkZo5msoUmi3ZFajX1wT/5t42JGpWy2PizcM1HIsDJk2iLDKm1Hnbi0LUemYkDHsIsHqKmeKc8O7/d0lzuZyAcFjuLFZqXn3Zt8vFCGyN6LxlWs85NIhyEo8upbL4EyI1JzQmzUq4dwzVsbaEMmvISkbNwcrsnwMNPOAWRJsQXw23d7edoNZmSBACnpDeWItI4jiWE6InEqmc7+dncmvvCQIsUdB61TIChj451CrQR71kOJcmKJrHekZc2jvujs7wMKhfJz3+4ugguc7nWfDNdRtgtfBGMfT47uAcO6LhYiNNUKrMEFsNqT+pA8tmuIRrGv04OFUZleHg4Fs8IKteUt04at3ebbUnXPfSSYn03RdKLvbCweKLOZevaQQV9cnmdVM0bDrgmZD5ZvZHCLmcbFJRZnvhLIIl1st78l9jG5Qqj+WYW7nCJve4Q7ygah/g0y3w0c8wYo7Sv9qXlT9HW/YvTYg3hH2pqbQd3/5kkJbFqShza6T9KWTTTmkKv/AyHlhdW54FUOEPAyIM2k2LPk+E3WFeSdalWKkgpuzEpc72sSIXbaov830FkXrQUqnLWAosCiyZN9rQ6EvB5BcI12LeTmj7Fk A4eJpvDi ucreoLFMO9Dz8n3+gU0AAlYSIMq86DBVqXCIaDhEACw1IZsH4vf/T0ZM85vNAA9mKo8QCsL3yMhwkpMeCs2nIAfrx90+jVPRfMTi9THNZHcJvcFZdFa+aE8/kEC3isCbtMD4DNIJmCjsIaFNj44gH7nz9cCrJqZzwstvSXFPV4XW9ooeQUyRKJvGRruDA413k6+APQ4+BOb25CB+XzZubdp6N+V+WGjHPvO/QodeZAa6BwxhHRKaH3d6BLQHhJcljBKALRa8Oz0pyDDfSUdP2vRHBzHUl0zw7vFJUS09mj6HZ98sEk24yzHqyvo+8MFVSvpwO8FGQr8cRik+du7Je+6WLOVexy6znuS90FLietMn1uoU8/5RQuFa7w6yQ6gi7oexYXID+Af00VgI6pWLuuv0oBP6qZDCUryva3tBNUWcJ5pHd8OzsWntBFcrSUN3TqBU9c9GdNGBoCdsQywG0E7uaoKYAicnX29ojTqNoyCLdy8N++NlL1OaV2TyWtTWWVFGjgXLjdJhiQu9HkDlq2+FSd3j6W5uvVkMwHp0lDHe8OfHOADSO18oKZA8wcGrqV80RFT38HvwSiSVku7e7kMPl1xUOpQrFXCcJI+ZxTDaDvJCUIdRwyvRg+CQA/kBaPmhnbo1odi8le6sTUgiIibhpeA== 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 regression and new tests when hugepage has correctable memory errors, and how userspace wants to deal with it: * if enable_soft_offline=1, mapped hugepage is soft offlined * if enable_soft_offline=0, mapped hugepage is intact Free hugepages case is not explicitly covered by the tests. Hugepage having corrected memory errors is emulated with MADV_SOFT_OFFLINE. Signed-off-by: Jiaqi Yan --- tools/testing/selftests/mm/.gitignore | 1 + tools/testing/selftests/mm/Makefile | 1 + .../selftests/mm/hugetlb-soft-offline.c | 229 ++++++++++++++++++ tools/testing/selftests/mm/run_vmtests.sh | 4 + 4 files changed, 235 insertions(+) create mode 100644 tools/testing/selftests/mm/hugetlb-soft-offline.c diff --git a/tools/testing/selftests/mm/.gitignore b/tools/testing/selftests/mm/.gitignore index 0b9ab987601c..064e7b125643 100644 --- a/tools/testing/selftests/mm/.gitignore +++ b/tools/testing/selftests/mm/.gitignore @@ -6,6 +6,7 @@ hugepage-shm hugepage-vmemmap hugetlb-madvise hugetlb-read-hwpoison +hugetlb-soft-offline khugepaged map_hugetlb map_populate diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 3b49bc3d0a3b..d166067d75ef 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -42,6 +42,7 @@ TEST_GEN_FILES += gup_test TEST_GEN_FILES += hmm-tests TEST_GEN_FILES += hugetlb-madvise TEST_GEN_FILES += hugetlb-read-hwpoison +TEST_GEN_FILES += hugetlb-soft-offline TEST_GEN_FILES += hugepage-mmap TEST_GEN_FILES += hugepage-mremap TEST_GEN_FILES += hugepage-shm diff --git a/tools/testing/selftests/mm/hugetlb-soft-offline.c b/tools/testing/selftests/mm/hugetlb-soft-offline.c new file mode 100644 index 000000000000..5701eea4ee48 --- /dev/null +++ b/tools/testing/selftests/mm/hugetlb-soft-offline.c @@ -0,0 +1,229 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Test soft offline behavior for HugeTLB pages: + * - if enable_soft_offline = 0, hugepages should stay intact and soft + * offlining failed with EINVAL. + * - if enable_soft_offline = 1, a hugepage should be dissolved and + * nr_hugepages/free_hugepages should be reduced by 1. + * + * Before running, make sure more than 2 hugepages of default_hugepagesz + * are allocated. For example, if /proc/meminfo/Hugepagesize is 2048kB: + * echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#ifndef MADV_SOFT_OFFLINE +#define MADV_SOFT_OFFLINE 101 +#endif + +#define PREFIX " ... " +#define EPREFIX " !!! " + +enum test_status { + TEST_PASS = 0, + TEST_FAILED = 1, + // From ${ksft_skip} in run_vmtests.sh. + TEST_SKIPPED = 4, +}; + +static enum test_status do_soft_offline(int fd, size_t len, int expect_ret) +{ + char *filemap = NULL; + char *hwp_addr = NULL; + const unsigned long pagesize = getpagesize(); + int ret = 0; + enum test_status status = TEST_SKIPPED; + + if (ftruncate(fd, len) < 0) { + perror(EPREFIX "ftruncate to len failed"); + return status; + } + + filemap = mmap(NULL, len, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_POPULATE, fd, 0); + if (filemap == MAP_FAILED) { + perror(EPREFIX "mmap failed"); + goto untruncate; + } + + memset(filemap, 0xab, len); + printf(PREFIX "Allocated %#lx bytes of hugetlb pages\n", len); + + hwp_addr = filemap + len / 2; + ret = madvise(hwp_addr, pagesize, MADV_SOFT_OFFLINE); + printf(PREFIX "MADV_SOFT_OFFLINE %p ret=%d, errno=%d\n", + hwp_addr, ret, errno); + if (ret != 0) + perror(EPREFIX "madvise failed"); + + if (errno == expect_ret) + status = TEST_PASS; + else { + printf(EPREFIX "MADV_SOFT_OFFLINE should ret %d\n", expect_ret); + status = TEST_FAILED; + } + + munmap(filemap, len); +untruncate: + if (ftruncate(fd, 0) < 0) + perror(EPREFIX "ftruncate back to 0 failed"); + + return status; +} + +static int set_enable_soft_offline(int value) +{ + char cmd[256] = {0}; + FILE *cmdfile = NULL; + + if (value != 0 && value != 1) + return -EINVAL; + + sprintf(cmd, "echo %d > /proc/sys/vm/enable_soft_offline", value); + cmdfile = popen(cmd, "r"); + + if (cmdfile) + printf(PREFIX "enable_soft_offline => %d\n", value); + else { + perror(EPREFIX "failed to set enable_soft_offline"); + return errno; + } + + pclose(cmdfile); + return 0; +} + +static int read_nr_hugepages(unsigned long hugepage_size, + unsigned long *nr_hugepages) +{ + char buffer[256] = {0}; + char cmd[256] = {0}; + + sprintf(cmd, "cat /sys/kernel/mm/hugepages/hugepages-%ldkB/nr_hugepages", + hugepage_size); + FILE *cmdfile = popen(cmd, "r"); + + if (cmdfile == NULL) { + perror(EPREFIX "failed to popen nr_hugepages"); + return -1; + } + + if (!fgets(buffer, sizeof(buffer), cmdfile)) { + perror(EPREFIX "failed to read nr_hugepages"); + pclose(cmdfile); + return -1; + } + + *nr_hugepages = atoll(buffer); + pclose(cmdfile); + return 0; +} + +static int create_hugetlbfs_file(struct statfs *file_stat) +{ + int fd; + + fd = memfd_create("hugetlb_tmp", MFD_HUGETLB); + if (fd < 0) { + perror(EPREFIX "could not open hugetlbfs file"); + return -1; + } + + memset(file_stat, 0, sizeof(*file_stat)); + if (fstatfs(fd, file_stat)) { + perror(EPREFIX "fstatfs failed"); + goto close; + } + if (file_stat->f_type != HUGETLBFS_MAGIC) { + printf(EPREFIX "not hugetlbfs file\n"); + goto close; + } + + return fd; +close: + close(fd); + return -1; +} + +static enum test_status test_soft_offline_common(int enable_soft_offline) +{ + int fd; + int expect_ret = enable_soft_offline ? 0 : EOPNOTSUPP; + struct statfs file_stat; + unsigned long hugepagesize_kb = 0; + unsigned long nr_hugepages_before = 0; + unsigned long nr_hugepages_after = 0; + enum test_status status = TEST_SKIPPED; + + printf("Test soft-offline when enabled_soft_offline=%d\n", + enable_soft_offline); + + fd = create_hugetlbfs_file(&file_stat); + if (fd < 0) { + printf(EPREFIX "Failed to create hugetlbfs file\n"); + return status; + } + + hugepagesize_kb = file_stat.f_bsize / 1024; + printf(PREFIX "Hugepagesize is %ldkB\n", hugepagesize_kb); + + if (set_enable_soft_offline(enable_soft_offline)) + return TEST_FAILED; + + if (read_nr_hugepages(hugepagesize_kb, &nr_hugepages_before) != 0) + return TEST_FAILED; + + printf(PREFIX "Before MADV_SOFT_OFFLINE nr_hugepages=%ld\n", + nr_hugepages_before); + + status = do_soft_offline(fd, 2 * file_stat.f_bsize, expect_ret); + + if (read_nr_hugepages(hugepagesize_kb, &nr_hugepages_after) != 0) + return TEST_FAILED; + + printf(PREFIX "After MADV_SOFT_OFFLINE nr_hugepages=%ld\n", + nr_hugepages_after); + + if (enable_soft_offline) { + if (nr_hugepages_before != nr_hugepages_after + 1) { + printf(EPREFIX "MADV_SOFT_OFFLINE should reduced 1 hugepage\n"); + return TEST_FAILED; + } + } else { + if (nr_hugepages_before != nr_hugepages_after) { + printf(EPREFIX "MADV_SOFT_OFFLINE reduced %lu hugepages\n", + nr_hugepages_before - nr_hugepages_after); + return TEST_FAILED; + } + } + + return status; +} + +int main(void) +{ + enum test_status status; + + status = test_soft_offline_common(1); + if (status != TEST_PASS) + return status; + + status = test_soft_offline_common(0); + if (status != TEST_PASS) + return status; + + printf("Soft-offline tests all good!\n"); + return TEST_PASS; +} diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 3157204b9047..781117fac1ba 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -331,6 +331,10 @@ CATEGORY="hugetlb" run_test ./thuge-gen CATEGORY="hugetlb" run_test ./charge_reserved_hugetlb.sh -cgroup-v2 CATEGORY="hugetlb" run_test ./hugetlb_reparenting_test.sh -cgroup-v2 if $RUN_DESTRUCTIVE; then +nr_hugepages_tmp=$(cat /proc/sys/vm/nr_hugepages) +echo 8 > /proc/sys/vm/nr_hugepages +CATEGORY="hugetlb" run_test ./hugetlb-soft-offline +echo "$nr_hugepages_tmp" > /proc/sys/vm/nr_hugepages CATEGORY="hugetlb" run_test ./hugetlb-read-hwpoison fi 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+V3SFJd8fEpyvqt4qz4fylA7LhE9mhL8V13NGkBJhRHicpC3ZjctYXjBazDdVMD85+DbxCwiNmUpws8kd/BXj8GMUPsiv1Gdl9Sq+gw+L6L2htZxSsdQRsyc+wIG/HrJdaCokhs4TYFKRCaPqFEVTdYaaAI9NtVArfvjnYti3a2fdkzIhjPl26fdiMvGxJVS/6+GOobsyiF/GVnGiSEfMh+v8f/p9yobAn+ZvI2PkIxa+N4/vZ6+gGEwzss+Aj7jju+PYRARJL0l/Aom4BbtNBx0HE4aD4A76R0WZ9vpu3ZquZTA45TkGqtGEl7/pIfApjLZWbWWnjM2KGce2rQTTDPNtlD1F0IfUDc9Ptfvgne8bbo/NPiw+CXzBEc+UhgcVv8RhnS/mXcMbD7F3B18sHw0cguvSaUp2gvVGqnQRTsZG7BTIcRMbicm2t8i9s/JlednayfgfCJ5PgdKjAOb93ukFrHyQcHwHaPx7czUauNfn+Du/QnTNifYBSULM1IRXh9HP3BFa0d658fT1OHYGGToBBYTUgJnm4maCDqF1RPLL54jlqutajUXfbIGczx1h20N/Awz41P9UPEzTRP9jw3jy+U61we9QFRPsQluKPo6ESlJpCvkxDrUh7Iy8R3VLxelGbVnjgTOWXatU7ShRYrO0C/IpHt9uvNG2kcAdclb0qz20VAGNp/msbjhwz5dRA2c//58VP7zXw3AA1AAsDdzdLlDRZfQcULB7Iz4wCFzNTBRhOGqlJQYtnFC6PlB9dMz+fbztw06IvTaht+sNfeul+n0Xf4MwK3HeZlW1F/aLdERydkwYPKP2/9dH7e8+y7BRYTMPdLRQuehOYNUFqGoZfvZeYCkUuMEqUJ961GWtdryeUgi+PYe86s7fOPzh8ysOWJDj7cO6mVnx46XVKSoOgUm4DI91qt86Q sBBVc8IH jsB3hqRHGgDtbRMjDM8ZlJP6n8tQGtaI8syEuQ1bC9XzVdtLFSDmARgB5xvcI8MxDSAPubNR02wY8SZr/8JYP4OMFHGXUo1Lpft/swuK91nsZ0PuMZpJYg1v4TDF9CxXaz8ZymekI+/76SX+gH7tbXyMcrTVAII6n2p4APtsV+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 =================