Received: by 2002:a05:7412:a9a3:b0:f9:93eb:408e with SMTP id o35csp10844rdh; Wed, 20 Dec 2023 20:35:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IGS8sJqKxf7hN5DFzPe+vGXbtd/a2/Xfi+gl8grcOKTAGa+z8OK+Ac7ES3rRWQX7/zwPmK7 X-Received: by 2002:a05:622a:1ca:b0:427:8aa6:80ec with SMTP id t10-20020a05622a01ca00b004278aa680ecmr2710488qtw.34.1703133357696; Wed, 20 Dec 2023 20:35:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703133357; cv=none; d=google.com; s=arc-20160816; b=uR00riSaqV+E2erxJMNNw0U5kWAR+8IsvRK4UCQ6GTz4a6JGD+w5W3IgMu4vfGpTfw BBjHOIFfi6uvhyMgShSUjLNLucnlrDbof95xZHhKS+F1qHyTH01LFudcwyZZU6gLJTY9 EExBrXr/nPVQjDnXK0tZCuT9KOhPUl8K2p41oUp794I1V9v7Wo1xAUvo28bBc8jvvbE5 XkXSjC5aWh6srgPdsEgvDIQeCJFJgVn68CDRSLYeEgHeG7f3f9RzUqMzMNJvbkNUbZku 5GFJI2RJe/cHGcLu7riY2+PTZmVqUZWzVNaSPSqAODoK0PboD93mw1dbgdo5T38xRTbl 2cdg== ARC-Message-Signature: i=1; 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=tIcyVTUvWTVmkOSCh+ORFYZ85sHYJlwaK0XklBB5ZHE=; fh=nl1WOPtpgLTDn7jj2iUo+PQab59As1DE1VCzg2MI498=; b=bgy9U1VNap8PRODsclwPsz/lZBK7Nzps0rh9Rm6BjHZ6BDXZcsNLK6nOyTks/tHqbZ kt5FavljmK5+EWYVTFmaonvAynAf69xGoUOl2RqbWXpYP0U4NIVLcERNmz7L+RuQoxIJ obKLyePj+kNnBuNWZR2KNthNtonwVAR4HHIRzDEYvC2ZdlRqFN16k16ampV0yBAn5OZo Sz2bNWkPwM2xdfVLXMUtOBtqCOieAMw37CrgB5tNDM4/maeEwdYXuG9aq5DJWOWeufin ZkF3j11zzK6cchvAV8Cb0tTtYwLpBrRJvZTqBWkJqJyM6L5l5F6fJpwJOuHPkLberbeu gs7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=J5SiicJF; spf=pass (google.com: domain of linux-kernel+bounces-7837-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7837-linux.lists.archive=gmail.com@vger.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 g3-20020ac87d03000000b0042395ed75f7si1296151qtb.663.2023.12.20.20.35.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 20:35:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7837-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=@infradead.org header.s=casper.20170209 header.b=J5SiicJF; spf=pass (google.com: domain of linux-kernel+bounces-7837-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7837-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 751651C22EDD for ; Thu, 21 Dec 2023 04:35:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDAF98C00; Thu, 21 Dec 2023 04:35:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="J5SiicJF" X-Original-To: linux-kernel@vger.kernel.org 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 C1A357465 for ; Thu, 21 Dec 2023 04:35:49 +0000 (UTC) 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=tIcyVTUvWTVmkOSCh+ORFYZ85sHYJlwaK0XklBB5ZHE=; b=J5SiicJFI/O/bVfWLC9VcRBwHF U9hmYBbfiJcPZjDG2ibyXMa6qthx6h+v1tv+yKoz8BSXG+O9i2PyPnRFoIoAiUpb40np6jruW3neX Rm245sI6RMSP2h/ABE/mi5SJBBt6i4yfpffDKbQEdS58o4KyKbEVy+opaWPCYmYidI9VioICu3Lw4 VvEFkmZnKdQxBtV7BhngNLutAN3EzV1fNkboU9hAr/SNOGQnFvRHXKOz5yrzEptmSR1KGrciuzwrt m5HXofIZkyJ4YlEq4VMO2VY9T4mol5Ol3ZAv5rujEEhLxQcwSKWT2YEtsz11RjkvjH3Jwyjnj3gGD FDueA0yw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rGAmg-004f5Z-Dq; Thu, 21 Dec 2023 04:35:46 +0000 Date: Thu, 21 Dec 2023 04:35:46 +0000 From: Matthew Wilcox To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Hugh Dickins , Ryan Roberts , Yin Fengwei , Mike Kravetz , Muchun Song , Peter Xu Subject: Re: [PATCH v2 03/40] mm/rmap: introduce and use hugetlb_add_file_rmap() Message-ID: References: <20231220224504.646757-1-david@redhat.com> <20231220224504.646757-4-david@redhat.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=us-ascii Content-Disposition: inline In-Reply-To: <20231220224504.646757-4-david@redhat.com> On Wed, Dec 20, 2023 at 11:44:27PM +0100, David Hildenbrand wrote: > hugetlb rmap handling differs quite a lot from "ordinary" rmap code. > For example, hugetlb currently only supports entire mappings, and treats > any mapping as mapped using a single "logical PTE". Let's move it out > of the way so we can overhaul our "ordinary" rmap. > implementation/interface. > > Right now we're using page_dup_file_rmap() in some cases where "ordinary" > rmap code would have used page_add_file_rmap(). So let's introduce and > use hugetlb_add_file_rmap() instead. We won't be adding a > "hugetlb_dup_file_rmap()" functon for the fork() case, as it would be > doing the same: "dup" is just an optimization for "add". > > What remains is a single page_dup_file_rmap() call in fork() code. > > Add sanity checks that we end up with the right folios in the right > functions. > > Reviewed-by: Yin Fengwei > Reviewed-by: Ryan Roberts > Signed-off-by: David Hildenbrand Reviewed-by: Matthew Wilcox (Oracle)