From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BCADC25B74 for ; Mon, 27 May 2024 17:38:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C45836B0088; Mon, 27 May 2024 13:38:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF4D26B0093; Mon, 27 May 2024 13:38:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A95446B0096; Mon, 27 May 2024 13:38:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 875676B0088 for ; Mon, 27 May 2024 13:38:42 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 494C916146B for ; Mon, 27 May 2024 17:38:42 +0000 (UTC) X-FDA: 82164885684.17.9426694 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf24.hostedemail.com (Postfix) with ESMTP id 1C5D9180012 for ; Mon, 27 May 2024 17:38:39 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=JKtSKwrj; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="iGs8/JIe"; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="OYa+4d/N"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=jdFKt4D6; spf=pass (imf24.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716831520; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MT7sqn3x8UqZ+1AY3VOfJjHycbhLSUy95jECA+AD8oM=; b=DxxQ07+H6wp0dKFxX2EQaKR573bxSx8GLF7yNX/4u+jtmbVYxt03C1XQi8DZ52q6wcKFnc vr3cEyXT2No5bN7fy6p/aqYnFYLgQRuSMV1OrA92N7NKMblH9i9D3mJMi1EbhW1MECxtdL H6/MgwTYrzL+KeKufM3jZE1w5VrmYh4= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=JKtSKwrj; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="iGs8/JIe"; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="OYa+4d/N"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=jdFKt4D6; spf=pass (imf24.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716831520; a=rsa-sha256; cv=none; b=sOcZqXG0CsTS0lgz6EBjDpj0mCCi4P2FS7yuQ5STo6Ux5neeeExc8RgH09CDqkOVNXYxw3 9jxhDoiKRIKSohG8gfuRgJq73xXxciyJTRm6UW8xNcpEGZH9fYWRHut+RPn59+x9JpbkD2 l3m3beuNxaqpFEhNHHerQxN4wE9HqZ0= Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 568611FE7D; Mon, 27 May 2024 17:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716831518; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MT7sqn3x8UqZ+1AY3VOfJjHycbhLSUy95jECA+AD8oM=; b=JKtSKwrjmHagzP6RUYMXRiXwFEIABFC7f/bWAa/BCdiK9UiD5e4uS6p9ENrP0l207QfdaK fSfjHrpimQW0vPZ7iC7affgwAX3UYTXuJ/Z8mvIXAya/Hjav0y5/o4JGx8+ijZS8IdXWHL QhnYuASSPy6/Rgcmhp2WdCJgVRSN/rA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716831518; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MT7sqn3x8UqZ+1AY3VOfJjHycbhLSUy95jECA+AD8oM=; b=iGs8/JIe7rCcMdLVA7PNXtYwgdC6UB0aExVuW7ZzoRPpVqqriuspth/GNWs47jP7G+piUR j0mC7FPOI414uGCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716831517; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MT7sqn3x8UqZ+1AY3VOfJjHycbhLSUy95jECA+AD8oM=; b=OYa+4d/Nch5DSsggH81xf/Q1oo2yugPgafbWBqHIB6IP/JwfbsDA1LQRxtnEY+KlNlgN/L bwCVogufWxV4EMEj6H7mgdCQAgwFx+EwabyK5eFhvAlmnq6STeZSBSgaJdbY0evecPFiKi v5+nrfiDiPzIXrpm8ziQY8m7kkLoWlQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716831517; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MT7sqn3x8UqZ+1AY3VOfJjHycbhLSUy95jECA+AD8oM=; b=jdFKt4D6rQKp4EhxZ2EEhSFtydmFKSauIvzPcpTkovCA+dmq07/+pTm7ZjtG/zHUeGE4MZ zmSzqtAKjcNKABDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C3C4E13A6B; Mon, 27 May 2024 17:38:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id pYxmLBzFVGaDewAAD6G6ig (envelope-from ); Mon, 27 May 2024 17:38:36 +0000 Date: Mon, 27 May 2024 19:38:31 +0200 From: Oscar Salvador To: Christophe Leroy Cc: Andrew Morton , Jason Gunthorpe , Peter Xu , Michael Ellerman , Nicholas Piggin , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linuxppc-dev@lists.ozlabs.org" Subject: Re: [RFC PATCH v3 03/16] mm: Provide mm_struct and address to huge_ptep_get() Message-ID: References: <22c4ba7c-28d2-43bd-81b6-bd63f77d1d9e@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22c4ba7c-28d2-43bd-81b6-bd63f77d1d9e@csgroup.eu> X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1C5D9180012 X-Stat-Signature: rutfkke4ad3dsiwtnm65gp5zpxb3kkme X-HE-Tag: 1716831519-384052 X-HE-Meta: U2FsdGVkX1/4isPDEK5PTqPpu+iBqwV7I81Rj8SyxnyzintrIaYo1YkleBCFAA1kpDHE2p+fdrPvRYrABL6p+eVVBLksNkxPZL9C57t5v77J946XTHU7lBqi9cl7UspYD0oypvKNcMHQTmPtWLj0dM5FfT/RihGOK6FIgWeMiMTaxOcbRLn5khoLAJZEEX8Z9vDvt9aKG8TYce7I3mz3uuUY6FSd6qG7n6DxYQ/F+lEQ9WMuWzfJHBpNck0i9BRPFBWGKlijgdq2qMYXIXzhXiVcAzU6e3p5dEnEOpQg/VDQqs4bSuSZKS2kLbQ+9YRo3pVvzkSX+VIlmkfAxZIDSH+gjoUyI1XYHeppC4x4kFy50M/s1+dPHFjCgTDMAz0aYIg4iGaZ1SMaKWxdziEKuHVzrG1PFBgP2SJtYBEPKza6BRffTP4qzXWclRM4pyNZFXtb7V4oq3wwQPSiWWbJINK7m1VJLxeTUt43YohyYUgXeymaMReagGQpeeWhb06tbm2qGS8CPF+V91XbLzb+jiGZoOx+/zx0jnT4k5dVFQ44nIyYnq8xRVef+K0TTIQeJqCgWhy2aEwts7rXXHeP1jZ1GNpzRY+6vge84ZZHLNmDNJG1rn01QPN/JFtvJ3wrEKucIH6xrxiLcfTHpNdoWLdE3FuOuaaZOQ15Vz6Z0gfwnsL2Vi8fJwzkySMXbYQLUaZdnIMIit5VlaylxRg8GfHAuBxLDolZDvOIu+NEbH0ebyf8L8NXN7vd2Fq4zwHuNM7uHSBLaPe6rNLCMUuyOOZGczRQNaDXdHh9C8lX8MUx1Zhf7kFNZLK9sBYkKUSxxLwsude8ltk/Vl8YLujPfy3Ag0GspJCBHYAJqpRGH1hvdmr8CMVp5A7txxzViNLYOtkQjNEWmxaAtL9rIXzrP4sOZIn+mUWwq7av0fAGAQn2qhi6bHucxk6+lSpahaqP4xRL0eJNZu8WmT1xxXH bfA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, May 27, 2024 at 03:51:41PM +0000, Christophe Leroy wrote: > We could be is that worth the churn ? Probably not. > With patch 1 there was only one callsite. Yes, you are right here. > Here we have many callsites, and we also have huge_ptep_get_and_clear() > which already takes three arguments. So for me it make more sense to > adapt huge_ptep_get() here. > > Today several of the huge-related functions already have parameters that > are used only by a few architectures and everytime one architecture > needs a new parameter it is added for all of them, and there are > exemples in the past of new functions added to get new parameters for > only a few architectures that ended up with a mess and a need to > re-factor at the end. > > See for instance the story around arch_make_huge_pte() and pte_mkhuge(), > both do the same but arch_make_huge_pte() was added to take additional > parameters by commit d9ed9faac283 ("mm: add new arch_make_huge_pte() > method for tile support") then they were merged by commit 16785bd77431 > ("mm: merge pte_mkhuge() call into arch_make_huge_pte()") > > So I'm open to any suggestion but we need to try not make it a bigger > mess at the end. > > By the way, I think most if not all huge related helpers should all take > the same parameters even if not all of them are used, then it would make > things easier. And maybe the cleanest would be to give the page size to > all those functions instead of having them guess it. > > So let's have your ideas here on the most straight forward way to handle > that. It is probably not worth pursuing this then. As you said, there are many callers and we would have to create some kind of hook for only those interested places, which I guess would end up looking just too ugly in order to save little code in arch code. So please disregard my comment here, and stick with what we have. > By the way, after commit 01d89b93e176 ("mm/gup: fix hugepd handling in > hugetlb rework") we now have the vma in gup_hugepte() so we now pass > vma->vm_mm I did not notice, thanks. -- Oscar Salvador SUSE Labs