Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1644709lqt; Wed, 20 Mar 2024 09:45:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZI+iyvwZ+TWfu1JmwgaW1asG9TAErUXOdy/qxxLqKrjUZw1Awo51JQzUyySr/t9wOEyKc+O6aXkkbVbwS5ofkBp8Xljusc6yKW3lfew== X-Google-Smtp-Source: AGHT+IFh46MPoTQI6xyQeFuRDPH6X+FfmfbhT0hYJndfZ8Moofk0EmtaAdbZmBoKhs90f+x3U9c9 X-Received: by 2002:a05:6a00:b4a:b0:6e5:561b:4670 with SMTP id p10-20020a056a000b4a00b006e5561b4670mr20554963pfo.30.1710953149886; Wed, 20 Mar 2024 09:45:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710953149; cv=pass; d=google.com; s=arc-20160816; b=VdOz/miNFETVAf5lAcjiztt5rLPxaM9YymZ72PRn8JLdPCppVVESCcpLwyq2hZcI/u MEWs3eohx/w82hOYq6vF6zSXYL7X8PyaGBZernKX6kBCrwpdK83/he5GMx2MqSqM5iLx xZ8T2VsOw8yK9+523z5J3JzzumUnigPQgMuxCMUjOfiCpCMObc0nY3hSLAU33bu98VM/ E9qkVecS1fxLdL7GHNpl8cg+D3sXMgJUDZ+Ah1rajUb/PbMc1QT4KskqLxgk4pwOe2Sc jS7MsNgumx71h8qAz3AEPabQhX42DTCI4Buw6pSW7zxA0YH/K6+sPTJqE6yfKOWTXKbL JxjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6H2VrsJPvIBusad9w260eghYblSiBWSXqydVmnydmLM=; fh=ieeEHCSmkFZzD0II1P2iPLHoQdL5rt4/kKBbteAFI8k=; b=fVy4NjXRcN98JYYAvvSwQsiMjUVsIF8OLnIu+GwVtEmJSB4eFpkZ+kCHKgRKWRGZx1 EHVa/zX3P79Pgkl4HGih7rWanETCyTIyD0uIZDsLvLYu30xqrbi+68+E2ggWGMA6gsRj Pu7ch7UncioqcYpOltTAxjmBzdtCHUvLwACL2g3kWX+1rsLmK7BzAaXvaybJC++LjoYM tUmoPu70Q02BzDKKn2+OV/Ug+2i7J700cKV3dZg6leMJffu95FhFha6cLWYwcTYAC1eI o6dAnSXFHa2ACOhUrqxNnYDZ84TtWuGWjaFFYsX5S41sXx3QiwmElb0KIi4IbN1CHbEX t0lA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YrD+Wcvw; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-109092-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109092-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fa31-20020a056a002d1f00b006e6265d966fsi13871703pfb.359.2024.03.20.09.45.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 09:45:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109092-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YrD+Wcvw; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-109092-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109092-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C899EB22DA2 for ; Wed, 20 Mar 2024 15:27:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83C5256760; Wed, 20 Mar 2024 15:26:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="YrD+Wcvw" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 2D52056443 for ; Wed, 20 Mar 2024 15:26:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710948384; cv=none; b=l6Emd/mC97k3C+2ikTCXsQ3X8YjNRU7w5Qh0err+LxSCjgZlOM97ML7a8uPfYD/joLIhrqHq/7oO9Cq84tTF5jg8lRkeV36uFuXUUQCbGeuTHkM+mt5lfnGTqgzJKeSoA29Pvycm7PxpGf315YOjI+GKlopK5JvLV4I9ApVkW3M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710948384; c=relaxed/simple; bh=JjjeykGzgnfQed95HEXTSgvvfjBVVcv4C71TtqIX6+Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ETid5O6yhRl0y5VWVo1pPU7sJQALeHveNKEr4JLhFWklBO8F+O596RP9gjtq2RKlzLSGtAq8Tc/fnhpWP267k1i0WzqiXCt7K5sITGvbyYYfChSEwb8CvK5Ezu7v+8V+PY/n5IqYNAJno0+Tl8O04tpl1/ZElfnIQ298ljNXycA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=YrD+Wcvw; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6H2VrsJPvIBusad9w260eghYblSiBWSXqydVmnydmLM=; b=YrD+Wcvwx2bJM1ESgcaNERrVAe qEyALxKKXv8LwVp8hBZlatltvaJZ3KlGjjMjYFkmK429NNtMIHBhuRDGQTXHV4p4wzlxvKTKPvTrx G1dxO4C6YWUBjFlPwMko3aJolkShkKYFfdrWFxFZSvE6nXKaiLEKwx5pqI+iu/tPGPRnpjxeIQcbl dPZvdcvAS8opSsNWuZbKhKU+DwueaHI2KTE2SC/vDAD81NPL8uJsosYfPQl+RfGmqEyGVA+I3WD9X 1OIisBF9L7cra+PWumYnIEGry9/vusAXwTvyp+JMaeLX5U+SEA0bngKd61Z5i7VYywO40IfdidiVl GfM+5fig==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmxpS-00000004ZpL-0V6A; Wed, 20 Mar 2024 15:26:10 +0000 Date: Wed, 20 Mar 2024 15:26:10 +0000 From: Matthew Wilcox To: alexs@kernel.org Cc: Izik Eidus , Andrea Arcangeli , Hugh Dickins , Chris Wright , kasong@tencent.com, Andrew Morton , "open list:MEMORY MANAGEMENT" , open list Subject: Re: [PATCH 09/11] mm/ksm: Convert stable_tree_search to use folio Message-ID: References: <20240320074049.4130552-1-alexs@kernel.org> <20240320074049.4130552-10-alexs@kernel.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240320074049.4130552-10-alexs@kernel.org> On Wed, Mar 20, 2024 at 03:40:45PM +0800, alexs@kernel.org wrote: > @@ -1820,28 +1820,30 @@ static struct page *stable_tree_search(struct page *page) > struct rb_node *parent; > struct ksm_stable_node *stable_node, *stable_node_dup, *stable_node_any; > struct ksm_stable_node *page_node; > + struct folio *folio; > > - page_node = page_stable_node(page); > + folio = (struct folio *)page; These casts make me nervous. Remember that we're heading towards a future where struct page and struct folio don't point to the same memory, and part of that will be finding all these casts and removing them. Please, unless there's a good reason, just use page_folio().