From nobody Sun Feb 8 12:36:33 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E30685953 for ; Tue, 9 Apr 2024 09:25:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712654731; cv=none; b=szMh0vxSnlES14cKdcpl+PIQdI47YxiR4lwKrh82tGY6cs2CblvJDLcoS/n/Dke5a3k0mRY2Xo1Z4sLsMOQ7PmIkfM0+pjXQwbZRXxB1XDZUMqZN0f7PiViqFgSeHIxfhlsfDLjwTtheVqubenmgJzoK/u+kQU8VilRMvItJAvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712654731; c=relaxed/simple; bh=dJ5DRDYCIT+gow/J5pRXi3ey1ZJ/tDnBvGy0lEgeqkQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=edWmum+Fxcs1N93Pa0YaxVx9zjSmjcXAR3u6CdR27ZoeqW/hOXoFLW04yQnbNTX3o1qaHLah6rJCnaK/0mrP1yHmh+C3tCkGpxtbCBwfKlpkEHJUx5ChYPIBoK/K5hcZarP+X7LktvQJkUTM9K1CCYxJvoah5Id9Qr7wiSSbE8E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gic+mMF2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gic+mMF2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86B23C433F1; Tue, 9 Apr 2024 09:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712654730; bh=dJ5DRDYCIT+gow/J5pRXi3ey1ZJ/tDnBvGy0lEgeqkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gic+mMF2M3oHglqJidfptsSOTIB5WDDSmFo1b/2IAIsAgt8Oz447ET1mybxFY1INy BgMffSGcxZEVDBTTmnHAZjUoxh3ayyAO9oI5fOFrMQIfWYjbl1kbAUnVI3tgxFAA1t WX6cYtXy20umo9u/uX+OznEJ9GemIxIa3Z1iYuqiNvdEQpTVsR0UbaCYphrDbKI2+k HCvjTjAm2AEyo67B3Vrn9+TIOQ6OXfMPFuEwHROErNbWDFkU7d6feG8hxPQ45Y5gti H8yg8goUkxXPDhDblpLIV2sIpGyk3ZceEplmGuo4cF1SvDwiALUVKeZYYN2/DUah6u aHaCRd7rZJIlQ== From: alexs@kernel.org To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: "Alex Shi (tencent)" , Izik Eidus , Matthew Wilcox , Andrea Arcangeli , Hugh Dickins , Chris Wright , David Hildenbrand Subject: [PATCH v4 6/9] mm/ksm: use ksm_get_folio in scan_get_next_rmap_item Date: Tue, 9 Apr 2024 17:28:21 +0800 Message-ID: <20240409092826.1733637-7-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240409092826.1733637-1-alexs@kernel.org> References: <20240409092826.1733637-1-alexs@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: David Hildenbrand --- mm/ksm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index aa80fbf3a8e0..95a487a21eed 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -2611,14 +2611,14 @@ static struct ksm_rmap_item *scan_get_next_rmap_ite= m(struct page **page) */ if (!ksm_merge_across_nodes) { struct ksm_stable_node *stable_node, *next; - struct page *page; + struct folio *folio; =20 list_for_each_entry_safe(stable_node, next, &migrate_nodes, list) { - page =3D get_ksm_page(stable_node, - GET_KSM_PAGE_NOLOCK); - if (page) - put_page(page); + folio =3D ksm_get_folio(stable_node, + GET_KSM_PAGE_NOLOCK); + if (folio) + folio_put(folio); cond_resched(); } } --=20 2.43.0