Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1555709lqp; Fri, 22 Mar 2024 21:55:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbu2MEWdG16WASrsDltKhRTXwQ/sVYn2H2sP72yBSWMtG4pqBCQ2aMeiOEu7cV6JEc1trjujyRjAiop0HvF4F+Z5VfL1VL7dtC6/gqSg== X-Google-Smtp-Source: AGHT+IGx20NMQdYhzcfyOCDGLm61nXPXTHEsqLgyFcRuJlePz8evdjOjlzju7ItA4IqQ6OhvG8oh X-Received: by 2002:a05:6808:2202:b0:3c3:9ccb:dff3 with SMTP id bd2-20020a056808220200b003c39ccbdff3mr1880623oib.37.1711169716318; Fri, 22 Mar 2024 21:55:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711169716; cv=pass; d=google.com; s=arc-20160816; b=QDwoxDiOv4RlUjp9cm8EVAvDVL07/epVxlNceM1Q8VonyJe7RfJJWPCvZZflzBYPki jKcemb5OE0eCtaBQIleG3eRebzHouFoH+tcbxdApNkGHB66KQT33cy4v3RojHsxK/bty Cr6mrPKvITogOIVN/+kGg+trRYlD0usVt7bUoobzkjCAND/qkFPrvpWszn0ffkxeMJ1A cLJir1GZIyRvmp+R1gi+H4RvSkT7vGw87UNBVwMaJkfaUv6A0UFP8Z0PqeQug6V/riQW vs5t2umdsqVHAtEhZbHrbPhmX/LL3PgP6KQLvSh1MNanx5Kk4KTFUmRc599Kpaqj/x5J uqzw== 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=LlUtxx4MKcpe94C+aEyNof/j9MR1zuOrpJuun+uWEcg=; fh=/apDblYSbH1yqxejbbPcvi5FufgRo6T7gjlq5W8K/T0=; b=oyRl0odR5g7YjoK/zHMfXnnlqQQmRs/g0a0SKKyBHPHSU765vzRqZ5O4klIu6hBDXh SpaG1OMOJGlCS6bzguIhedoydl5KBiov3koG6179Oaa9Xl+OWTWXoeHwf5WZo2rM1ZEv FTjBBuSZCZ2ZRS0KDNWdm2XC/yOqVVVpYPxhiVWoCUZv2DY6ZSEtD0/ajJ27MgLjzsdV d2hMKgqnVAxXlw7+7VkgoWOESdlaAkb5QFUi+WZBs1KGtlruABRjeALA4n046k3q3kdv csc1Ofj17Z3RY/ueTfK4qzoFPHCjL1Bgpz7UG7cqfjTQEpBI5QyYLq7ytcqFNQNcBfji bRMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=af2RyU43; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-112208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112208-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 n21-20020a635915000000b005df438d534asi3260898pgb.229.2024.03.22.21.55.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 21:55:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112208-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=af2RyU43; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-112208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112208-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 BAE54B224D4 for ; Sat, 23 Mar 2024 03:39:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B52FA3FC7; Sat, 23 Mar 2024 03:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="af2RyU43" 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 C958915A4 for ; Sat, 23 Mar 2024 03:38:51 +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=1711165133; cv=none; b=jTjiOJi36zUwKDKgD2CnOU8Dab3Iv0mRO5FolhQfPm7DVnb/jBRBfeujp8/mecgem/s4lEN0x+fYut6ddiltrBzqtOiRYp58E/bOJGaAF5w0pErRRp9RWjl2LmbGO1n2GQwSTKciOs5rUpq1EgGD9t3Qm+3VBUYYWFBwkDu8JJg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711165133; c=relaxed/simple; bh=Q7WJvsv2vJykZuu/0w2Jfa+t4L+nvMjZyFkUSVC139Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nstBH+52y1b434uWRWMK6rETdKdeFRsBFuuCLTnvCVSB7NpoSyf5O8tNdJA5NAtW4eMNzoV8uTwHv2iX972bNMTLbsOJGGxJG5ftiG5os3AxF51CYFXC7JnGE/7bGiQd4de6y0nqpLgQidxsq3CByQmByG4azovqgnowN3l9epI= 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=af2RyU43; 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=LlUtxx4MKcpe94C+aEyNof/j9MR1zuOrpJuun+uWEcg=; b=af2RyU43XXraGKNuDb6BZps0Zw axYU0B67WnrdQuphY6BQqqIp4qx1K6ewkb/pZR8zKhj8euv3qz3BvxZ2U2PatVEpqjZaBE8ncIy1h lq/oNYFVM6q+V9IYr0TH76SOHnBIZjlOjzXvwc9anOzeuzVBoI+N9eWWmfgveyh/MXRmMT6LZfZkA eWHq4lpwWFZIcOSAItCAGYSaE4x3qDLa52zciO0FE9/MtA41IEhoUhBzcFBFu4SxFXLnkmKJ2as9K iq5bvJ7vT9p3taYJ6p1KsOyCM/eooY9HC+yidWw9OhaPhTv6brroMCN8EbdJox6XNTqvtOC7ZZvjQ xyyfFo2g==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnsDN-0000000AtR3-3F26; Sat, 23 Mar 2024 03:38:37 +0000 Date: Sat, 23 Mar 2024 03:38:37 +0000 From: Matthew Wilcox To: alexs@kernel.org Cc: Andrea Arcangeli , Izik Eidus , david@redhat.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hugh Dickins , Chris Wright Subject: Re: [PATCH v2 13/14] mm/ksm: use folio_set_stable_node in try_to_merge_one_page Message-ID: References: <20240322083703.232364-1-alexs@kernel.org> <20240322083703.232364-14-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: <20240322083703.232364-14-alexs@kernel.org> On Fri, Mar 22, 2024 at 04:37:00PM +0800, alexs@kernel.org wrote: > From: "Alex Shi (tencent)" > > Only single page could be reached where we set stable node after write > protect, so use folio converted func to replace page's. > > Signed-off-by: Alex Shi (tencent) > Cc: Izik Eidus > Cc: Matthew Wilcox > Cc: Andrea Arcangeli > Cc: Hugh Dickins > Cc: Chris Wright > --- > mm/ksm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/ksm.c b/mm/ksm.c > index 15a78a9bab59..d7c4cc4a0cc1 100644 > --- a/mm/ksm.c > +++ b/mm/ksm.c > @@ -1518,7 +1518,7 @@ static int try_to_merge_one_page(struct vm_area_struct *vma, > * PageAnon+anon_vma to PageKsm+NULL stable_node: > * stable_tree_insert() will update stable_node. > */ > - set_page_stable_node(page, NULL); > + folio_set_stable_node(page_folio(page), NULL); > mark_page_accessed(page); I'd rather you did a conversion of try_to_merge_one_page() instead of just this. It'll be a fun one because you'll have to recalculate the folio after calling split_huge_page().