Received: by 2002:a05:7412:a9a8:b0:f9:92ae:e617 with SMTP id o40csp124584rdh; Wed, 20 Dec 2023 18:59:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzaJmaiT2VgJPbqSzw0MFqL9mdoy5n4pN6mIIRbQkUhKgID9YJWExxgR+KhTKB3cuYnC5v X-Received: by 2002:ac8:5891:0:b0:425:4043:50bf with SMTP id t17-20020ac85891000000b00425404350bfmr26760142qta.78.1703127540377; Wed, 20 Dec 2023 18:59:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703127540; cv=none; d=google.com; s=arc-20160816; b=VPzeIj2FA/C+PFUjdqAEG0fnMPOXik0iKcOGisp95VRhVKWkiatewtN2qlQ09b02/+ 6vKdgYe4LtrvR4klV98dXhDrz1t8NDq9+kOYfj+oTQ9558fMIGrzeh+lfoJxgKT9e61S eBZ5FIh4Ws6iPKakk4q6PCVQEh8524CKZSW8UQIc7/ACjSBQja2WZTOQa2UunbZXa/mu VuRrN/PHuFEC5ot3LLjXwvzlnut+FuPaXeRlx26Gzmje8k/zhB556wUx+xtCPfPwHnHe OJtYv7N9sDZkvGOeyvHndpASC/yZ1F23qG1D5ro06kt+bTgRvP7cCxUKkPLJ4ARioHeb yGlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=471qcHdzd4wocYNFZ/IDiWbxSCeMWRLKcRroMq5z/OA=; fh=hi0K2Jnr4RT+PiOLlZYfIpX5x9s8h1JQMx3oMnKF2mo=; b=ofmM+SQJ2or0MsfzMO7i4PAL/Gs+Z/+N+T8Cn6A3SviMAbd1UCQxPKyG9cAr1GXEz7 tE4Lm3KN7EadJZyBQygE7iU3wKrAAWwIURkbecUcT79P33ocJCbrKVmj67ij97/HAZbm MJjh5HNoFPsjaTfRaj7Z5bAl304ag3vXA8+suOiVw+TrvtNmXMq6qCyDcDT82U3VsSdC nv8IMbj4LWdEPsNrnJzgKjEsZ2pYmXthrI9IbLRi+4aRPrzubwFWULtO4fZy+ngzyyon eil8rXJDiz3mw0WqlYgVPVdGjI1Dp5RUKUsFgGvVi+wfB/TaKbMS3JI4qNLn2XXnfDdI Yq4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=lxEIn+b8; spf=pass (google.com: domain of linux-kernel+bounces-7767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 19-20020ac85753000000b0042543e14e9csi1190234qtx.773.2023.12.20.18.59.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 18:59:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=lxEIn+b8; spf=pass (google.com: domain of linux-kernel+bounces-7767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 22BD31C2289D for ; Thu, 21 Dec 2023 02:59:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55E6D4683; Thu, 21 Dec 2023 02:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="lxEIn+b8" X-Original-To: linux-kernel@vger.kernel.org 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 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.