From patchwork Thu Jun 30 02:27:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 12900996 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 E42F3C433EF for ; Thu, 30 Jun 2022 02:28:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E0D68E0006; Wed, 29 Jun 2022 22:28:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 765B28E0001; Wed, 29 Jun 2022 22:28:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62FAD8E0006; Wed, 29 Jun 2022 22:28:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5399F8E0001 for ; Wed, 29 Jun 2022 22:28:46 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3370C350DD for ; Thu, 30 Jun 2022 02:28:46 +0000 (UTC) X-FDA: 79633319052.13.FE3B91B Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf14.hostedemail.com (Postfix) with ESMTP id A860010001D for ; Thu, 30 Jun 2022 02:28:45 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1656556124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sQp82hDOk82vRv92dNThK5SQ8yKvxwYYoFoVJwwIfdQ=; b=SQSSYIl1u2E0NKLfQjCeFwPw4LflsTKAjwE0RiatjPRLkLJA7dqf2Y+NjoBilHeFrUf7cS hGJYAqx3bYUs3bCHvOgg+hIuz5SNUljq5isddMb+JEvFITT+WC7pv7O+udHCCfjGP/mRV0 +D9G7Jg2/69W1MTxSlscl+537HgFeU0= From: Naoya Horiguchi To: linux-mm@kvack.org Cc: Andrew Morton , David Hildenbrand , Mike Kravetz , Miaohe Lin , Liu Shixin , Yang Shi , Oscar Salvador , Muchun Song , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: [PATCH v3 9/9] mm, hwpoison: enable memory error handling on 1GB hugepage Date: Thu, 30 Jun 2022 11:27:55 +0900 Message-Id: <20220630022755.3362349-10-naoya.horiguchi@linux.dev> In-Reply-To: <20220630022755.3362349-1-naoya.horiguchi@linux.dev> References: <20220630022755.3362349-1-naoya.horiguchi@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656556125; a=rsa-sha256; cv=none; b=VBXqB9eRT4j8r5ZgfzUVvJAeOTJrEkcs12xIZ6sp9hySAFPNwXcXr/on5xBF31etKktznD a/lw6EYLgbglxHkWHEhaa4GdS4uVdcEH4FfHxcLoiDmAmbC5FxLrWUv5MtFdDhZpe1pPam aSAZ9uCcqkweSirVyxOAYpL7CZv0DrE= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SQSSYIl1; spf=pass (imf14.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656556125; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sQp82hDOk82vRv92dNThK5SQ8yKvxwYYoFoVJwwIfdQ=; b=G/mFZDSs8cRzsOO3vL8hYhxjoJ8+OYFr2wKt6h/uo7Yy2SYZwnPNKbWIJ+2tU9jqoWFSX3 Jz3KtrWQmLezryNYkHtKogHRDQKo6ySo+m2oPFD71SaEEdH4iEK69V2qUVMUXYJdFNnIwQ Ifyp8saPO0I3lpJjvSjxHkTo5RXnqGE= X-Rspam-User: X-Rspamd-Server: rspam04 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SQSSYIl1; spf=pass (imf14.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Stat-Signature: bcpdgnqagw35tue9abg658ac3189y6my X-Rspamd-Queue-Id: A860010001D X-HE-Tag: 1656556125-973931 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: From: Naoya Horiguchi Now error handling code is prepared, so remove the blocking code and enable memory error handling on 1GB hugepage. Signed-off-by: Naoya Horiguchi Reviewed-by: Miaohe Lin --- include/linux/mm.h | 1 - include/ras/ras_event.h | 1 - mm/memory-failure.c | 16 ---------------- 3 files changed, 18 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 044dc5a2e361..9d7e9b5a4d1d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3284,7 +3284,6 @@ enum mf_action_page_type { MF_MSG_DIFFERENT_COMPOUND, MF_MSG_HUGE, MF_MSG_FREE_HUGE, - MF_MSG_NON_PMD_HUGE, MF_MSG_UNMAP_FAILED, MF_MSG_DIRTY_SWAPCACHE, MF_MSG_CLEAN_SWAPCACHE, diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h index d0337a41141c..cbd3ddd7c33d 100644 --- a/include/ras/ras_event.h +++ b/include/ras/ras_event.h @@ -360,7 +360,6 @@ TRACE_EVENT(aer_event, EM ( MF_MSG_DIFFERENT_COMPOUND, "different compound page after locking" ) \ EM ( MF_MSG_HUGE, "huge page" ) \ EM ( MF_MSG_FREE_HUGE, "free huge page" ) \ - EM ( MF_MSG_NON_PMD_HUGE, "non-pmd-sized huge page" ) \ EM ( MF_MSG_UNMAP_FAILED, "unmapping failed page" ) \ EM ( MF_MSG_DIRTY_SWAPCACHE, "dirty swapcache page" ) \ EM ( MF_MSG_CLEAN_SWAPCACHE, "clean swapcache page" ) \ diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 6a9b11807ee6..6ee5cbe0cbab 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -728,7 +728,6 @@ static const char * const action_page_types[] = { [MF_MSG_DIFFERENT_COMPOUND] = "different compound page after locking", [MF_MSG_HUGE] = "huge page", [MF_MSG_FREE_HUGE] = "free huge page", - [MF_MSG_NON_PMD_HUGE] = "non-pmd-sized huge page", [MF_MSG_UNMAP_FAILED] = "unmapping failed page", [MF_MSG_DIRTY_SWAPCACHE] = "dirty swapcache page", [MF_MSG_CLEAN_SWAPCACHE] = "clean swapcache page", @@ -1702,21 +1701,6 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb page_flags = head->flags; - /* - * TODO: hwpoison for pud-sized hugetlb doesn't work right now, so - * simply disable it. In order to make it work properly, we need - * make sure that: - * - conversion of a pud that maps an error hugetlb into hwpoison - * entry properly works, and - * - other mm code walking over page table is aware of pud-aligned - * hwpoison entries. - */ - if (huge_page_size(page_hstate(head)) > PMD_SIZE) { - action_result(pfn, MF_MSG_NON_PMD_HUGE, MF_IGNORED); - res = -EBUSY; - goto out; - } - if (!hwpoison_user_mappings(p, pfn, flags, head)) { action_result(pfn, MF_MSG_UNMAP_FAILED, MF_IGNORED); res = -EBUSY;