Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp206219lqg; Wed, 10 Apr 2024 23:15:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVTDtIhgMTvu1PljlqvKzQ5diJ5Pa+QxtSzj/6oegbXIV1DgrEztK4MxdiriQIhXWMwoz4vGO9kFraMEHVGhQMXEehg/+Zd4gK8Sv0aYw== X-Google-Smtp-Source: AGHT+IGpeds/hvBtZNK32kR9S8UxLX9q14tkVmv6ITqZfRSgUmIXNVanrurOnLy/jAgX0ixSpbRi X-Received: by 2002:a05:622a:314:b0:436:6489:28ac with SMTP id q20-20020a05622a031400b00436648928acmr660799qtw.62.1712816110957; Wed, 10 Apr 2024 23:15:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712816110; cv=pass; d=google.com; s=arc-20160816; b=y/0pTkY70FUWGTnLiAH5ygMWEROhhRym1+JqN5jgpYNDNUJQ9tGKI9P3Y/FQ60uyM9 qAoC27jNBz88XhgnZ9lSl/dx+bXW/vXaR03qrftF/Y+WC9jEJhIuC/rMkVcj7QVnCxKO XLVCuALScbK6WMNH4KCXSo+CZlAAFy/jrb9tUx2HWODbVy5cZ9mMVkePDC1ZrZ3GSIEj +8RhXwnVb4v4o3M6VwqdvdJ3tFLlcVkBpNMX2k5gqKq2ZjLOcuAbXhr2iX9ie9YcCPgo gRvqFHtW05+ZIqk1LV2cl1S84EcQWzwLed/wBG5N3DT1vs1HzmgoI3/zxZXtroPtxmHd 6tkw== 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=bB4WH2pM8jvLy/cxq8hHZnYa/Dl93OmWdGl0309FAUY=; fh=WEMOZDYzhROtJ53Nx6fHy9wYEqwkxnRo6fKhqlB4aEM=; b=KpdIMHBMApWTW0+fBil3AdpMTuP/mqfJEOzdtmzco1RyGgnAkZUja/K8HRsxd/R1VE qh80ubSc9+GOxN089k08Iv+Tp4ulZX+0U1roq5kL+ndf1SqYSTNc1oA6uPP9MtfQYzJ0 WqmqdR4PQwei3VLQr1dAb/eIuyJcN0yUtFG+hAHCGxPybr+xUkzXB1lJa9iNSL6x2A38 1wH4BI+CYPvpPDlHk4qdyRDUhQaSTLQIvLEfAlE9AnoX3A1a/zR625PNz4sT6JH+SIgB yaLWmOdybP80BKaPNJ2OY6fe+mY7SFPFxVWcbjPvBBjef4vLhi1iPEbtzo4kSnn6LYew xSjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IeCaLcCJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139826-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139826-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z4-20020ac875c4000000b00434d23cf067si778206qtq.452.2024.04.10.23.15.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 23:15:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139826-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IeCaLcCJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139826-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139826-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A8B581C22F20 for ; Thu, 11 Apr 2024 06:15:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 251B313D295; Thu, 11 Apr 2024 06:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IeCaLcCJ" 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 50E5413CAB8 for ; Thu, 11 Apr 2024 06:14:22 +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=1712816063; cv=none; b=j0xHWAHVryMnyTG5XJoeUVjABYRo68sKMIDSnhex4yv3pkeb+DhNUl3KQ2+XFh4SsuB6nnB69OQFldrhzaIXCD9a8CodjSEh9RtrT0mWIzUF8X1mftzGrkmoDq6o7wyC0HaSujkLaJ9eYsH7wybs9eJXxq7nO9ncwjBH3Vh425c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712816063; c=relaxed/simple; bh=qC1mthl25nwOp6y3rOKx92fTxAINpkUFXHoU2+YaTrc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V6eqGTLfoOvO7fXNnKERBcwzpdrlfyD6UXiLBdWpzfHiHyqZ+lrxtYSWYXNG9NUEPOqT+1i/5mbgxsTzLPf/BN8x8qMSi0NPlIsHi81uVDPVZvXjE/3R30jsa/o9gogkxF7lq/clPAIJhUGuBmBqtgiuYFmGACkNwX3FWfup0JU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IeCaLcCJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF6C0C433C7; Thu, 11 Apr 2024 06:14:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712816062; bh=qC1mthl25nwOp6y3rOKx92fTxAINpkUFXHoU2+YaTrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IeCaLcCJY1GT60Q7AK9seqx+UVCi+HEDRS5ESPdYFwWmaoRyhC+uf8a/tp1U0dwjT wt6uBhs92tZ7dBvQAr+9+kTUJhGOXqlsZ006oR64EZ1MC85axd3cARsi2cW3k23YRX uLnA3kT7VS+kVAk04VJJBr4LxERj6mfwFZ+2LoOMpc8wlCYJgEKWVGTgQVENb+Mems C3vD9bBLeWtulpk4I7Wa+g01SjslvX8DWmJvfnMgz8WhRM9emVqFyfZSEQpbnQzwTX lMZCl8JaL46hQAO17OlxhJS3dshevOSZB0qc9ifR5HdY5RwAu5x3ZEfH+wU6dzA+xI +s6u98GnpUpOw== From: alexs@kernel.org To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, zik.eidus@ravellosystems.com, willy@infradead.org, aarcange@redhat.com, hughd@google.com, chrisw@sous-sol.org, david@redhat.com Cc: "Alex Shi (tencent)" , Izik Eidus Subject: [PATCH v5 03/10] mm/ksm: add folio_set_stable_node Date: Thu, 11 Apr 2024 14:17:04 +0800 Message-ID: <20240411061713.1847574-4-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240411061713.1847574-1-alexs@kernel.org> References: <20240411061713.1847574-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)" Turn set_page_stable_node() into a wrapper folio_set_stable_node, and then use it to replace the former. we will merge them together after all place converted to folio. 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/ksm.c b/mm/ksm.c index ef5c4b6d377c..3c52bf9df84c 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1109,6 +1109,12 @@ static inline void set_page_stable_node(struct page *page, page->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM); } +static inline void folio_set_stable_node(struct folio *folio, + struct ksm_stable_node *stable_node) +{ + set_page_stable_node(&folio->page, stable_node); +} + #ifdef CONFIG_SYSFS /* * Only called through the sysfs control interface: @@ -3241,7 +3247,7 @@ void folio_migrate_ksm(struct folio *newfolio, struct folio *folio) * has gone stale (or that folio_test_swapcache has been cleared). */ smp_wmb(); - set_page_stable_node(&folio->page, NULL); + folio_set_stable_node(folio, NULL); } } #endif /* CONFIG_MIGRATION */ -- 2.43.0