From patchwork Wed Mar 20 07:40:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 13597419 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 19728C54E58 for ; Wed, 20 Mar 2024 07:37:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DAB76B009C; Wed, 20 Mar 2024 03:37:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98B156B009D; Wed, 20 Mar 2024 03:37:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 806466B009E; Wed, 20 Mar 2024 03:37:58 -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 6C2D16B009C for ; Wed, 20 Mar 2024 03:37:58 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2E710A17C9 for ; Wed, 20 Mar 2024 07:37:58 +0000 (UTC) X-FDA: 81916613436.18.1B8407D Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf29.hostedemail.com (Postfix) with ESMTP id 31319120002 for ; Wed, 20 Mar 2024 07:37:55 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=gcdYDTwN; spf=pass (imf29.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710920276; 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=S51xzmjoRElqeNHM40zu12N4nDJ3bCoHpH+pG2n/2a8=; b=580RKEviS5TaKbF+sxuagvfxMafmuk0mnw0wyV3nW+QDDO+8YcxFN3qmzirPiF9x8WfycM pgc9wm9tFCYZq1e9TVmV2r+DFxuy8uKnY9qGcso9fpQoJsD8TCrwpBRlyZ7GdufM53Ahed 4f8+sRr4S5ps4poX7FBZ5ho/uTQl6lM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710920276; a=rsa-sha256; cv=none; b=jTQrqzvnCP1hVM9OcNdk8XXi333QsA/DIneviRCUBmoqJ7qCxQU71SYs0AzX+eG3KUeBYa g9+/m7pFe0nu+Alr+yK11DgNilEE4bcDwQ4t0TBpEQwd2fiIqPrxZg7LHdH+JiiceE3EPQ HFUqkeMZ9s+tn5kPGzsUL/kY2n5mxBU= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=gcdYDTwN; spf=pass (imf29.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 8CCDECE1084; Wed, 20 Mar 2024 07:37:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 783FCC433C7; Wed, 20 Mar 2024 07:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710920272; bh=4seeVX6AVPqZd4ygjF/loS0RJCIz9ENpBZHyDB1ONgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gcdYDTwNpPfOraYNtauQXzItCR4li8hYgUl6TNOp70HPLvjFG2OMzp63eiaHDkVJ4 lAQiNnL/FmDu2tGeykqradjGyyPa/riMOWFVA50dZoE5tjUOTyTWCivB0NUf4ZrLoA fXk6NuuqeTNyJVVuuLSoY8a7zoorFJ5HM06+E122HCv7C62/d67TiJISYDBBqXDASw MyCoEdgzJzMC+EVEbqI/DyO6j+yzlTpQeGAoyL3VrfpBmRCXr9VJmd7L4M3Yb+ZcXW NTgWZ7emrvaOYBFaEKJBAgDvaiqJPYAimCIhBECxGHQ31uddId4Ou16GQwAim0Vl+N vt2YiIJwwpK0w== From: alexs@kernel.org To: Izik Eidus , Matthew Wilcox , Andrea Arcangeli , Hugh Dickins , Chris Wright , kasong@tencent.com, Andrew Morton , linux-mm@kvack.org (open list:MEMORY MANAGEMENT), linux-kernel@vger.kernel.org (open list) Cc: linux-kernel@vger.kernel.org, "Alex Shi (tencent)" Subject: [PATCH 05/11] mm/ksm: use a folio in scan_get_next_rmap_item func Date: Wed, 20 Mar 2024 15:40:41 +0800 Message-ID: <20240320074049.4130552-6-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240320074049.4130552-1-alexs@kernel.org> References: <20240320074049.4130552-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 31319120002 X-Rspam-User: X-Stat-Signature: 9en1ccem8o7wzbhjq3qwwwgnsgr8p87a X-Rspamd-Server: rspam03 X-HE-Tag: 1710920275-398447 X-HE-Meta: U2FsdGVkX1/HjYqNf2+38IvLYFFfMxf2V2QHX+g/lekc3Nxi+an7SbnVy0JF1A47kLohOXxblvJBiJiWCxIqFS8/qqXIGy6NwmWoECqCcoTamhPyVzvNWN6EH1O8a1vxQAL58dN700jOtUUDv0U+F7qWemWpBnmIcmWeK/hUsMNXureu8xfIsALXSxpn7uzlGRQCFTVKBSYc0IfvgHCMZCFbroy5DYAanpDX9B/RZLtjzlR4+8O7PhCv5nBMHsWJySOjGCag26WmYECqXN9m7706iHXDwm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5FyuRc0FVdwOlrjUSlu3QinDEp+80yRNI1Cmfjc0ICcyf7axPW8O970aBbk0Yt5bvMnSFdvdcUZFk+03zLp6CpXXwjZtvZ1ufPeL5ssm8811Yo2fNqlyZs1gpgiNPVhq5PxT0vi 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: From: "Alex Shi (tencent)" Save a compound calls. Signed-off-by: Alex Shi (tencent) Cc: Izik Eidus Cc: Matthew Wilcox Cc: Andrea Arcangeli Cc: Hugh Dickins Cc: Chris Wright --- mm/ksm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index f57817ef75bf..165a3e4162bf 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -2597,14 +2597,14 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) */ if (!ksm_merge_across_nodes) { struct ksm_stable_node *stable_node, *next; - struct page *page; + struct folio *folio; list_for_each_entry_safe(stable_node, next, &migrate_nodes, list) { - page = get_ksm_page(stable_node, + folio = get_ksm_page(stable_node, GET_KSM_PAGE_NOLOCK); - if (page) - put_page(page); + if (folio) + folio_put(folio); cond_resched(); } }