From patchwork Mon Jun 24 16:33: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: 13709846 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 A4462C3064D for ; Mon, 24 Jun 2024 16:33:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B2F86B00CF; Mon, 24 Jun 2024 12:33:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 313736B00F5; Mon, 24 Jun 2024 12:33:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18DFD6B010F; Mon, 24 Jun 2024 12:33:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E1CB86B00CF for ; Mon, 24 Jun 2024 12:33:56 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 977A2811F7 for ; Mon, 24 Jun 2024 16:33:56 +0000 (UTC) X-FDA: 82266328872.02.41EF457 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) by imf07.hostedemail.com (Postfix) with ESMTP id A284640016 for ; Mon, 24 Jun 2024 16:33:54 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=fOugiJZT; spf=pass (imf07.hostedemail.com: domain of 38Z95ZggKCFI32uA2Iu708805y.w86527EH-664Fuw4.8B0@flex--jiaqiyan.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=38Z95ZggKCFI32uA2Iu708805y.w86527EH-664Fuw4.8B0@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=1719246821; 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=dSw8NmaTJHed6EDD+0u0W7yMVS5g1hNwrD11QKJoteRCYH9uk9wJ6ALmIrBYNkgjanBxwS KODZuonEUPAPBwV2RubN4hLIKUGBivUqnu+sAZ71+k1N6Jf4VqfFKgQVDv+GW83J3Ligks p8ZIypwU2Ftphm69Oj5rwu1BcJN3Tpc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719246821; a=rsa-sha256; cv=none; b=AwC3ArCPZ5CEim0WELSNj+E4kItPB3SzPCxGoBl+X4WfOnTcKIt355WVqkITV6EJSDdUIc aERsbEfAGUUaTDWEHV/UNpz57XNA3VWBKYS6UXQFPmyxRFvqqpUHaGeToXNRVM+lbxlRvA C6BHN6wRwjHSo21PGoVVwxqmydDe0AQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=fOugiJZT; spf=pass (imf07.hostedemail.com: domain of 38Z95ZggKCFI32uA2Iu708805y.w86527EH-664Fuw4.8B0@flex--jiaqiyan.bounces.google.com designates 209.85.210.201 as permitted sender) smtp.mailfrom=38Z95ZggKCFI32uA2Iu708805y.w86527EH-664Fuw4.8B0@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-706694428e3so1567956b3a.1 for ; Mon, 24 Jun 2024 09:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719246833; x=1719851633; 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=fOugiJZT9lRuvKMzrdBfCLOiUJV3lxtAUnJtFEjzhwSv/auc2AhTvN/dkMlVymOfoK 0l0iwhCM7P4o4yPVvcmDDXKGJgmViq/bD2k6nEFIiFRky3Ul5/W+O+uPBW8px1j6upIr PrkHrNfIm2e7RFieArflgGNmZjbqAYPsJvNHzVm1mHirnGruvxYn7Du3qncRoDjKkCiz lug6PCn5Rs/RxdXxgPHDzSgOaIxpxTt0MiCAnnQqWQ5Qd+ntjOhrFBiAn50Pj3RmXTfZ 0ryq2NkX2PiCfkBHdLjAvLy0MPmDdQAQRMSaUtp1cRZgtcgKy7OH5LDbdCbzVRhcNFx5 nzzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246833; x=1719851633; 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=WZydRV48V6lUYZAHCPWxPt7lleZa8oenIoG6Vxx1xMZUfRLtCf41KflmNDr6n1PLkO oO7/v2BxNzTBrkQOQJ4GOBUeTABxyRZN613p0aDVDoJMG5HAa2eShAWqL/wN4Qal/sTv U9SARWwUSIp9nwkBqiKt0N6LMGevgaotgSbH8rEcIpMM8vkQ6m2zlDu4RnwO+tdDJ92A kn0hkUb5gtRFvFI4jRPvV41YaoXlZ8ymy7u48dz8XWy8MqlwYs1xVlSBeVtyvYlqHywW 3x6Zbg0xxF1dJZd2FmMBEjN4CUb7lSbExSEw6YL0fYhDJaZRpTxAZIyd3KasJlkdGnK+ T8eA== X-Forwarded-Encrypted: i=1; AJvYcCW1Agt2og2tsRlmpHGORN5gNBy3msg+U+yH+bc8+nt1DhEpHuh8te4/zrNI/37vOe6Mg8q/Z/djQ4GmWBTeQUCFZ/Q= X-Gm-Message-State: AOJu0Yy6gjU35u5V8Dn1ZEALhmMi81g/WMhT9bo/4O1obqo1DuxpwI3K Krg/cbaXCnejM67IAT7hjis4wKbD7SetZtyL513RFQm5GSm+s2SCNlT6t7QAx2SXQxWt0llBXzB I2E6ThudnUw== X-Google-Smtp-Source: AGHT+IF1GRQbf9f53JYi+zCzPqxL0zi378t5Qx/Cho038U/27Y5JAiHIF9pEqP5D5pV+1pUBlBOa/tOCbhRcIQ== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:90b:3c4:b0:2c7:471d:172b with SMTP id 98e67ed59e1d1-2c848a4d8c7mr123984a91.2.1719246833134; Mon, 24 Jun 2024 09:33:53 -0700 (PDT) Date: Mon, 24 Jun 2024 16:33:45 +0000 In-Reply-To: <20240624163348.1751454-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240624163348.1751454-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240624163348.1751454-2-jiaqiyan@google.com> Subject: [PATCH v5 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, 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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: A284640016 X-Stat-Signature: p4599p4or8kcejc61ycj3b1kybcjornn X-HE-Tag: 1719246834-971655 X-HE-Meta: U2FsdGVkX1+uNcHTFifmIfBIqg/VBMogPxety+ac1yTh1VY/QAwIwuvKzZJRD8f8sRBlC0SoCl1zVbJxvEBjuSo6DRKso5/+f8zN+lBRY8gSthFAMejjAw59HVKntHlwLg8w3vIqIXxw1rD+kiqn9zoSDMbqNqq9GIpDJrgpXWptxzBFOgMYcRFREVTTpzcYLW5ZNbkhrWuij2ejXa2fjI67cNw1ytMXaSC4HvKl53X0BoIBLNiSUeo1RZQt2dC6vhTxMAl215e8V24yXpfBkMAUq2FL332M6K5eg3BLoUQzASUVmgaGBDlky7srAycjwKh1zK8pDVuBlXAOF9YKbFPr148m+jEULIyIJfQrCkHU6P4Sm6Jen/wrOfpKckEzGsWslEQmp6+iShXAw3U2APIWs0IjsWmJzWssBwSMBCT6qshQcWS4pTyNWF9oArsNVLdar1VYXoFhihWQBf9nIdBYe7sGVZ/3cTAGyFMfgsZlQu1UDcV3wcxqRtNn74/8scR9ZSgdXRH4khUY//WKSF2faJm4ZrCZc2Qrq8CIHpxgrbu043tnAJZ7lr7PI1pY71N13fWlcApw+mwyErwgKkCSh/D4IgTZNtRClHyPQyTliBgOw5QgTCzyne4FErkzUg6NdJRhe6ZsQxEJtLc5mEQZzG+Z7mwiAktl62kFxhfJ6sc3tibIQgBlW3yR/ccNXgZvJ3dGVC4s7kCbVTrMivTlQHPGez81qMYLPoaMTpQf1A+VSlshcvCkVd+19xNMPyogXIYWsS2JyDBl3v0GXxugRcSqODyhkPDD20+iZImafjCEkCd5C3Y/J2TusWwvzRurVBjkBm/GI08UVBxQwfZwm88am5t7Htacr9F1ILlO3VLj5AcaoEYfLKGz5HRAYnJTacemowIunkec3ylLpjb3wpOHQc7iLe2E2Zfz3qXE8Q2EvGXtvrI2c05Nl27uuV9Kgcoc5If+D47dYb0 gzOWv72j VDjsiZ/Ff+YV3zs25jKQNXr2BTzwSHc2zr/lRWc7O1K4XFN+EhF8BAdxZYw4YjT8M+rzotBQSkYF7+WLdAUx48HGVYUHnzj8lt5ciqpVVycKAeBUupg1kZrBm8eJN2gQ2cjqPBT29evLWbVP2aUnrLb//h2jxggtXnqcxozCNG+IzUkqz2pWgs4F/sbM9gHvjwAqxDtPodCCm6YvqBnxUjolEJJgV8ZTp+Cv8+LWllufzVVOOeYjrowWKYUanHciF1PK9GwSMIprlT/yF3IC4IwTpfipwxqGG80LUrkfCLHTCG3FOakIDjQqARb4P4wwYLj5rseh5O02JPp3+u1t/PsYL6tFXlVpjOGgVcEnm5T8DL0GWBHmWE3i8iRfRqIyjTxRL+K4E4vUsLFP9Ifj/PvAgPH+ckK2prbS99hDowQw2l8NZdnpP/D2HUfh+QTqtdVaEQjzd634VC3HeieoruTkgRvgu85gdWowpIjHuYKDfVjdRRgXB5eTZISe+XRstjb5v/0Exg8vSBpEHomlBSXRD8XrhaNTDGL6jtM6xYQoNyXgSLY0lpWUSFfQF4etp2j0DsaF08ODruJIgMvE+LPIjvGU/PaSgQMcx 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 --- 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 Mon Jun 24 16:33:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13709847 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 1D343C2BD09 for ; Mon, 24 Jun 2024 16:34:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 00A8F6B032F; Mon, 24 Jun 2024 12:33:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EACEA6B0397; Mon, 24 Jun 2024 12:33:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8E8F6B032F; Mon, 24 Jun 2024 12:33:58 -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 AA77C6B0327 for ; Mon, 24 Jun 2024 12:33:58 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 54D94141107 for ; Mon, 24 Jun 2024 16:33:58 +0000 (UTC) X-FDA: 82266328956.26.C0C0798 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) by imf13.hostedemail.com (Postfix) with ESMTP id 62E8A20010 for ; Mon, 24 Jun 2024 16:33:56 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=IHmqFQiN; spf=pass (imf13.hostedemail.com: domain of 38p95ZggKCFM43vB3Jv819916z.x97638FI-775Gvx5.9C1@flex--jiaqiyan.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=38p95ZggKCFM43vB3Jv819916z.x97638FI-775Gvx5.9C1@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=1719246818; 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=jaVeSRVMUEHHsCQ2CT1Mt2nWqEzTQXYnHsGL8HUoHVg=; b=eBlDmxipx4bX2Kjk/6YEdZ9sQeIeNBrB0cKDdjd/r8V74Un8IcDcLu1U8F6p7KS+ZEqqco R3+VB2ZMZpf1FN7xy9H7sbx7IC45ozD85/dpo6779i4uIRkNXONpNmc4iw2orMDnkzYCr+ cihzoMGLd3WU/NOlwoBxGXkF/G4fBOs= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=IHmqFQiN; spf=pass (imf13.hostedemail.com: domain of 38p95ZggKCFM43vB3Jv819916z.x97638FI-775Gvx5.9C1@flex--jiaqiyan.bounces.google.com designates 209.85.215.202 as permitted sender) smtp.mailfrom=38p95ZggKCFM43vB3Jv819916z.x97638FI-775Gvx5.9C1@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719246818; a=rsa-sha256; cv=none; b=ywr/hBzkmpUkwXLezw3Xzc6irICLi6YtfBvjXdUDGYLm/TL2SwMlY/LiYrozub75Hxk6nd 8OsqnVmkkbNJoMq+V58pjOV2MvGlNO6COzTbqB2smzO2qfx17P7B9UoZomzsMuOKigj0ZK V94Usuu4BH38wr/ivkZ96dtQ+T7GpyQ= Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-718c62ad099so3349394a12.3 for ; Mon, 24 Jun 2024 09:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719246835; x=1719851635; 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=jaVeSRVMUEHHsCQ2CT1Mt2nWqEzTQXYnHsGL8HUoHVg=; b=IHmqFQiNj82me7NzRDLvf9nCH2gLe7tjydI5UzKTr7lCjVP8P/r8V/fuapw4KIYh7/ sJR/J4/irg4rDiLs4+P9lSmuDdN+IkUw8GX9MJNryE/d0LwRaj2hoAdaDgHPVEiRttN5 7mnNDgkY+gPECrPcyR3iOUOrAN4/FeuWYfzv4Jwhk7T4lyIWkgy/JQhpRdqQee8RD/X7 MkiZdUfiJnF9M/aCLW6gJW/Nr7lf05M+pSRQhEeADMwSF43571ZvEmzX3x8DBrwa0pZO 6Y/BQatJvHmrdBZxOjB2qODx5XxnrSXEQiWR8+yjlM5ejid9lBNJONe76akjCO2FY/+u TdHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246835; x=1719851635; 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=jaVeSRVMUEHHsCQ2CT1Mt2nWqEzTQXYnHsGL8HUoHVg=; b=ZU96Rz302JNVInTWpn+ggSNs2mSxsO7sdNNbO2p4sjdsmsgC3ZY/pD3aMf/hbZfzOP 7ay5FPzsR4oembtvg119rxnyraiXWpNNLCEm8Wcrw4gXWsoh+pDyivH8AZqUq8HRhQIB WSlKJk1d1JWLGCmrwxYg3Hal2zIG/Sh2pPdfp8FdyhjBnLkkTmzX0+cNDuWR1e1DjT7A EFPhoArIG99wVA/GMYHWJ7Yp+/dk5QWMAQcABSU0ZQIdiabUfJPJPO4znKU8p04REAt+ pJHRaTSnLiioVTrNGnXrBkm7fWYpEF1V00vXT3xmNW9W8dQxNVUTPHgMm7T5Yt2kkkVs giPA== X-Forwarded-Encrypted: i=1; AJvYcCWeWO7P95UzJ+wsHkITtN7x7516GCBibPUeSkxFzlEv2Sk9XuU53TwJUvWphBXDG9bf7m1sx/C99egCC8PmA0Ylehg= X-Gm-Message-State: AOJu0Ywsm5iX3+TzAuDZ+9UBj+7o8SaUCYFZoks506VJLl7FaOoWJLPx KmStm33ddWdISaCGbuWF0ZGjSFl7WFy48eHYgWhQJ3BrX7BTnGmKk4yOtW7Z1R87zwDuII/7vzq 4VeKGrY/i5w== X-Google-Smtp-Source: AGHT+IFmjiZXsOh4qVWVE4+iXLz6GybpRfvQXdLXA2xaKMrN+J7XAcxYTT8GInfxKIa7RXbtOwVhCfQSnU4XDg== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a63:2354:0:b0:719:ae7d:9f2e with SMTP id 41be03b00d2f7-71a35641f60mr18300a12.2.1719246834803; Mon, 24 Jun 2024 09:33:54 -0700 (PDT) Date: Mon, 24 Jun 2024 16:33:46 +0000 In-Reply-To: <20240624163348.1751454-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240624163348.1751454-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240624163348.1751454-3-jiaqiyan@google.com> Subject: [PATCH v5 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, 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: rspam06 X-Rspamd-Queue-Id: 62E8A20010 X-Stat-Signature: utfif63k4xqpc3438m911g8z86z749m8 X-Rspam-User: X-HE-Tag: 1719246836-486687 X-HE-Meta: U2FsdGVkX187IMk9Jm8xJNpCs4EMwPp/3iRsOxmy8ELU8g6MYLdcILbZQXQCdNvsF3IK//NDn3b13YtbGB7tt0TkpZaczuROf5fUEUSG4ClEPmGlPkSjgezN6/a64XMPf9sgM7dGvuCiRGQttk3ORN0zXWZNfDk0bPwIVt6YEHFy9P+LnqELaJhc3dQoMXVvWQD0jSs+21zcP7/nxsTrAxhfq/uzzBkNDQt8xxFcGmm4MK0tQkMEhrGEZSVdXRv+ObywHGr2O7uoE9mbbfVNOj8TeBxSc3vbKDOAY9+zE+9Ui+0jATrwSso4Irzpb7iaajUZHS9wyF7d3BhRAWpVAOxq88Pr0+cI55Exz31AtiLQkZMha0/oZqtyDgITlRkBOCtOgrxaklRd6jRpJKvAtvXFb2PdFx9FCjELQDO0YhpNAvMxHMKgFkQ8a/xAlwXrwHNBxaJnQm+u1HQJ5GrFtchYQJcc9VLMUAGTDAC81xzKq7ZxKXk7ozu1SXarkJp5RLpWi042We2hasVBSUQqQfY2bFJU5d+WQT5DsE0ngwV2tQv4Iur3YfhdLRaoyJ0bjxf+4jnrqkXp04V0zsSJF2/Gsd6zS5opwB1biYjbP/Ge+MZhAYXScRM9d7/G10KvlHZ3jdKEkKeitOM0TjQ+OlnfSeE+cBzLi9F/YT3QZFKqpSs6rgZ3ccB9D0sjFDSXURA5X5R3M5Mj/6N+i+4vlK1WL4PoccrxVGfDo5UGg58Htl5e+LdNOUkRtwclDgjEKnE949nFavUk1o+/qJPNBvVLft2RozJ+dkqchnqwMi9HgNQkuMEwxIoOjCUK93KuZvn6p/+C5AJYu0cqvmdmt5mAVRkfYQrA+0he1p3MH41TqUhDU3L8nWMVpqhx/yQWhWrqDrz2/64QXgjmW1S3pAJV5xC2/2mYyGR3rVk9G7EvmDdj/XmGcu2Zmt0dl6XY2i1+wySPdOWSlfWxGzE VmxL+PYA VbiRKr3idGJqhu/BC5GdE3u01yB4BNoL90gTRgwlO/ZMROWT8VjJuz4uJOkMcE1OC78SsvS/uEMX3OkyERlHWKyjaOxYRdyyvTTFbRpCoTU+xOZeFlpCMsTa4M9ITOiiNAjUmy9HL6kfucTK//cA35PbcSwJGLRBfzukklz3F8mlDVyKmWp1bJ02M3QMGRbeW03bipTGKxmuZYfM2f/DLRoXB/5nAPkciflIujPlc12NQZJw83A8RTTTTYUL5WVUbeG7az7DaaqTUOpK6qeIIctijQGmfSAyB9UVoH4Os5kolW1w3oMRjUZXZO2Qs+yQI0swV/dYG8yIlI6EIibaVvrYU/0e9KmOt+y9ob0NRc4yCnX7aj2ASg2/quWesqqmaIqp3fpvR6OIWmiOkwK20WwvpaW7FVYIfD1gUU5TnByF9QYQI/auZAMt09QyZW4HnTR7vl9PCo3eoFG/lhERl6MjE6QSW3JgRaygTkKIXMGnxAR29tiz4UZvFJHbspsv2b87CE3U3DkzJaXgMQINcl4bS0u2sZMOSNqzRSCAHwR8fL1O5BugEjw3xZQ4yNAZxBKOi1OxagQImeNJ4wXwI95zxCbxthv3c361I3dTVcVvafCpGruos2OGq3+pedL0eGUCt 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. Acked-by: Miaohe Lin Signed-off-by: Jiaqi Yan --- 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..0013d338569b 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, or + * 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 Mon Jun 24 16:33:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13709848 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 E25BAC2D0D1 for ; Mon, 24 Jun 2024 16:34:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 190506B0397; Mon, 24 Jun 2024 12:34:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 118306B0399; Mon, 24 Jun 2024 12:34:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFA0A6B0398; Mon, 24 Jun 2024 12:33:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D47B36B0395 for ; Mon, 24 Jun 2024 12:33:59 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8E7254119E for ; Mon, 24 Jun 2024 16:33:59 +0000 (UTC) X-FDA: 82266328998.03.989C71B Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by imf09.hostedemail.com (Postfix) with ESMTP id A31D0140011 for ; Mon, 24 Jun 2024 16:33:57 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=mWHfMrka; spf=pass (imf09.hostedemail.com: domain of 39J95ZggKCFU65xD5LxA3BB381.zB985AHK-997Ixz7.BE3@flex--jiaqiyan.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=39J95ZggKCFU65xD5LxA3BB381.zB985AHK-997Ixz7.BE3@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=1719246823; 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=9vvhaZptFj6JTB0CcmvYAGAWn7bt9g4Ak/WxvFYJHHA=; b=ABE0adShOUOt4H34I3UhkwCwfGt4itSIFM3Oo4nZeqZRyna661eXb9+PrFK3cQFmlQSHS7 ZiLRR8P78vBTNy6RLeZZrVfx/vp0hGZgnuchXzO7+zlm78PFzTRX9/+jWqS/GEXExv0gzd B4zqCUiqBOHaYbPYxpDsbH90TbdG57w= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719246823; a=rsa-sha256; cv=none; b=SgNAbpA5PXmVPy/5KqdprlZ2W4bOxlsIQ1dz0txGzxZDm+5qMLGAaQJz+rx9J17fmp9GiF J/jhbAX/EHznFLYc+nW1s9TnG6f8jlYJhzmTDuBmz5XsYtKNJx0jytIByLGS45m5O9Fuk3 TS5AK8FEDTSpZpt6zLszwwwIGul41vM= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=mWHfMrka; spf=pass (imf09.hostedemail.com: domain of 39J95ZggKCFU65xD5LxA3BB381.zB985AHK-997Ixz7.BE3@flex--jiaqiyan.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=39J95ZggKCFU65xD5LxA3BB381.zB985AHK-997Ixz7.BE3@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2c6f1c0365eso5277498a91.2 for ; Mon, 24 Jun 2024 09:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719246836; x=1719851636; 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=9vvhaZptFj6JTB0CcmvYAGAWn7bt9g4Ak/WxvFYJHHA=; b=mWHfMrkaVS0dU2863bvMXP5BXgiMP98rHwa5l7MfMXWmTLD2W4Mo9YdMZE256LB8XI xM3WpTY/Fcxo3/fL76fIMFem1XRXXONwFp9gIEp+4Kia7r9DXXVq9CWoNYNY9BgHfk/4 vb937HiWdKYh/MikW7b9dNXsoHNBSEIsLfmIpiulWCACLYwqvdQnnWXe4k8dB7OkfJ70 4g8OFsEZA1zYIbbBTwTdCqbfa2ftO4MU+3vEWyEiBaSXJgO5AVUSl4FcWBl42VaD+hzm 9iQK0lt1lWeHjF029ItCuCXTm/us5bbRievD7W6Mt0yMj25odDOLqnpr0iBQ+5JBUDts +AAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246836; x=1719851636; 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=9vvhaZptFj6JTB0CcmvYAGAWn7bt9g4Ak/WxvFYJHHA=; b=OvRbhC+C6GT7kXifGWi6D1KsuM6QFku3/O7SUktU7644Z6n2wQD2JP6bhJWxoRLq9t tp1wLAtFpyQHimj9OEKsvHu8j+1WAc9ZC5aVgdK+jGrs3Flq6Aj2sPXjvd/eHetSuU25 x6j6JPhQtZjBc9JPBKYk6U3ro11gosl2BuJpMKNCfvIgdACAGVQdC4mCjC2iKYhIN02V IAr6+7iCT2dNAq544/M/aHeW7dycgz6L0RmtJ0W6Wfphh2HJjhY2Y0UkZy8YNCgHZDVh f3sQj5b3SlIqukDqFN6ic5c8CbAZiE/jvxjGwAg7DIvqNPegiFgrzFDlzKFNHFHQKOYT 4u7Q== X-Forwarded-Encrypted: i=1; AJvYcCXkhAaRhmDVh4aboErOFHyDJS+u3QXDmKYvubQEAOMqDdNObRK8byGnMmiCbeBZvZYz6KsaLjHMlJMQ2jfLk4r+cfY= X-Gm-Message-State: AOJu0YzGS/xdKobfIe451UMB2SxQKLLoqurbWRDbiJOF58n5Aq8CQMyJ Yz7NiYvx1jQpzfsCJd+KMVOtMAW3ILmVbet3T73BRn4lI/px/757XB9fGMaGBeawfyj+raLJoeE qOc3yGnPr8g== X-Google-Smtp-Source: AGHT+IGTiMcKI84dbFE5H2z0l2Fcmhs9y/kM+GPkY+GUg1Z/omR04Q3dPmkB+omY4azsFqSvT0rRbpXc5WHBqA== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:90b:4d85:b0:2c2:fed7:d797 with SMTP id 98e67ed59e1d1-2c8507b2998mr45685a91.6.1719246836231; Mon, 24 Jun 2024 09:33:56 -0700 (PDT) Date: Mon, 24 Jun 2024 16:33:47 +0000 In-Reply-To: <20240624163348.1751454-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240624163348.1751454-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240624163348.1751454-4-jiaqiyan@google.com> Subject: [PATCH v5 3/4] selftest/mm: test enable_soft_offline behaviors 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-Stat-Signature: 5u3m51kpemjbfhigjyobi3hr5635n6tx X-Rspamd-Queue-Id: A31D0140011 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1719246837-838473 X-HE-Meta: U2FsdGVkX1/dIMu18B/GbH8gUYV85N5OzEp8iDZinVULncIOerIxK2Gy/ey3Z6uwrw1+BU/Ns3gaTehZHgKu5H/jlrHUFR4k8EaHaic/O2uzkLfP8KLcAr4xEHn4VnVNNUH4QJriZkhj4qo1OYA5ufeiOTDbDume5aqnCJbGIqd9Jpzunc69Ge1gf/fdrmUFozLjyNJdwUpwOL0U5L3pJqtxFMY5Eq7/gup2NjhIksse9DEa1JuoXU46sigdoG6EYEq5nD/1ti0xHGbmO/hgWiQ6rbl4K9aqeVicKMJwRuU6PvfumjN4uxLrFO+wywjJ55jlwHF8RJ4L+4oHojon5GHaFSvo+jZNtjwtVBW9gf95BZnYVVm8Xlonlhq30oBK06eA8VbrK62scm0EpyUjmFRwVToBkq7oZxm5P3Ry6X4Hh17F+LP+V3R6Nc700afccXBVjPOXYqJt7gzFpiwIWc/Pp1fMCHQZNc49AUp37Z/3BeasOXhJzXx1SZMs72LmGs4OQjPRz6k4MsHPI/gtf1FgGjRLjBsG71haD/STyXrGMW1ZeTRcXOf8oePNIrqj0cOaaE+RnxkwLT9tixjcvdArLBAg0TSB1yO1A+d46ycEg+VSrSeDkvr0LehWdOkZ+5/AFq7vIRg/ML85310N30RlioPnlyDFtohDvIovbo09Fl5+e+xpmN5qHMApkdNbxEREiBmd0kii6oc7M1FHs8ILtI9kv+uweFDum8u+xuamlzyOJAJooVe8tx2wYqR5rC2hwmFShn0TauNI9OemUlNY3TtXYppGP6y3Tp/8gzA0pAf87t4xcWJC+PrGUmJj7TA10woO3n7quIS/xGe8bEulItzqpAfMLjBv3Odetx2DCKlzH8dUCq1uBgbGZ512OhrZ8joA8+ftIIF8cLof8gZy+3o5yJIl+Nah+q1Hl4FthP04/Tscrj3LeNEsVfih0rIrmveqCZRpBasBytp WkN5SOP7 d8crxX0kYAf1my5v0kKXP7eZZgU71Gm0ZLFIZfrd+clxeMaSeyv/IOHsuIQyEo2cz2MUOB8KFC8Lyiy2PevXfgVJlV+yHCtE8A05rcVesX4C8xY7+BopCaZAZjOSk2saqBkkVr5G7H/Z+42pJnpMUqXo8t1YpAJlkugEY35525shJyK31Uvn1xNS7DSUpRAvpd4o8LWXaDSLaDsgDxXxuOYFL3qZt2gsAvBy6+sVaqJoQXmpmKrynVT0FUd5hJm/R6inaX2PPeD0W8LQ3Dz5GxYbfhltmaCPU2MHuLIJP26Yon4bZYKCa2JANSM4qeZZbLwe29vEVHGT5prcKVeeWvIvWLiDNXyTFrNRURRtXwrz20EzjdjRJjWr6DBpd6zUo5Ekyo2pfElYGjFeeaS29/gjGAXiJcCbOAarIPQRhKc9LnJ0RkabC1iOBBIe2TWBr05BHVqLFFzi7NIU+a6GBdPhv4gxX8e2lT5MXSI6xwf/56TBNOAcRMt5lErdQSRaHpkaPEQcvsaDvShZV/G3q68wSmhM+C4e3fd1ybGpcCuLmJHfFqu05dXPlTSMaKVP8ggBd+CR7aSqSytwt/Th5p3+tddxtUk2JIH2QwJj+pScWyGhlA+UU8Uos4zeeW+noCUfXffe4PN53HkjMqylMoeTzzg== 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 | 227 ++++++++++++++++++ tools/testing/selftests/mm/run_vmtests.sh | 4 + 4 files changed, 233 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..16fe52f972e2 --- /dev/null +++ b/tools/testing/selftests/mm/hugetlb-soft-offline.c @@ -0,0 +1,227 @@ +// 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 + +#include "../kselftest.h" + +#ifndef MADV_SOFT_OFFLINE +#define MADV_SOFT_OFFLINE 101 +#endif + +#define EPREFIX " !!! " + +static int do_soft_offline(int fd, size_t len, int expect_errno) +{ + char *filemap = NULL; + char *hwp_addr = NULL; + const unsigned long pagesize = getpagesize(); + int ret = 0; + + if (ftruncate(fd, len) < 0) { + ksft_perror(EPREFIX "ftruncate to len failed"); + return -1; + } + + filemap = mmap(NULL, len, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_POPULATE, fd, 0); + if (filemap == MAP_FAILED) { + ksft_perror(EPREFIX "mmap failed"); + ret = -1; + goto untruncate; + } + + memset(filemap, 0xab, len); + ksft_print_msg("Allocated %#lx bytes of hugetlb pages\n", len); + + hwp_addr = filemap + len / 2; + ret = madvise(hwp_addr, pagesize, MADV_SOFT_OFFLINE); + ksft_print_msg("MADV_SOFT_OFFLINE %p ret=%d, errno=%d\n", + hwp_addr, ret, errno); + if (ret != 0) + ksft_perror(EPREFIX "madvise failed"); + + if (errno == expect_errno) + ret = 0; + else { + ksft_print_msg("MADV_SOFT_OFFLINE should ret %d\n", + expect_errno); + ret = -1; + } + + munmap(filemap, len); +untruncate: + if (ftruncate(fd, 0) < 0) + ksft_perror(EPREFIX "ftruncate back to 0 failed"); + + return ret; +} + +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) + ksft_print_msg("enable_soft_offline => %d\n", value); + else { + ksft_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) { + ksft_perror(EPREFIX "failed to popen nr_hugepages"); + return -1; + } + + if (!fgets(buffer, sizeof(buffer), cmdfile)) { + ksft_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) { + ksft_perror(EPREFIX "could not open hugetlbfs file"); + return -1; + } + + memset(file_stat, 0, sizeof(*file_stat)); + if (fstatfs(fd, file_stat)) { + ksft_perror(EPREFIX "fstatfs failed"); + goto close; + } + if (file_stat->f_type != HUGETLBFS_MAGIC) { + ksft_print_msg(EPREFIX "not hugetlbfs file\n"); + goto close; + } + + return fd; +close: + close(fd); + return -1; +} + +static void test_soft_offline_common(int enable_soft_offline) +{ + int fd; + int expect_errno = 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; + int ret; + + ksft_print_msg("Test soft-offline when enabled_soft_offline=%d\n", + enable_soft_offline); + + fd = create_hugetlbfs_file(&file_stat); + if (fd < 0) { + ksft_exit_fail_msg("Failed to create hugetlbfs file\n"); + return; + } + + hugepagesize_kb = file_stat.f_bsize / 1024; + ksft_print_msg("Hugepagesize is %ldkB\n", hugepagesize_kb); + + if (set_enable_soft_offline(enable_soft_offline)) { + ksft_exit_fail_msg("Failed to set enable_soft_offline\n"); + return; + } + + if (read_nr_hugepages(hugepagesize_kb, &nr_hugepages_before) != 0) { + ksft_exit_fail_msg("Failed to read nr_hugepages\n"); + return; + } + + ksft_print_msg("Before MADV_SOFT_OFFLINE nr_hugepages=%ld\n", + nr_hugepages_before); + + ret = do_soft_offline(fd, 2 * file_stat.f_bsize, expect_errno); + + if (read_nr_hugepages(hugepagesize_kb, &nr_hugepages_after) != 0) { + ksft_exit_fail_msg("Failed to read nr_hugepages\n"); + return; + } + + ksft_print_msg("After MADV_SOFT_OFFLINE nr_hugepages=%ld\n", + nr_hugepages_after); + + if (enable_soft_offline) { + if (nr_hugepages_before != nr_hugepages_after + 1) { + ksft_test_result_fail("MADV_SOFT_OFFLINE should reduced 1 hugepage\n"); + return; + } + } else { + if (nr_hugepages_before != nr_hugepages_after) { + ksft_test_result_fail("MADV_SOFT_OFFLINE reduced %lu hugepages\n", + nr_hugepages_before - nr_hugepages_after); + return; + } + } + + ksft_test_result(ret == 0, + "Test soft-offline when enabled_soft_offline=%d\n", + enable_soft_offline); +} + +int main(int argc, char **argv) +{ + ksft_print_header(); + ksft_set_plan(2); + + test_soft_offline_common(1); + test_soft_offline_common(0); + + ksft_finished(); +} 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 Mon Jun 24 16:33:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaqi Yan X-Patchwork-Id: 13709849 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 759E7C2BD09 for ; Mon, 24 Jun 2024 16:34:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84AEA6B0399; Mon, 24 Jun 2024 12:34:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 735876B039B; Mon, 24 Jun 2024 12:34:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55D716B039E; Mon, 24 Jun 2024 12:34:02 -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 36E906B0399 for ; Mon, 24 Jun 2024 12:34:02 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 88D211211DE for ; Mon, 24 Jun 2024 16:34:01 +0000 (UTC) X-FDA: 82266329082.28.8A9B222 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by imf10.hostedemail.com (Postfix) with ESMTP id 8FA86C0011 for ; Mon, 24 Jun 2024 16:33:59 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="t0NSb+/X"; spf=pass (imf10.hostedemail.com: domain of 39Z95ZggKCFY76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=39Z95ZggKCFY76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@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=1719246825; 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=GVvAVLVgyp7BPn3YqnrE+Un4CdtD1Zv3a2093D82WyY=; b=UMW30nnCkdps/f7dFSDR9ZNeQyM2jsppljlnCg/uc5D9RHUP6udDEq7VnJEacrNESFWIM3 PS+gb3Zj2z2gSxhWEOBkHD6jsRU4IJGsAVYMImtx+l81xwbNnFkZwsH3Ej7ZmSOaWLsNOw Bi1p0GqSjOayq4ZSO6tXI/q3MAnaw1Y= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719246826; a=rsa-sha256; cv=none; b=vJ4QXbAIeQ/NA3azROhiMCyHvd6W2TdnIqnAeg5x+/SjQGKN836FKH2xiuOHGM7kgXNj/g LzIHj4wySo0+pFOwzJ2zYyp5gUj7/cQiiBHUA65Zrdnfg+x7CS/caABQ319yr168f4Rwrw THq3hESBzWZ1qPSxAz3U/O9y1mAh4WA= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="t0NSb+/X"; spf=pass (imf10.hostedemail.com: domain of 39Z95ZggKCFY76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com designates 209.85.214.202 as permitted sender) smtp.mailfrom=39Z95ZggKCFY76yE6MyB4CC492.0CA96BIL-AA8Jy08.CF4@flex--jiaqiyan.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-1f733390185so39421625ad.3 for ; Mon, 24 Jun 2024 09:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719246838; x=1719851638; 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=GVvAVLVgyp7BPn3YqnrE+Un4CdtD1Zv3a2093D82WyY=; b=t0NSb+/XSI9Nb0m2aI7u4z2ljCg2tpwPw2yZLi+uwEBZoscGJA0hNA8lUsIbrTYlzI rgfIMFT3yI064eduLdCNkhmt22NAjr2Fz6tFBtHSzBE7dR27rGut27i7YGm6f7FwoVlr Cmt/4rZjPvSegVLSJzkt1hsSDdHNxTWp+yinIOl0m/Ne16AS1ZBMhNHQJK2DFjitCijm qkQAP/bVLlhiDnZld3YQWYG3GkZoyUkrILR1jyXTXp1Hqmi/7hgPPKyKPjfMpstiMG8o QshovWklNnydS17GbEC4hJsxFLV5nadFhrjozWXn+etHWCRPpfP/sTPgeQsZtcrTAT+m QMaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719246838; x=1719851638; 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=GVvAVLVgyp7BPn3YqnrE+Un4CdtD1Zv3a2093D82WyY=; b=CVks+HdHCNz2nsItK4gqeU5Py+QXiNbG45k5hEdAKHodc2C1/yaVZhJZpP9H1vHV18 Tip4mO7dnQmtCQ/xQKwbqwCAECoEA0H87nQLgcpd9S/TInlwsr2W4LsJjb4ZoamoU3AT I5YJPJXMyNbvZ3PU5wE7FH4F0wUjZmAXA6E2sdqYu+GVNNAnxqR4opRTGPCo2zV0CKpm HdtUGCdXfXcoJ6sX4a/uX6aLVqsv1Yrsss/F8UFH/c4Ep5q0etfN5AjZMllkobj+mmwA /t8tagf8VqGlyUXJ/VVq4idau75G6CPkey7ifTE3yfhTmWLZOnhcxLrSKoDcGwWlw7ZW Tgxg== X-Forwarded-Encrypted: i=1; AJvYcCV4un2h6y6W9D41n1GGrexJviMkqKiCjhzbr8vj9lKXO6REGvvmS10QEOmKyO0Z8BOvFulltlZ0STjp3Ymo7E5XYNU= X-Gm-Message-State: AOJu0YxvmkJwtpguh9+raFf5DnMsi4k66SY+h999WBAzM3RsYLiyfCgo ER8x9WiZr7vwon5TxKpAoA+d61cEBeEWEJsIV3I0i5Zkf6hGxsNE4bDZOOuf9LX4ic9SwLyxgrR ZxN1fBlaA1g== X-Google-Smtp-Source: AGHT+IFQ03M3aTRppiNCfLsuYEASJusj+ybeUo8fprfJ1Y1kR44v8CZCgZBXMkKg6JbKjrrKoR1HPHTKxUnd6g== X-Received: from yjq3.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:272f]) (user=jiaqiyan job=sendgmr) by 2002:a17:902:e74c:b0:1f9:c823:d3 with SMTP id d9443c01a7336-1fa1d516b81mr196425ad.6.1719246837884; Mon, 24 Jun 2024 09:33:57 -0700 (PDT) Date: Mon, 24 Jun 2024 16:33:48 +0000 In-Reply-To: <20240624163348.1751454-1-jiaqiyan@google.com> Mime-Version: 1.0 References: <20240624163348.1751454-1-jiaqiyan@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Message-ID: <20240624163348.1751454-5-jiaqiyan@google.com> Subject: [PATCH v5 4/4] 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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8FA86C0011 X-Stat-Signature: c7sntncq1zfec4euqehamitiiys67csr X-HE-Tag: 1719246839-550489 X-HE-Meta: U2FsdGVkX199PzO1vsZNj8hZe7QolOXFZjzhG1N2je8nTGRJwprns1wDBTBfnrCmLfCBGXL9sDnnYsO1ExYSHaqYcBUGWesFtpxrmkKJfpPOpXJ+kUpPcbV6s81v690bRSxDGjZd/3kUYd4Hp6c2AlaPCj6JC/YtmvviK89CUS6aat+g3tp3zZ2OuhaPTLvFB363x7EsFsH8VlofF1BQrCM9cUOA9TebjBgF3S3dyMJ4/wLNbAnwkWbohjV5QsH+WH2Ir3BZkrkXwHs+Mwp52uUPgXqk/clOeDSpvOb9jNxVN4E/GYnsFNkLIuxmiqViTQBRovmJl1FrUwqV/ktxEyTaEuMZpyAgVXx5kmldNC+jBfE+/Y6exgRg9KeKKIV8IQfS5ZHVRiZ7sig5rFYKBWOEMEeiKdB6Vb3lzHNcVJaMukH9dkrVftHbFG11Cnd6cwuB1jpI0IuRNUUDm5i2MQy9E6GQKH2rV7YoruQbBwwgINa7Kxl5zFORhaE1TO/Ra1sCJmwHhDutFcsUQu8t3XW4815Xp/U7gf6vfOq8eBck+6cM/gql2nns1QTuBxyT128OnYi2pKFlD5cNWxC2+ghNAk1V9ZOAy50wXZsT8Siqz1baLkg1yCor8Y4o1QTaO4ThUYMP94FYaTMP8AY3syGliP0G7mEvsVj5VcZfl/2fWaPiKE86MW7XNsv/BiDaza89NCrsxPOh0H+uxQOkXM5tLLGpIUb/drIlkal28izA1EIzZYiLReWFqdpbBJUh19/6KzAbfCz/tilItiFm43YGUjDQs5EyiQEIJC9iI2H3J9aOZZ7IuTnmRafQJDDiK51tbTH7WhVeGD9xapQv0vvDQtG6EBD0NzBbQ1lsHsbB2D5K7099McMhxIjKtWDSDygg8LAHtG/cwUUevnTqrmbFw9Yr9p7ll7YOt0ezWrFoGUTkDgcXT0oBECWvBv5DFbTfV+EYO7gDMvWCtac H2Mkqs8l 4SF2uMoGxOuEij/dIC9pUZ/mvYe4V1uwLOXCoCOFcXFvGVFGmPEo3ziA1ONUoka7yHiV+KwZhlmBKtrGgVY0O4O1chSealor6LvSIwinpfXqG5+bOZLySzeop+fc9u7xYPhzsrC5uSBoNCTcLFO+fsdh59YX5b7kw8StGC4hyNemE0qsYw10WDtrFAHGVnxycrxq/DgEeYd/57+IhbYxVLSTVc7msxuePZ3N8beiaY0PQ34uqSbbqE1uRf5x2dC3fNDH3fHKXgTaGCX54vDbsMhAsXdexT1D3xhvBXyh9WGspBj0Q5T/+oYA/e8hwxN7aTHHqpBiOSmQFPKICHbXj2g8VQLXhxW8y4XO/zgmR9hvjjx6uUENnO71V9pz/rUckyAMfKLBE53LHtjixvkhz5bW5ZlWYShuI3tf2O2X4+rCDviln/1H2sV435LtcnhNAiacH2preponrk2FOfzeTq4+iw9WgZhepQ5xWdil4aiIDt/rPJWUghakeVjWNVHxIna6AbuvZn/Ps88lEPCU9Dof0v/dxSxS+k1ZsH9kk8B+032RxDVNfJBNa8KDEFROQHdzOf5Z3mehPq2/m11+mw2dU/kKCpcClz2tm2yvW9XgQ8vLmulo3VnqCDs9tZRWH8kNBfPX5b6zC8CiRoh4r4u47aQ== 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 Acked-by: Miaohe Lin --- 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 =================