Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1668596rwd; Thu, 15 Jun 2023 13:59:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7eSvzg5IzS+AQYMRGqNSYWE6C3/dlM/6pf5Gdfv+nQXW8+4pMvxMN4+9wyPWIBdZ/06gwh X-Received: by 2002:a9d:64d8:0:b0:6b0:c4be:6549 with SMTP id n24-20020a9d64d8000000b006b0c4be6549mr349142otl.9.1686862748386; Thu, 15 Jun 2023 13:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686862748; cv=none; d=google.com; s=arc-20160816; b=tOgQOVdyEcrwAWIYP+J0AGAEoUr9KWM6LfjEo/WYGqdSGTJOTrIWfbGBT0I8cjjSSD dubeqTyfoJQX6Ff7NWB19ZD47R6K1aRSsThfFLCPOkm3pT7La+ChcjdXnx357MCfPXeC j5u+t7/4x33qPXTdhE/n/f+4K8Z/AOBEIjOp/6kFPcm2Lt2FOrwK+fRb2sWPxhN8iqYH jmonUL7HrfKM0Wuny7/VgGlbnVRwv1GKr6rQrFYD4MHVwlbt2QqraukV48sieBqOi8+5 M9I32ZGoVG347uOfRXdoEfZ1BJV/c7YE2jLpQ/DLeigSOBpDYE7xJ8Yvevxsml5FdTOu 0sAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hKMjMj3FplZLOT+91I/4pBUGTAnLqLsMd/PZxjoHeJI=; b=zBMAI3RVX23QDQ/6SHf5yJoipt1YrhNBse0Mj9lTFB7/9CI9mmzq8Ps3b5UnFCXStv oy6w57vH5k9NpC6gW0kV296vrOIlvmANH6T2d37z5G2obHoTiZTvY3n2TBizvv9TfZIQ jwLDx4dFqkdYZb++AynY+xuFXDaonvyykf6Gj9Z9XvmTVRlQ4LVflh30qYdzPUBY/wF2 Vn8aV/kLUE0Azfi5Yitf83mkGsRZbBJkxsAgxmn4yQ9LJRZboI9XMnCiFz5AjqSHjSHA IVMD0/ydaE/c8k1Jvcmdh/1tozdjomoAg1z4J6DbUfQxVijdTz/X0U0zJr15lazwO9Lu Njgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="VY/RFTEH"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a63b24b000000b005348464b81fsi3634168pgo.371.2023.06.15.13.58.27; Thu, 15 Jun 2023 13:59:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="VY/RFTEH"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbjFOUtp (ORCPT + 99 others); Thu, 15 Jun 2023 16:49:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjFOUto (ORCPT ); Thu, 15 Jun 2023 16:49:44 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E99A7199 for ; Thu, 15 Jun 2023 13:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686862145; 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=hKMjMj3FplZLOT+91I/4pBUGTAnLqLsMd/PZxjoHeJI=; b=VY/RFTEH78npZ2CTBhF5QX5iCnMcei+jL8WXQQqyKKEyoDBcDVBUqSXm6Qtt6BcdnS0WJR kiXaSaQxKJOX6Ft/YrHFF6U9uKpCjmDP/WzrLexJijqkFdKoanwh90RmgPsqqrJ5qbLl3H Qotg2eKDcq/F0k7Enkev0BB/7FoQXaE= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-3VlVldJ7Nh6QunpWmnK9ng-1; Thu, 15 Jun 2023 16:49:01 -0400 X-MC-Unique: 3VlVldJ7Nh6QunpWmnK9ng-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-62849c5e9f0so128246d6.1 for ; Thu, 15 Jun 2023 13:49:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686862141; x=1689454141; 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=hKMjMj3FplZLOT+91I/4pBUGTAnLqLsMd/PZxjoHeJI=; b=ISqYp+QwiNGBTrr8OGu2JrFco6aMvSqukeo8zWfdtwP8UI80S8KBo2R6nwFwffeqGm TciOEyyccy0+IZFe0hpPvLbmiC7zNHg43RVd6y9wRkaZtFinmGExmtC7Eu5kO73nwu1Y z+N3bqssq7YRPgkGq2lvWg3BwbfLF7/vpieOPhY9iP3ZZKoaPX1q5LnQXlftqPnzZW7i UdK31vcH/kZhvi66rUweU8pr3YHkInFZLRRiz3s3G2rMpkoWwqq9hk+SE7e3KlMpXunE LRRReSuxS91+/Yk7Gt3JEtPDN3tf+vlcWjX1nEDKR8mKtEd4Nz9Jlawrxg8dcmBG+hCd ZH6A== X-Gm-Message-State: AC+VfDweqPll1pef1YLeIyBUMdInxrQMB8zTurtJAohPCYxX2X84qKvg LCI5OjA6V3VTQJXjI5318/6x5jLrQWaoA4lrmI/1LG19zXz0T8xo9BE8rE9huoozQ5CRqUDUJPh Me2uECRc3rKoORyCSnXttvw== X-Received: by 2002:a05:6214:411c:b0:62d:f62b:907 with SMTP id kc28-20020a056214411c00b0062df62b0907mr205907qvb.0.1686862140897; Thu, 15 Jun 2023 13:49:00 -0700 (PDT) X-Received: by 2002:a05:6214:411c:b0:62d:f62b:907 with SMTP id kc28-20020a056214411c00b0062df62b0907mr205893qvb.0.1686862140601; Thu, 15 Jun 2023 13:49:00 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id d24-20020a05620a159800b0074a6c29df4dsm1117082qkk.119.2023.06.15.13.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 13:48:59 -0700 (PDT) Date: Thu, 15 Jun 2023 16:48:58 -0400 From: Peter Xu To: Matthew Wilcox Cc: Alex Sierra , jgg@nvidia.com, david@redhat.com, Felix.Kuehling@amd.com, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jglisse@redhat.com, apopple@nvidia.com, akpm@linux-foundation.org Subject: Re: [PATCH v9 02/14] mm: move page zone helpers from mm.h to mmzone.h Message-ID: References: <20220715150521.18165-1-alex.sierra@amd.com> <20220715150521.18165-3-alex.sierra@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Jun 15, 2023 at 09:15:26PM +0100, Matthew Wilcox wrote: > On Thu, Jun 15, 2023 at 03:33:12PM -0400, Peter Xu wrote: > > My question is whether page_zonenum() is ready for taking all kinds of tail > > pages? > > > > Zone device tail pages all look fine, per memmap_init_zone_device(). The > > question was other kinds of usual compound pages, like either thp or > > hugetlb. IIUC page->flags can be uninitialized for those tail pages. > > I don't think that's true. It's my understanding that page->flags is > initialised for all pages in memmap at boot / hotplug / delayed-init > time. So you can check things like zone, node, etc on literally any > page. Contrariwise, those flags are not available in tail pages for > use by the entity that has allocated a compound page / large folio. Oh so the zone mask is special. Fair enough. > > Also, I don't believe zone device pages support compound allocation. > I think they're always allocated as order-0. Totally not familiar with zone device pages, but memmap_init_zone_device() has pfns_per_compound which can be >1. From there, memmap_init_compound() does go ahead and setup pages as compound ones. Thanks! -- Peter Xu