From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 ACF1C4419 for ; Thu, 21 Dec 2023 02:58:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="lxEIn+b8" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1703127529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=471qcHdzd4wocYNFZ/IDiWbxSCeMWRLKcRroMq5z/OA=; b=lxEIn+b8egcKMViXKZTjBRuiLHKMB3u8LZ2jmz11hdgMeD6pfzJI1RKvTl7jXrNWL4DQ7f hMuGGahDUJbGCdiWoJZ5B6T1ZDnzysSkyoWd/1e7y0gfrBSbciQKA8qrdeTyKLH+xYMU0W vgUUnPuKIYUlVbrrcHATggS4zyS0yyk= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Subject: Re: [PATCH v2 03/40] mm/rmap: introduce and use hugetlb_add_file_rmap() X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20231220224504.646757-4-david@redhat.com> Date: Thu, 21 Dec 2023 10:58:07 +0800 Cc: LKML , Linux-MM , Andrew Morton , "Matthew Wilcox (Oracle)" , Hugh Dickins , Ryan Roberts , Yin Fengwei , Mike Kravetz , Peter Xu Content-Transfer-Encoding: 7bit Message-Id: References: <20231220224504.646757-1-david@redhat.com> <20231220224504.646757-4-david@redhat.com> To: David Hildenbrand X-Migadu-Flow: FLOW_OUT > On Dec 21, 2023, at 06:44, 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: Muchun Song Thanks.