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 ED781C3271E for ; Thu, 11 Jul 2024 04:48:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73F8B6B008A; Thu, 11 Jul 2024 00:48:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6EFF86B008C; Thu, 11 Jul 2024 00:48:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 590B16B0092; Thu, 11 Jul 2024 00:48:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 39EC36B008A for ; Thu, 11 Jul 2024 00:48:20 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C322CC03A1 for ; Thu, 11 Jul 2024 04:48:19 +0000 (UTC) X-FDA: 82326240318.20.5FF73CA Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf23.hostedemail.com (Postfix) with ESMTP id 89F35140006 for ; Thu, 11 Jul 2024 04:48:17 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=BRayn4zu; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=NnZYUzAL; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=BRayn4zu; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=NnZYUzAL; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf23.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720673261; 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=CtB+qwSkgCiMXy5rm2CLlB2vE/GD+brI0Y88TU3Jjy8=; b=ct2iOmofxRvcrtqwLpWctCAMd3dxOVvSe4ofRiL57wwyzdTtVaYAmfUoW5hbZz+SdujszM frJS7yeqY1e10kM/CEptBf6wZb9bXgEnYSoXgfHp7XLZ3gkV7AvTJsIV2EI8PB36NQ0bxh YIfqHla08vvz7t9aaSyyepOJj+ePiew= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720673261; a=rsa-sha256; cv=none; b=2pD+aUKwLHicWlOM6ESOjffSupBgKic2rv3RBjmn2JvRMBpW3VfXOAN0tmatevhGxBVoVF rpj3XsdPKYh+i2Yw1yktuxt0czZwoVvlAaQxlsMSVPd3SlpF/CKmYRpizSYzPBfndkVnQi +It4kGeRjqikfrmzZxlexmjXQu3uMUY= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=BRayn4zu; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=NnZYUzAL; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=BRayn4zu; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=NnZYUzAL; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf23.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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-out1.suse.de (Postfix) with ESMTPS id A17C121991; Thu, 11 Jul 2024 04:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1720673295; 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=CtB+qwSkgCiMXy5rm2CLlB2vE/GD+brI0Y88TU3Jjy8=; b=BRayn4zutZuEMV5pssSc2lmbq5COjD7G8C1DNFDOm0pP78HcNjgA2TD3M85JFvr2WBi7Gc v4tJI2dYPasSGg65avPziWYCZHZTAodLeS5lthsOYZRHGwGAONNL1Yj2p1fG4sYnlNkRt1 czb/voyRLxfCOua/G/M56nt/h9tauAU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1720673295; 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=CtB+qwSkgCiMXy5rm2CLlB2vE/GD+brI0Y88TU3Jjy8=; b=NnZYUzALS+Q1URIrJhQ9FIE6zXoesaCKdZkz0jJMKPtyenVGTcwJpbISAoqgHEO+fMq8pb RmE7/CaRgceh9uDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1720673295; 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=CtB+qwSkgCiMXy5rm2CLlB2vE/GD+brI0Y88TU3Jjy8=; b=BRayn4zutZuEMV5pssSc2lmbq5COjD7G8C1DNFDOm0pP78HcNjgA2TD3M85JFvr2WBi7Gc v4tJI2dYPasSGg65avPziWYCZHZTAodLeS5lthsOYZRHGwGAONNL1Yj2p1fG4sYnlNkRt1 czb/voyRLxfCOua/G/M56nt/h9tauAU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1720673295; 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=CtB+qwSkgCiMXy5rm2CLlB2vE/GD+brI0Y88TU3Jjy8=; b=NnZYUzALS+Q1URIrJhQ9FIE6zXoesaCKdZkz0jJMKPtyenVGTcwJpbISAoqgHEO+fMq8pb RmE7/CaRgceh9uDw== 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 538A7136D6; Thu, 11 Jul 2024 04:48:14 +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 +TyWDg5kj2Y7GAAAD6G6ig (envelope-from ); Thu, 11 Jul 2024 04:48:14 +0000 Date: Thu, 11 Jul 2024 06:48:12 +0200 From: Oscar Salvador To: David Hildenbrand Cc: Peter Xu , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Muchun Song , SeongJae Park , Miaohe Lin , Michal Hocko , Matthew Wilcox , Christophe Leroy , Jason Gunthorpe , Ryan Roberts Subject: Re: [PATCH 00/45] hugetlb pagewalk unification Message-ID: References: <20240704043132.28501-1-osalvador@suse.de> <617169bc-e18c-40fa-be3a-99c118a6d7fe@redhat.com> <84d4e799-90da-487e-adba-6174096283b5@redhat.com> <9d5980e3-72e6-4848-b1ac-83ffab8522c4@redhat.com> <0f01c613-9e4f-47b6-af2b-09aa90437d90@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0f01c613-9e4f-47b6-af2b-09aa90437d90@redhat.com> X-Rspamd-Action: no action X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 89F35140006 X-Stat-Signature: mbruqtrue3a73u6f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BQXWcxC+s+AGUtU0MfXN0fmWpv4vMWniddOqbA64eet4bYKXMiyMcunL9W8u0iCs0W7LV1sXW3PQ5v8k4GnwkYrSYdYvqc1LWCqp+VYdPoTUR4satAU7YM5Lp22riafFmNqZZ4LdVyIzbcWuRLjlI/69G60Bj7D9/c2Lm70B3A2gTJTmOV9pS0gbtH8yShyUXTmVT2MQKjp5GgDFWftj0JRkuA== 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 Thu, Jul 11, 2024 at 02:15:38AM +0200, David Hildenbrand wrote: > > > (as a side note, cont-pte/cont-pmd should primarily be a hint from arch code > > > on how many entries we can batch, like we do in folio_pte_batch(); point is > > > that we want to batch also on architectures where we don't have such bits, > > > and prepare for architectures that implement various sizes of batching; > > > IMHO, having cont-pte/cont-pmd checks in common code is likely the wrong > > > approach. Again, folio_pte_batch() is where we tackled the problem > > > differently from the THP perspective) > > > > I must say I did not check folio_pte_batch() and I am totally ignorant > > of what/how it does things. > > I will have a look. > > > > > I have an idea for a better page table walker API that would try batching > > > most entries (under one PTL), and walkers can just register for the types > > > they want. Hoping I will find some time to at least scetch the user > > > interface soon. > > > > > > That doesn't mean that this should block your work, but the > > > cont-pte/cont/pmd hugetlb stuff is really nasty to handle here, and I don't > > > particularly like where this is going. > > > > Ok, let me take a step back then. > > Previous versions of that RFC did not handle cont-{pte-pmd} wide in the > > open, so let me go back to the drawing board and come up with something > > that does not fiddle with cont- stuff in that way. > > > > I might post here a small diff just to see if we are on the same page. > > > > As usual, thanks a lot for your comments David! > > Feel free to reach out to discuss ways forward. I think we should > > (a) move to the automatic cont-pte setting as done for THPs via > set_ptes(). > (b) Batching PTE updates at all relevant places, so we get no change in > behavior: cont-pte bit will remain set. > (c) Likely remove the use of cont-pte bits in hugetlb code for anything > that is not a present folio (i.e., where automatic cont-pte bit > setting would never set it). Migration entries might require > thought (we can easily batch to achieve the same thing, but the > behavior of hugetlb likely differs to the generic way of handling > migration entries on multiple ptes: reference the folio vs. > the respective subpages of the folio). Uhm, I see, but I am bit confused. Although related, this seems orthogonal to this series and more like for a next-thing to do, right? It is true that this series tries to handle cont-{pmd,pte} in the pagewalk api for hugetlb vmas, but in order to raise less eye brows I can come up with a way not to do that for now, so we do not fiddle with cont-stuff in this series. Or am I misunderstanding you? -- Oscar Salvador SUSE Labs