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 3B996C30653 for ; Thu, 4 Jul 2024 14:30:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB4216B0092; Thu, 4 Jul 2024 10:30:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C64736B0093; Thu, 4 Jul 2024 10:30:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2C0B6B0095; Thu, 4 Jul 2024 10:30:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 972FD6B0092 for ; Thu, 4 Jul 2024 10:30:22 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 623A3A1359 for ; Thu, 4 Jul 2024 14:30:22 +0000 (UTC) X-FDA: 82302305484.01.B0D10D5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 45CE64001B for ; Thu, 4 Jul 2024 14:30:20 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=iEJuLrVk; spf=pass (imf12.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720103401; 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=w/AAPZgMjlC+NouAvQxaat3L1IUvbO4yc2zitpvelSI=; b=zP+r0ZRV+2KK/VhGAusX1skKEYGKI4Oz/hTFTnpc98L0BAu46r3uAltl9QBmyV/PmHjADi yG3YMh04k9ZR5zU9jhu6hd9Zf+wBUWPovtrlH77y4uhgbIRC/fVla0SqQjb1If5IbmF6Pb QeUD/VPjHReqakMh60XMzKKuz/+l2n0= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=iEJuLrVk; spf=pass (imf12.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720103401; a=rsa-sha256; cv=none; b=wLpAE3XGjE4Pvg9y8knY5XcfaKxfZ6mgyTN12Cy1mPB3Ij+4OrQTp7Cxu0KbR/iu8jlJBp kvfoFKGUC3I1Zob15XP0sJ/G4ueOpW266E8keFJawsG0HzfgTIApejOYjGOG0QWzppoNhS QexVyx0BQ46yxZGulXshLzJZmZt2m1c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720103419; 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: in-reply-to:in-reply-to:references:references; bh=w/AAPZgMjlC+NouAvQxaat3L1IUvbO4yc2zitpvelSI=; b=iEJuLrVk8yN1I43ak2F+1nTz4dlcrRSc6E4nqvq5VLb9aEHNJJ6io7jx4utRYmtMnrDnyA tPnxJKr6FQzRkUQWdURyWJ+SGXgnUE+QkipaYr40yZppIkBxxPgaDIHfm0028Fs5HOyhcd D+wq4ewrGALhW/xcWjFSTD4fmU179tg= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-68-sCfbVUQvMr6o1Nvdee-BhA-1; Thu, 04 Jul 2024 10:30:18 -0400 X-MC-Unique: sCfbVUQvMr6o1Nvdee-BhA-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-79d5ac0e9c1so2354385a.0 for ; Thu, 04 Jul 2024 07:30:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720103418; x=1720708218; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=w/AAPZgMjlC+NouAvQxaat3L1IUvbO4yc2zitpvelSI=; b=Z0K/vp17jzUqbUa/F/60zVgVOSmHQ8LFHYve9ljY5QyeG/JvE5UU65LmiBshoElN9f fX6QauNaQ4zLTqy2oKiLrX6xtx/9P+LbpUkBbwqevPbshi7lwI4gcODzBlBPN4K7Opwi HWHcrZQrehZv77nXlaFTA6IsCI0YElQAtN1p1RnkwWLWZ6Cds04DjjKm4wcdcUsYE1sH i9D09IMPpaVwO5dv793jVnkd9wWMzCh46+FEELUQLBEc4mTqGAk+QgR9zZIeGuo300ur ro1mW3bvLtf9wPx35LYZiQMrkJCMHmmh9u6cl9LyW46JOUrvOHT5YbBkimfchBWKIRQj XX5Q== X-Forwarded-Encrypted: i=1; AJvYcCWVQS4fVrVCAK9pdQo+98uv8hPUUtphwgFJEo6ivlewfQLI4fCFDrl88tD6JbFPr+H8sxsUq8YoTwHknUnvmsXskGI= X-Gm-Message-State: AOJu0YzowZ8BcSotwZtGNbQC/4m06zyMJYbOqNd++R++uWg1I7UdomV5 FDm+nFU2claxt2gsfOebiAVtz+qamBuQvmY8CvmWyHTtfamYwnsLsQOnaenFq+WpXY17FVO3M8S d3yjfRYxcbfR/B0nmv+STtvI+Dd96NvZqcCOSpiz8E5dHbG/h X-Received: by 2002:a05:620a:5373:b0:79d:6273:9993 with SMTP id af79cd13be357-79eee26ee8dmr156437885a.6.1720103417638; Thu, 04 Jul 2024 07:30:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFj0u2XdT5CTZX+Koii9wFhsrVmpQ6ohxOQzjPcSeWjkjtqMUBPFWDoI8rAxzOAQLrY6Nq4MQ== X-Received: by 2002:a05:620a:5373:b0:79d:6273:9993 with SMTP id af79cd13be357-79eee26ee8dmr156435385a.6.1720103417282; Thu, 04 Jul 2024 07:30:17 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79d693060b2sm679117385a.104.2024.07.04.07.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 07:30:16 -0700 (PDT) Date: Thu, 4 Jul 2024 10:30:14 -0400 From: Peter Xu To: David Hildenbrand Cc: Oscar Salvador , 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 Subject: Re: [PATCH 00/45] hugetlb pagewalk unification Message-ID: References: <20240704043132.28501-1-osalvador@suse.de> <617169bc-e18c-40fa-be3a-99c118a6d7fe@redhat.com> MIME-Version: 1.0 In-Reply-To: <617169bc-e18c-40fa-be3a-99c118a6d7fe@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Stat-Signature: sdsuyqcd71b74sp9uxe41xxthypgocg3 X-Rspam-User: X-Rspamd-Queue-Id: 45CE64001B X-Rspamd-Server: rspam02 X-HE-Tag: 1720103420-861156 X-HE-Meta: U2FsdGVkX1/Mw9eMXRapsuxuQ+8u3zpeIrdbUyoXdQsFnTOHsQxbcklj/gVjOyK8WaGr7fUdsCxk9ymOeMhb7UMhjxHhP0RJ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qWw5FYMDUS8mxyGC5hAr0MBDi7F50OBu6+bJiT7P51YYn4FamKDLb8Cuw9ly0sQA2XrtHDqLX1m86P4UfCA4rLXvMorzaXCpXf5/R7jjVo5WfKWznVCMe/d+TIunWYswoXaXnUvFXuX42+Znpp1p03qFKUCtaarpZMgIJnZhgqU 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: Hey, David, On Thu, Jul 04, 2024 at 12:44:38PM +0200, David Hildenbrand wrote: > There are roughly two categories of page table walkers we have: > > 1) We actually only want to walk present folios (to be precise, page > ranges of folios). We should look into moving away from the walk the > page walker API where possible, and have something better that > directly gives us the folio (page ranges). Any PTE batching would be > done internally. > > 2) We want to deal with non-present folios as well (swp entries and all > kinds of other stuff). We should maybe implement our custom page > table walker and move away from walk_page_range(). We are not walking > "pages" after all but everything else included :) > > Then, there is a subset of 1) where we only want to walk to a single address > (a single folio). I'm working on that right now to get rid of follow_page() > and some (IIRC 3: KSM an daemon) walk_page_range() users. Hugetlb will still > remain a bit special, but I'm afraid we cannot hide that completely. Maybe you are talking about the generic concept of "page table walker", not walk_page_range() explicitly? I'd agree if it's about the generic concept. For example, follow_page() definitely is tailored for getting the page/folio. But just to mention Oscar's series is only working on the page_walk API itself. What I see so far is most of the walk_page API users aren't described above - most of them do not fall into category 1) at all, if any. And they either need to fetch something from the pgtable where having the folio isn't enough, or modify the pgtable for different reasons. A generic pgtable walker looks still wanted at some point, but it can be too involved to be introduced together with this "remove hugetlb_entry" effort. To me, that future work is not yet about "get the folio, ignore the pgtable", but about how to abstract different layers of pgtables, so the caller may get a generic concept of "one pgtable entry" with the level/size information attached, and process it at a single place / hook, and perhaps hopefully even work with a device pgtable, as long as it's a radix tree. [Adding Jason into the loop too. PS: Oscar, please consider copying Jason for the works too; Jason provided great lots of useful discussions in the past on relevant topics] Thanks, -- Peter Xu