From patchwork Mon Apr 8 19:42:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13621553 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 93B48CD1296 for ; Mon, 8 Apr 2024 19:43:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24BF36B0098; Mon, 8 Apr 2024 15:43:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FCF76B0099; Mon, 8 Apr 2024 15:43:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 029AC6B009A; Mon, 8 Apr 2024 15:43:03 -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 CF9D16B0098 for ; Mon, 8 Apr 2024 15:43:03 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B1C33160167 for ; Mon, 8 Apr 2024 19:43:02 +0000 (UTC) X-FDA: 81987387804.23.3BECF1D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id 1BE4E14000F for ; Mon, 8 Apr 2024 19:43:00 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=OQHXQ+mN; dmarc=none; spf=none (imf26.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=1712605381; 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=IOEzr5jyHmx6zA4lRzG4aI0kxVWdg++eH+7vTi2OhhE=; b=5hbqk2sxvjyUuBgs6smiPaz2fg5XoxYOOXIQsv4VyPHqlAcrH2I6Zl6dMs/SbBbNB5EoPh a6E5ZCJVZzxbsJI8fMDqg6dR4FiqSsCLQ28jH+akKhZWf5G6hBoafPauwV9fywIbQv02Ys Nn74m10vTpqXfpc1K2CRWPUK9NLY1+8= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=OQHXQ+mN; dmarc=none; spf=none (imf26.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=1712605381; a=rsa-sha256; cv=none; b=ejvCP4K2vwjZ69uRd9ZYTTiYdBZaZ2idT401jAbeJy5s5nnw7JQ4QVL+4pLvPmKORqL2OK wwSfFb5HbPVe1aix5KPBuOvz+CYjgPx6u+mlXUjSxBXTt8JsU8IYS0f5UxIoPkEveoZr1a lJLuUlB1OjzlOawJfYVBI07+yX2pJ/0= 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=IOEzr5jyHmx6zA4lRzG4aI0kxVWdg++eH+7vTi2OhhE=; b=OQHXQ+mNM4i+uj0nzcAfWtGEU1 +vUj5CWphF9dmjUsN2qhw/BN51mX7D8TaQEpZfT/5watWAvjyfK1yKwpPYn/1lWai9wgsc+PoOV3i VF4uHlcLrmIafTNTUcevXfZUUQ6GZUVQP08Nm5TSVcjoH+2+XJXY02yKSW0S6bEXOMGQaYXZY3qEb r3EQMMjfEmubzC1CY7HUprxpS+Yi6AaNHCOotvHCVFiKwnQNCNoOP7Jmp3LwD5QcGht6i+EbBNgVZ Ah4w84mvTngRruL1+LKWDKvgbTesPujvybNB8FuTj7gkEZm9USmuUwZf4tA+Qr0V2RmgR1RmZZIwQ nyaQ1Tkw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtut1-00000000UqR-216H; Mon, 08 Apr 2024 19:42:35 +0000 From: "Matthew Wilcox (Oracle)" To: Miaohe Lin Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH v2 10/11] mm/memory-failure: Use folio functions throughout collect_procs() Date: Mon, 8 Apr 2024 20:42:28 +0100 Message-ID: <20240408194232.118537-11-willy@infradead.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240408194232.118537-1-willy@infradead.org> References: <20240408194232.118537-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 1BE4E14000F X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 473menh6mxwssoxw16m8ygnq9b8n96rc X-HE-Tag: 1712605380-113443 X-HE-Meta: U2FsdGVkX1/4fgoalB/aewiodXWklKcF0W9wvjfymiuokTyOAAg7o5K7Zf6brJEKQkDNudQf8t5YWcEVA1fqkpOlJlARCPFU0z9q9ooIQpAKodYRASOn3p4xGl8xU32tBzvd66n0Ux+ak3tR9SW5P/ra0DXeMLeCqK5JHY8EUzgHEvomNSO7d1U5Z0TzHJLYM3MSEfNxkBYWAxbkRrlqlovRmBQbJN7lw/4NWCTt9QZ/9Ejopfb5eOHgkdWGkFaxigrIGLvw4CGW7aLl/9hbz9s9Oo+J5h98whZn54uHCdVol/W8F3jL0tm+Wg5fOWyj4eif/YEi2Mio1Vk3qbewBbo1NIfwkf3fOju5VU2uIZkNyG58JnOvhJsj96lQPv6gkngJsfGCe71rY7uJdvTFKmmTKkhp2kenU/0TxmBu+0U/Mb/7tNYBBOQkyQYQhR9MwmM6mUxAATfq3+890Twuz43lfepwbB7Be8KbyjzuA64GKeg5kn+2QW3A6jDWAZdm9lLkN57g/Ifi9wxt482JdX5ZyK8XgoH+0yH1g4b50BpV9WvlRL6QPDZz5QEkRiyHKBnsqYKe5KXVWq/Vg2K9CWrI9UMpfGpV4cfjiLR/ARzSNJ503lafArI3VFzpAmf2EFzZ67co/eAMfeJV9D+rIQ1P7TZfZVrQ2AynA2B0MAtY1xrZM2e7CFRyYihkjAQB/q8D2uQjIVRYJ+LVqEHjCLBGVzjCpSfeMHNK2vrAbnf7HPq1BIzddwqkO1l4QbuWmPgKnFXOCzo1O9ddLG1KKbVhvRA1szb2UQwkHvITDFKVahTP7OfwPSnzGg3+izUiM8eVZDNufNdL07PVp+kEI469iAO3+avggZaG+hMjFUxHDUKK6iSMjoWrj+JPRa88lRG9kqXZVMpf0/iEbGNDMgw1c2TMy2UWMqMccBCO1WqhgFJwh+f3DqGzRNOoRTG87aCp+E14pdix/+OqadR DRHjN7JG ChYmFxX9y/bcjYFZKJjLVwtaxiNSExCB6aoYEtJKxkJEtpGGJE3O2niHzZcAC+JrZfxUfcqxA+ZS2+zfE+ctEjz7qaGIO3EOT8Z9s1Sc4Jq4PBUnMH6dU5O75i1b1DMUHyPPwYhmSHn8EmuC3FuqNaCxPPziGGaGLtdluPqrJgYRro/i/bmUdGx4kzmokl80jUMGg4kJjTSYDRM3VyK0OfIRItZGxwLlQfAZL 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 --- 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 7caec2fc3327..1c3cf1fe4964 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -712,9 +712,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);