Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2832435lqp; Mon, 25 Mar 2024 10:24:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOs++EkpsreDLMI9OZEOGYdYy68SmFoj203vhm2xb3yk9MTGeNvfe2/iB+c9pPsezulxNfxcyE1zzg4Cf6ZImS1zZPBv1tUcvuiPNe1g== X-Google-Smtp-Source: AGHT+IHdrMxkbqx2wPg0go7ydrvQqdR6KMS/04ryWIfTtYh16+AwuGXzE6XYLUXmhw8KC8A0rWTw X-Received: by 2002:a05:6e02:ee2:b0:368:99c2:b6f9 with SMTP id j2-20020a056e020ee200b0036899c2b6f9mr293993ilk.20.1711387479174; Mon, 25 Mar 2024 10:24:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711387479; cv=pass; d=google.com; s=arc-20160816; b=WYf5mhYqyyxEbCCkxvigIRgigpdjGyVpKJR+6AhuLmrkoKryRxZ9G8gVtxrDCIh+jd ifMxiyqyxzr1gW5TkMA5jpYdd6XXVlqO1DNxyGl4CWQG7HtSiUw3rjSaPKwqoJmw2BLD 7u4Ox9lbiEUzzplUmyxL7tNkSTQB9owmXKLL+K68Giq46GfDJSeT2dOO2j1b2c5j9e6x dOo4aj8APY77fto3yfwlSOLptH4xKAH6I2r24exP2Iwa3KGcfWml+irGFBZx7ApxUyuf TexUbwn15fdNZqA8I7sZ7nIqITRJULH0m1R5Y3xYjlWGvKV7g6ubdZscp/b0uHxYPD50 WNTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=L+qO/XcqcIKAFhCFoyPhJG1UhlvKPeV2i/jpCfuNQwc=; fh=82Tkto9wLAThGWFPjMOHQAMNM/SHGFFIudThbRSmfJc=; b=BX9vqQbRxGUigsDvVjsH87CFMmUsCywgmUE1Yewbj6z0OYQ0nHeo18ThRFyq26ZPHV Y7TSS8Ss+y1f2OUMKCB6urvPZVNxmOlMW7Ef1849kDtEzNfNmp6bp5J7LwzKP9Xg4LYE E4HZHccIjFZUSRf9XN9TGlRueZ2shk237MeqrOA2WVZR6+SQObR8NUaWSYpi2+ufJJHN fStpSErKQvpB6aTvpwo98V3GmTv+hcWdIhaBsi3ON3iZxYfpYLo4L8Mm7BlK8gWDfqGT CBGQrwWptsC+1jrCMR1jTeyDQ+j2SrYWWvl2AUgGImPUGUs1qEp5pBP4BaF7XWq9ItG0 kuyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QjoZ6FgV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117039-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117039-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s4-20020a632144000000b005cecc6097f2si7927855pgm.895.2024.03.25.10.24.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 10:24:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117039-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QjoZ6FgV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117039-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117039-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 12D752E7BF4 for ; Mon, 25 Mar 2024 15:25:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BCC315E819; Mon, 25 Mar 2024 12:46:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QjoZ6FgV" 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 48E1615E80F for ; Mon, 25 Mar 2024 12:46:02 +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=1711370762; cv=none; b=GydTdjOkr3ETaAfM5H+CPtioJSBhU3PwVcwPchZTwvm8vUfckD7kWlI2KQoxDcwyI9uv3aAFfdUG5d1n5dGn7yCAMmGlMVKScwd7ubzsaLzYw2TvxS5taeiA6OX6M9rRGrVmtd3cyM3aoKtJtl33zHtIYaQ92Vq+/gScJgnTl7c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711370762; c=relaxed/simple; bh=3EngGDxtSZrFY+NPFGnfYU0Kocquv/KpfYgYZYqOFCA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EA0p7K4n0QcLkiWtmUvnknnx0L5nAOY9cRh67r/VyxxjMI5ZjYc9M8WnjznmUGwUUyZE2WTYS9cfEjTSNTJTrA9+au7ovAB6Ux15qkomYvgXaqTNP8u36yqn/eNwz5EP+8h+drU5oVsvjhUoAwqdDhnBuNmFnDNsYsbygTsrzqk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QjoZ6FgV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAFF3C43399; Mon, 25 Mar 2024 12:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711370761; bh=3EngGDxtSZrFY+NPFGnfYU0Kocquv/KpfYgYZYqOFCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QjoZ6FgVlpIls85bdewPna6oDmn2WQIkdvXxVa0PVuSTOfSnoi2GS67/7T2yzLGTU pqP+ZuzwlR93nUViU+yT+7Bo1vkuR/mInu4r5dalOt34sGCZ9YT8pBFxsswAhrUScn rL5f6uni+PSLCcHF3+sBGjcIr96ZecpdJaqpTwIBsEZo94tASOiWtA52AAQHG9ymA8 LQeACgbCBpU4vPjteVHgegKWJPmSOubP0Wr5v9+rVr00SleMoJB8IZu30VbCEFdf6y pg5XBGAOTY31Ro0NURQi8DmQmS+ykXp+MXa0O55h72zSE68tY9uPF5QTHq+1A4Hbeu 5pXqw9a5deBMw== From: alexs@kernel.org To: Matthew Wilcox , Andrea Arcangeli , Izik Eidus , david@redhat.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ryncsn@gmail.com Cc: "Alex Shi (tencent)" , Hugh Dickins , Chris Wright Subject: [PATCH v3 06/14] mm/ksm: use ksm_get_folio in scan_get_next_rmap_item Date: Mon, 25 Mar 2024 20:48:53 +0800 Message-ID: <20240325124904.398913-7-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240325124904.398913-1-alexs@kernel.org> References: <20240325124904.398913-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: 8bit 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 | 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_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, - GET_KSM_PAGE_NOLOCK); - if (page) - put_page(page); + folio = ksm_get_folio(stable_node, + GET_KSM_PAGE_NOLOCK); + if (folio) + folio_put(folio); cond_resched(); } } -- 2.43.0