From patchwork Fri Apr 12 19:35:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13628284 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 7E25EC4345F for ; Fri, 12 Apr 2024 19:35:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62FF26B0093; Fri, 12 Apr 2024 15:35:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 425056B0099; Fri, 12 Apr 2024 15:35:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2018C6B0093; Fri, 12 Apr 2024 15:35:22 -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 F02D06B0096 for ; Fri, 12 Apr 2024 15:35:21 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C0E3DA0E18 for ; Fri, 12 Apr 2024 19:35:21 +0000 (UTC) X-FDA: 82001883642.04.A2531C6 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 2C1C32000F for ; Fri, 12 Apr 2024 19:35:19 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=YohEe29B; dmarc=none; spf=none (imf13.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=1712950520; 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=wLkitv2Y32RPJ7Mlxb/OaGL8wYq141qqmEY7krwxabM=; b=EiD9jQ3q1P+kxfFltu2T0cmEl/WOi3eQ52JETcFAfxIubPnSu+3llwQtHgKqe1PDvNwG0D kHTlAWVvJr8xTW62Q8LAYWmetLLfJCDD/pBJCNkRG3D6O8P9lTQGev7JIDVpla1JydSnn6 iCtvQZzDjKarF6MkCuCbuh11ksk7Mmk= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=YohEe29B; dmarc=none; spf=none (imf13.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=1712950520; a=rsa-sha256; cv=none; b=7bvkRF78sjdF31sGo4xORMa4b9kcUb788096nrYv/jVxPhGgPAYya9nVroBcNtc4QhbC0k MrE2BU1YLX+zccL3eGpSTHeuMdW1/eSK4JURKzzlpv3SSsBYTZxCVF1EgqktQatzK4kICf 7PwBsOL9FKbekssk7HZ2i3Or35SyFWE= 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=wLkitv2Y32RPJ7Mlxb/OaGL8wYq141qqmEY7krwxabM=; b=YohEe29Ba2LnuxewC4/LKlOE1k Ixz2EK9RUepKremGUDAYoKzdg4FVheoTkJfxEurEGwO50X9fCrRuYYg8ZhHqwnTKq9ssZcph1mymf +6Y9Aiwx7Gktnh7xxQuIgf7z+V1PgTtHUWk7SIiZhItAS+CC8CLAK6eFLAzn/RjIsExzW2tcYmMgS ABKUDKdat+/5u5aDBXOQod40VbIQf/DEkUxMIKgd6maPyzPG8/X3dTuXMG4m7pJN3y4uA8vMo4/hY UPkK5ypn9SWPob2xx23V52D0kpNzamgWcLMDjjZlCuk/ngYaCx/g7VYvknuR/9etQc/e605HtxT7Y AH+Lqx6g==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvMg4-00000009t9w-1MZp; Fri, 12 Apr 2024 19:35:12 +0000 From: "Matthew Wilcox (Oracle)" To: Miaohe Lin Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Jane Chu Subject: [PATCH v3 10/11] mm/memory-failure: Use folio functions throughout collect_procs() Date: Fri, 12 Apr 2024 20:35:07 +0100 Message-ID: <20240412193510.2356957-11-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240412193510.2356957-1-willy@infradead.org> References: <20240412193510.2356957-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2C1C32000F X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 1ikudadxbwg7cy3t9zkb8r4q4zjhwtdq X-HE-Tag: 1712950519-109873 X-HE-Meta: U2FsdGVkX18OQX/6ta+yMrPc6vjPU+i7sbQhZiKy4b29nCqC6PNZnh7VMVVo/FBjPzZSp8D8IyVrFjvfYLheagNRPrX3c3M+l8SVgMsqM6hH7RaDjxc/y30Wes+CcAOhwz5yzL2K/m+hM1sU3xLvgA6DowdvRuM2z03pSqQ4rSqHwrlDlrhakjZZTFgFYPFDLbYrKI9hyb7AuDZnt+i1/HrZykKsrbDJ2cTrGMwPbdNmMxDDRLkluxEIse+m+SVtP25YJrEMapnLdhuRDWjbSDyAVy5E0jigbecUYZNibwNEAEKrb7UrvxLU01yxXvHaQLqazoU4sISosrFoilb9ty4G19ZRyDmlaCLGUCAgN/4PfaOSCnAv/SHzUJlbsV3ISt9bFGvahrXzZ4NkPhyWVwnagPDBFYnQ24GIdxG828mLXktMiAbqpaI4ZV3ejO6E3FFA3QO0CYO7Ffbs00hcdtuuFmbYz/gZEH9tS4u/cqDZBYt4CpPzPOZCzFx2DUUMsy9GnrVO7WJ0lDSUZdCyff5Jbe67dhxsPdwe/TqBQj3yrTKv7W4xi2yMg9qrYOb8zPgBPj6X6LiYSu8Up3jQSKSdvE3AAUeI0SUioLFzqdT/Y1sHyDkaR3LRr70pKQZaTMiiZ594i5dtiEXM6hFWoWEDmoAsq9JKTlD8PXtoaqPYA4z6Rm86L6tS8BQCKJKnb6lxvs7FOJA+SPK7ZLhroAQwMJvo/GbZrdCTUKy2vzpCNmrSOWdafB2Wkmsrwsc+g4oD8Yj2u9KG2gNkp/AvOxR9nqDSkZAYp3uhqvhcwaFZ7HOrUPYYF/S9XvvkG6DFKaXEn8kSZYq07oEfeETaIlmwSzUFmXq7UOstvs6AdVq+Pga9W5qsv23zPOKT0YKfS6YJ7+DvJNlFQe5OPbBJflDxwB2aaHdsacDppXvop+8FG614Qpv8MlB0NaNN9qf95emWjgJDw1f34vZyG6Z 1TZAfcni gZatnylfzmAa+Wso1HlWKVa7APSpTNQc8GTU6LrIfrkIcG1tWOZTEPvn92yiJ1wCrCXPZT2gQgUgvrBY+YCI1IPR+toOT7Pd3fLYD6fpBNGepRwujMyR9BA/3yT1wOqnHQu86j59tYRsMAtyJ4CYDoF5PLjPvZVnR1JqE804qRFaDpoddjQZb4B4M9ixrDlpZ67nAaFQri7Eq/9AM2wx4lPt9yC1D1wWWJYnZDvoroQ/QKMHYP0Id2JPQgQ== 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: Saves a couple of calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jane Chu Acked-by: Miaohe Lin --- mm/memory-failure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index e42c5f2179dc..a9fa5901b48c 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -722,9 +722,9 @@ static void collect_procs(struct folio *folio, struct page *page, { if (!folio->mapping) return; - if (unlikely(PageKsm(page))) + if (unlikely(folio_test_ksm(folio))) collect_procs_ksm(page, tokill, force_early); - else if (PageAnon(page)) + else if (folio_test_anon(folio)) collect_procs_anon(folio, page, tokill, force_early); else collect_procs_file(folio, page, tokill, force_early);