From patchwork Thu Mar 14 01:25:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13592034 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 4B5BEC54E58 for ; Thu, 14 Mar 2024 01:25:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B365280074; Wed, 13 Mar 2024 21:25:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE68280073; Wed, 13 Mar 2024 21:25:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95F9480074; Wed, 13 Mar 2024 21:25:15 -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 83BCE80073 for ; Wed, 13 Mar 2024 21:25:15 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5BB59A0465 for ; Thu, 14 Mar 2024 01:25:15 +0000 (UTC) X-FDA: 81893901390.22.A39D645 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id 56ABD40005 for ; Thu, 14 Mar 2024 01:25:12 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=q2xnfEzm; dmarc=none; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710379513; 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=MTjJLTgp9t/J7Xrz7I6NWz7OnbeiFk3Tm1f5OI4VsyQ=; b=3NhI/2rIAyojOifw4MrsXvnLPz5cUwRUCfXK6qHq/pRDY1MBsGqbfcB2k01xfiBpIBYcx2 WwhYkPbOGgwc8z1AI2WF0Ll/iIpIWZQ1SP2jyBl7okZR5vzRkQ119YeyqV1l7azdBexzQf BjYMidgLYCmPTVko+9pyI8KXkMxigsk= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=q2xnfEzm; dmarc=none; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710379513; a=rsa-sha256; cv=none; b=EdTpIFhhB0RCEH75XSXcA3RV5VKhUMXSEkMZy3DWQlkfAFL+rRkVihhJ6PzK56EBg3juMp WUSHFhWLekBiYEqRtRIqWSc4xM9q8BCF2LELR83ZaGE/KayIxnMA9HSNiT1FcObNWKfjgH pdJyeQBwUcbzEEsd+FO6AdpFkfqOvjY= 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=MTjJLTgp9t/J7Xrz7I6NWz7OnbeiFk3Tm1f5OI4VsyQ=; b=q2xnfEzmUZFSittA8MmRh0LyYk fLGlbpjGY5gPQvHrKmaON9icJCK5beSEf2Sq/eiWR2K6WV9ynAqPhYSiTFzTRnDWcdE6Kq7KpxIhq vv2cGwsRfoocxaId8cvudKXJvHUpWUHLpopf+U70O7qUjzA0G2dnje70PYzQ93jMXoNVNiDuDtlOg nusxcEoyvSfMj0PmFkYRBW6fJIbQEmPcdkwRp/66ygk3FZ07bZwkUhwhxUZoqZcIHlrjXFPa6aHbP NPyObctT9k6yXdGDl1mBJmL/g/fRU0P0e/fpcoomSna1BbEQnyabu4qpoiWVS+on/7Am2ZZzc91JC CxLhNwUg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkZqG-00000006iKx-3EUg; Thu, 14 Mar 2024 01:25:08 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, David Hildenbrand , Oscar Salvador , Miaohe Lin Subject: [PATCH 2/2] mm: Remove a call to compound_head() from is_page_hwpoison() Date: Thu, 14 Mar 2024 01:25:02 +0000 Message-ID: <20240314012506.1600378-3-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240314012506.1600378-1-willy@infradead.org> References: <20240314012506.1600378-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 56ABD40005 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: cpaoi4jq8n4xtf16t7zbijg59jfy3u19 X-HE-Tag: 1710379512-143825 X-HE-Meta: U2FsdGVkX19g3JyAt0BBpnZA0BbPx10eu+25gXf8ntCEKGDxwITdGxJIhRm1vDrTlHvc23yLMU7Z2kEnJDRODGUs+JZWLJ1E1QPQVlWLSvNYj+2OLkbQNFMeMbEf/Spc4SiDCo0K4/xGIBj5c210u9gbyE5W/IYtTPH5aloG2MaOvbUgiaziLmhJ/lg7NGM1jR32F8rGrly542JEPayKlyoFUMucWENifDjjru08wHXgLfAqX2nKuJ0Dc0BN8tADzQu93vp8SaIADJ5Zs4qDlDKqDUlKwEMlLpA8tbPoJK423WGC1z8uAb7+r1WZwW1Afd2sJQVxN/nREtR/NvfoLWmGba/i9JkDh+uwhmsyRoKygf90sS7V+C/vRr1XhkFF2NRtvFiV4r4CZ9uqL0XmHbJUl8EqbKLL2t/MiEsZxjp3bOg+cmu/nSSbmb/vwTq4QvxwD9Ox9iVYR/e3EU/0UabaqU6fQwlsqOMiwbbuXi4QeXXwBw/z9eEfHGfIjDTHBovINTazaewCIBeMqTThaGGxFmiARZVkfMogU6N+08zL5EITEH22VIPVZ1/N5G3JWK069BRX5ruCNis7xCnB9hrqCQhTC/p8pqC2toOC8MqQeDgNRPMhS4LQl9PRWiYpxiPGlM+hnaZbyDotaxzYjtlfmG2oP/S28PpiIi5mw1rVK4E1UtrgAmzzSwhSMb3jMnNc+gDQ6ggF8u475Aatz/c3MINEKwuZV7Aefyh9+IGtaOxKifyH6ST+wDKfKJsel8Dad0N8ultGq9cDllWmVe0JZ70y806gxQwyc8YSNntqbdcNex/XJBW5mFOOSgO9y2XnMFWSJt8V2PKTaWXnC4KW1paVCx7MvmgA4h1BZHAGNwMZZGQgG6u0hrSw8upH+BcMBUTABIDAqlSGs3CohIfNbFTfJtaf 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: We can call it only once instead of twice. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand Reviewed-by: Miaohe Lin --- include/linux/page-flags.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 6ebb573c7195..f1d65a72b378 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -1017,9 +1017,12 @@ static inline bool PageHuge(struct page *page) */ static inline bool is_page_hwpoison(struct page *page) { + struct folio *folio; + if (PageHWPoison(page)) return true; - return PageHuge(page) && PageHWPoison(compound_head(page)); + folio = page_folio(page); + return folio_test_hugetlb(folio) && PageHWPoison(&folio->page); } extern bool is_free_buddy_page(struct page *page);