Received: by 2002:a05:7412:a9a8:b0:f9:92ae:e617 with SMTP id o40csp123719rdh; Wed, 20 Dec 2023 18:55:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzhnObvvBr0tjqyFohrRTa0mXbNNDjBcTQ2+6NDBrF5Ir0B5r6ic5Kal3DNxidahpq/IPA X-Received: by 2002:a17:902:ced2:b0:1d3:e876:990c with SMTP id d18-20020a170902ced200b001d3e876990cmr2719564plg.127.1703127350098; Wed, 20 Dec 2023 18:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703127350; cv=none; d=google.com; s=arc-20160816; b=fDlBezpnYLD4GieDicpRp8BlVNuVj8aUnOjJye9lnYYnxC2mdxor1zYt5sYPgudFSr VYf//TGYayxSxbaRspV26ORRhw+kGLLuUepX7S6YxWy5yu/Ocsw1gVeCBjuq8//ZxiyN DphBo3AA8NV4/ICyRMGunRBtGq7IoIRIVgXh3phWlmcPc7lor7lul6Ul+BLsfPsKaE0E y6EHNCO/K33badeyUwwTFs25u0gqCM366ckHfG3538gotUpyf2lHXMoazaSfTINA7Rx+ C48uMtFtwrnDtIYSzxZPObVKo2C5mIRiLh9pJP/DpdSxYq1tWEjDZcZFqAJIAKd0bC05 2pqg== 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=h690bWax6yOVJQKGadfFFXWsV5kXgvfQum64XdRnI8k=; fh=hi0K2Jnr4RT+PiOLlZYfIpX5x9s8h1JQMx3oMnKF2mo=; b=1I+JqyvhOWcjkiLDAe2swmFBIchTg4p3X8BhRYFbv/E6I/fOstuc0bkNh3SB4rk714 pRQeGdWG4Em8giAXzWQzoZdUDLSJLUFEWcpcRYjfy6PFXqhKpNxTejMmmBSkuAuH26vi l5c3i/F+jfWCMQi5aqVogCTNwxFFa5C/petTJh1EWw4lXsJOx+S9koOzVgTVB6nHwPON zUaxRY4rB+2ueHtsLE8EoEStP4Vd0G0faZcsto8u/oldZlkuWvQ0eChjw/v10K389WsN HRwBfPXR15zXoWJlUEbS9V7pt7CCVIQVO1KfW8msacRTpeVX7V4T8HDkrmdRsni0VSBb zkRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Q3s704m2; spf=pass (google.com: domain of linux-kernel+bounces-7763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7763-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g7-20020a170902868700b001c36018fdaasi680046plo.219.2023.12.20.18.55.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 18:55:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Q3s704m2; spf=pass (google.com: domain of linux-kernel+bounces-7763-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7763-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 42BF328474D for ; Thu, 21 Dec 2023 02:55:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57A7F4420; Thu, 21 Dec 2023 02:55:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Q3s704m2" X-Original-To: linux-kernel@vger.kernel.org Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 272753D6E for ; Thu, 21 Dec 2023 02:55:40 +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=1703127339; 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=h690bWax6yOVJQKGadfFFXWsV5kXgvfQum64XdRnI8k=; b=Q3s704m2bPeTWEOwmanmPMW48lD2m7QW6OaviD1J+XcWfNk9RPgtfELZLEZ95BwamrPb4b uE1y8jI+fa30kE9frMnMQDL9A0htEhvjTKuxaI/31vuNzqz3IfkwiYXjpVhUMCQN8uSWFu a/VLEuZF60ZYvmRXnn359JR6u/3i1wE= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Subject: Re: [PATCH v2 02/40] mm/rmap: introduce and use hugetlb_remove_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-3-david@redhat.com> Date: Thu, 21 Dec 2023 10:54:30 +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: <06731287-9E14-4623-9280-B9C43E12E021@linux.dev> References: <20231220224504.646757-1-david@redhat.com> <20231220224504.646757-3-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. > > Let's introduce and use hugetlb_remove_rmap() and remove the hugetlb > code from page_remove_rmap(). This effectively removes one check on the > small-folio path as well. > > Add sanity checks that we end up with the right folios in the right > functions. > > Note: all possible candidates that need care are page_remove_rmap() that > pass compound=true. > > Reviewed-by: Yin Fengwei > Reviewed-by: Ryan Roberts > Reviewed-by: Matthew Wilcox (Oracle) > Signed-off-by: David Hildenbrand Reviewed-by: Muchun Song Thanks.