From patchwork Thu Feb 29 21:20:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13577658 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 47E87C54798 for ; Thu, 29 Feb 2024 21:20:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 918D36B0093; Thu, 29 Feb 2024 16:20:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C9BC6B0095; Thu, 29 Feb 2024 16:20:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 727996B0098; Thu, 29 Feb 2024 16:20:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 640286B0093 for ; Thu, 29 Feb 2024 16:20:46 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 19DFF803CF for ; Thu, 29 Feb 2024 21:20:46 +0000 (UTC) X-FDA: 81846110892.18.3F7C8DA Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id 2962A160008 for ; Thu, 29 Feb 2024 21:20:43 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EBRWMakJ; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709241644; 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=Ewd6xNhf+Jrao4VIXUIIVkDPwVs2qsihgrFOo74uzaw=; b=iwn/PSYI76svCSycR3PVkrGiEg7DEThkrFxtm4odxq6mg4fRisVAfpHYuKdHctPTXQZtPO uu+g3FIpUNjQEn3RHRwlsM7FN5k5BnvLZKN+hGk/nueqLiUln6XVKjTB9XWz0EUsjtQFJJ Yzvykv2PxqnZR3fUXtlXz2Hh079//AQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709241644; a=rsa-sha256; cv=none; b=yETPaYf1SLcld4qiRwsvCLgvczkkVtI/fItM8xomvMnls2/u3N2SLlY1EW0GVozi8ItGCU KnZlgzc++tLGzoc0AcJJJSdb5MiVkcBP/AY8JDNV4fc8RjIwmXaEo41vtv8uXnKhJlTvxk 0d/TUPO0Gc9g01jSvNppzH87iZDGhG8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=EBRWMakJ; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Ewd6xNhf+Jrao4VIXUIIVkDPwVs2qsihgrFOo74uzaw=; b=EBRWMakJCYoGJJz708QMR4JpJ9 Iyw4ABtfHKI9mTB75zTknn+9VrZy/WueLbUwGEUppXNbDTDRsfjpA5GujSVM0g3AIDWM8GLSXXUWJ 98PKHp2RyYYN7FD/b8b02hec8fJVv0JUT/q3kJ45ZbLrbzm0Twd85nGQTX+dqoPIb58bzE0bsIXPM 2yyjlwyTTBUitx/AmFaHWq7SfsOzfDKG4zY8pIGXKoIZFANgUg2hVXdBD8C1Dp4zU0fUcHI+W451q BvfJQoA9cTolvF9BTlftCrp7mEVbcxubWRvdHyE5xDX0R/+vM3zuMB7AMhx/+VWENlqa7oFHS/kFE x4C7jVMw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfnpW-0000000949k-0O3i; Thu, 29 Feb 2024 21:20:38 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Miaohe Lin , Naoya Horiguchi Subject: [PATCH 8/8] mm/memory-failure: Add some folio conversions to unpoison_memory Date: Thu, 29 Feb 2024 21:20:34 +0000 Message-ID: <20240229212036.2160900-9-willy@infradead.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229212036.2160900-1-willy@infradead.org> References: <20240229212036.2160900-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2962A160008 X-Rspam-User: X-Stat-Signature: 9unwrbwzzdj4ebqec7xykw1fp8c8nboh X-Rspamd-Server: rspam03 X-HE-Tag: 1709241643-817914 X-HE-Meta: U2FsdGVkX1/ZgeQt7KLagw4vjWQfn4kLnjxI9kkVuYcy7wMZvUYUevGOgQK7zBwAQ6+mKdI0rj7Hmx+ngvgVyCdhUKmTyIt0iLn2UAsN8+ccX7SQWCyc6DaMq0nDDajoYUVyzeqLCjOrar53ufqrP3GQEqZCbfN3m8ArlklYJ93nAtkkZJhvX12CZKSSRf6nvAI5hq1Ro5cWu8FZYQeD8/XJsC1vKE7Ox2AtSXNSOVClZtfW6uFtR+7R9CCosSch4uVgUh3bmKTJb29sne9fGZ/b33rG2eBYPPtzl1zN+N2ECIDc4Wn6IYKZJdhzEXvF1ovwTgQVMq9guSL+0PwAnLTTzHXdYQnZT5alxuWJ7i4xe46iFjmPmsqqIs7ls3DO+xycdjQSJJG3v2J9/FwQSBFqxWyA/VYPdVDw95H78xFzTDMN9EN/kgx0N0MhG/msc3hQ6Db6mLqqh98wDAKGSn78+l7TygK4T4R4beqI5/u79m+S0H264R/5jxHa9t1CcbWsIBx3PI0I7Q0PWEINMaxIcmx7B/13pyiPKfNdsQ9kBPWnEU2vqV/O+ZLESB3OI0YpKm1S11sRpbJpbPvkpEGaAIxC461S/ZdijSN+U379w7/L2hqYKDtuypX3DxpZ/6Vjl7o2WDFu+xjrLOWaly148MxDQbGa3HK7YoUN2GI8M4xriLTt6UuBJbirxTtwJiHmuq9v5bTT/+9G0j+3Ke++JamI/ATcP13h3JqiJzhTjzI2dc6kZ+At5yz34oK58+eWKNfN1oRN3gUvCY8Br/xVk21KqiIvgHYssCIxQm6hTUrpPbTiRddjNlBpc5c8czuw4YHB/WNnYMKf0EzZJ0NxRK/16pUE4XgKJeuG9+Bp0hkjhcd/2uiFpBONJBoqGYIbnCSebmLhRkQd/9nYAIvsZ1jsJi52 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: Some of these folio APIs didn't exist when the unpoison_memory() conversion was done originally. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Miaohe Lin --- mm/memory-failure.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 56bc83372e30..0806edb48b61 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2556,8 +2556,8 @@ int unpoison_memory(unsigned long pfn) goto unlock_mutex; } - if (folio_test_slab(folio) || PageTable(&folio->page) || - folio_test_reserved(folio) || PageOffline(&folio->page)) + if (folio_test_slab(folio) || folio_test_pgtable(folio) || + folio_test_reserved(folio) || folio_test_offline(folio)) goto unlock_mutex; /* @@ -2578,7 +2578,7 @@ int unpoison_memory(unsigned long pfn) ghp = get_hwpoison_page(p, MF_UNPOISON); if (!ghp) { - if (PageHuge(p)) { + if (folio_test_hugetlb(folio)) { huge = true; count = folio_free_raw_hwp(folio, false); if (count == 0) @@ -2594,7 +2594,7 @@ int unpoison_memory(unsigned long pfn) pfn, &unpoison_rs); } } else { - if (PageHuge(p)) { + if (folio_test_hugetlb(folio)) { huge = true; count = folio_free_raw_hwp(folio, false); if (count == 0) {