From nobody Wed Dec 17 06:14:33 2025 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) (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 5E445158538 for ; Fri, 5 Dec 2025 23:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.97.179.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764976691; cv=none; b=n14yllKETEaAq18Xk/SqMqSBkdBXcVIxsMOwrRW2rC/suzTlrltohEUfsliMf3ax2FuUAP2i+0xE3wlBZG/I1UYODnAM5rYu+1kt5k4kISo2CuzsO2RrlG65SxLcaqf9po4VCBiwTOw20ljk8pbVbI31ZkxZ9N6WRVu05PtZwtE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764976691; c=relaxed/simple; bh=p/o412RguFkWr01YOrKM53b9cWNVDSHVFFPWEZqLh5s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hmfwFUM3objIRknLeK9bDgamzFHE+qG3rUPDjoT6rQYG9MPnxYmgJ7H83Mpi+GRiLO3hTj1EkBxIQu5lhFDRdAYkiAQU6eQiZhiDXoxzM+B67kXWbMamow3Z1B7XNJ0gufBgtrrNeHyC2VhyAqYziIimQRLO+y7UfATHSIWIHrY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=cKtcg3xR; arc=none smtp.client-ip=213.97.179.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="cKtcg3xR" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4LFA2Xr7fMcablqz8itIRhQ151XIAZCDEKGvR05eMEs=; b=cKtcg3xRejri+aQdtkKyLd9t9N 2gbD13UjzVb/eq7Dtaj0Si9lRXYUo5xPQwNVwXqTgcUcggvPnCTIsnVcP/lJHgFyrw9e+j2YG8ijd fdUede/irfHVXPxKwpO8qmXNopCdGDhhiizfr7su/joYk5dGBCPYJzTPgbFjGeLoCGUN1qETxKJMK 9a1/N5DKH03U7NWAYPZVn7vpglikIhkilY2CcYz2L6AtV0WSAQLFHbjINi6zP3fmLaLDW7KtEMDCM D03yXQFO/AOInHDW8ZFGNBq8WPumFqLckFm1DxRG45xKgeU7RmzlbHNvNRYrM06qarIyCKUGIj78i rkKkzxUA==; Received: from 186-249-144-101.shared.desktop.com.br ([186.249.144.101] helo=t470) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1vRf3r-009H1j-8q; Sat, 06 Dec 2025 00:18:03 +0100 From: Mauricio Faria de Oliveira To: Andrew Morton , David Hildenbrand Cc: Lorenzo Stoakes , Michal Hocko , Vlastimil Babka , Oscar Salvador , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-dev@igalia.com Subject: [PATCH RFC 9/9] mm: call page_owner swap hooks from generic swap hooks Date: Fri, 5 Dec 2025 20:17:21 -0300 Message-ID: <20251205231721.104505-10-mfo@igalia.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251205231721.104505-1-mfo@igalia.com> References: <20251205231721.104505-1-mfo@igalia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Finally, call the page_owner swap hooks from the generic swap hooks. This plugs the new functionality into the kernel. Add a missing include in 'page_owner.h' to fix build errors in files that include 'pgtable.h' (thus now 'page_owner.h') without an earlier include that provides 'pg_data_t': In file included from .../include/linux/pgtable.h:19, from .../arch/x86/boot/startup/map_kernel.c:7: .../include/linux/page_owner.h:20:41: error: unknown type name =E2=80= =98pg_data_t=E2=80=99 Signed-off-by: Mauricio Faria de Oliveira --- include/linux/page_owner.h | 1 + include/linux/pgtable.h | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/page_owner.h b/include/linux/page_owner.h index cd95aacceba7..d7029d1e41de 100644 --- a/include/linux/page_owner.h +++ b/include/linux/page_owner.h @@ -3,6 +3,7 @@ #define __LINUX_PAGE_OWNER_H =20 #include +#include =20 #ifdef CONFIG_PAGE_OWNER extern struct static_key_false page_owner_inited; diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 23d30afe439e..ae397f5884d5 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -16,6 +16,7 @@ #include #include #include +#include =20 #if 5 - defined(__PAGETABLE_P4D_FOLDED) - defined(__PAGETABLE_PUD_FOLDED) = - \ defined(__PAGETABLE_PMD_FOLDED) !=3D CONFIG_PGTABLE_LEVELS @@ -1222,22 +1223,31 @@ static inline void arch_swap_restore(swp_entry_t en= try, struct folio *folio) =20 static inline int hook_prepare_to_swap(struct folio *folio) { - return arch_prepare_to_swap(folio); + int ret; + + ret =3D arch_prepare_to_swap(folio); + if (ret) + return ret; + + return page_owner_prepare_to_swap(folio); } =20 static inline void hook_swap_invalidate_page(int type, pgoff_t offset) { arch_swap_invalidate_page(type, offset); + page_owner_swap_invalidate_page(type, offset); } =20 static inline void hook_swap_invalidate_area(int type) { arch_swap_invalidate_area(type); + page_owner_swap_invalidate_area(type); } =20 static inline void hook_swap_restore(swp_entry_t entry, struct folio *foli= o) { arch_swap_restore(entry, folio); + page_owner_swap_restore(entry, folio); } =20 #ifndef __HAVE_ARCH_MOVE_PTE --=20 2.51.0