From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C04C175A64 for ; Thu, 19 Mar 2026 18:41:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773945664; cv=none; b=P0FcBufC+V1E0bubD6zxpVtXFYHh0PhPPNz0eYvwvjr6VvFHB/KoIM9W9xMPcTlnH8bukW3KGRhtgNet2wpQ6F3Q18LHI2Sf5T80GfZhKM9MdGc2IBN0lJw8Qt0AI+wFpd5oRGgv9o9S9pFP5QxzM2S0b3pCYm/Y8Lflida0ed8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773945664; c=relaxed/simple; bh=IDSoPyNCjb/F6olt6wV4ZERNWivOsvjcZOYXpqQe1Wg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=VAJBpsIh0DZJ3wNnkNyvpFrbiodapeHWjpryqOVIQYrZXSgKUOjKo24vXFpGuSfgNfswycn/nEZfOGxbtYCt8vg1d70f4aQO27vQZfVNbtv7vLfS/CVGRCF82FV8+aKv+Y/WVSSph16Lzu0HU1YKIiddOl/EzI3gphWLvsQw0+A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=dBlb4R1m; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dBlb4R1m" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-4837b6f6b93so14986285e9.3 for ; Thu, 19 Mar 2026 11:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773945660; x=1774550460; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=wj/eHDFDJECgbC1JujhfrNs1ie4hmcl+U/ekk8UfMck=; b=dBlb4R1m29YsbqmzzPXuj/2WYCte/VfpocBQPCX/wIwZkaxDi6VJjUYj2sB5UMdCyI adPIJ2FIwm46y7cwthj2+1ZDT4W9QlF5rTfgq629vaQEaTCE74y8c491eBbgVjgNgO8q cqQgCkSRLCRDYrJS/H8tQL+vdBbD7TLZfatnwe+MwoYeQQU8SwPW/TzWXNO6YYDEsvCR RQkVTCFAbTysonMV31GQYxz4nRuWgItVJwyloVrGbXS5TU0oysKsKKrf9nmKoEEgLrBZ xR7g9Bz4ynrYVekFTK6FQ6cyT87n9IbOIx11fW9JrNJxxPmvgD8QWn2OYIFKzTnJRdDR x+aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773945660; x=1774550460; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=wj/eHDFDJECgbC1JujhfrNs1ie4hmcl+U/ekk8UfMck=; b=XSRxbzXzLhQo9/P/EtxvfU/dxQy00VJHhI7b4u9j8W5PWTjUGpOgKEnckCx6SHkYpl pkFifiRyb6j/C7CP3kj4vkU8tMjPulKvhkPEjOvcuVTqEbs0y1fs9YqDPdAfJQTkMtIU Fwfffe4NGRGUZS86ueK6dZr+fmITWd+zdrsMqGVEpvxamjDwJOzMgvzPE4h4KrJZhWfT 8u84soTMe7p1T7DrINMBUp8LCRy5kZ21n1MQ3HSKKVTMg3wqj9mwF1+ZO3W5tEzKqxrT y1fuBnYCglY3qNuAKAUdrwFPxCV9IgXN+nTaNd6S2ivpclHdzQtTPLaBP/GB+CbVg8Z7 B9uA== X-Forwarded-Encrypted: i=1; AJvYcCWFgA63vtoD8/eIBEYQhjnQXM6GeAzi0MeuHL7CWKmWcJp9zOVjlkaa1LSrxiSzRMTsrg4H//V2Q7ekQoo=@vger.kernel.org X-Gm-Message-State: AOJu0YxkgdC6yWEVnMcZ62YuHdkMpv7UrvaPKckpC/89+ZmfiS/xFqiy 9nB6Gj0pAByuPtFpQhItMOO/b+nPhC91vw4c+7Ngopzlh3CXx/AM8e1uVc6FBd8WpI/R1jU5sb/ Q9sT7L0KYfoMu8Q== X-Received: from wmd25.prod.google.com ([2002:a05:600c:6059:b0:485:3925:a795]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:8b83:b0:486:fa9c:185 with SMTP id 5b1f17b1804b1-486fee2ffd5mr2113575e9.31.1773945660383; Thu, 19 Mar 2026 11:41:00 -0700 (PDT) Date: Thu, 19 Mar 2026 18:40:59 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260319-gfp64-v1-0-2c73b8d42b7f@google.com> X-Mailer: aerc 0.21.0 Message-ID: Subject: Re: [PATCH 0/5] mm: Switch gfp_t to unsigned long From: Brendan Jackman To: Matthew Wilcox , Brendan Jackman Cc: Andrew Morton , Michal Hocko , David Rientjes , Shakeel Butt , Vlastimil Babka , Suren Baghdasaryan , Johannes Weiner , Zi Yan , Harry Yoo , Hao Li , Christoph Lameter , Roman Gushchin , Uladzislau Rezki , , Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu Mar 19, 2026 at 4:56 PM UTC, Matthew Wilcox wrote: > On Thu, Mar 19, 2026 at 04:03:23PM +0000, Brendan Jackman wrote: >> As pointed out by Vlastimil in [0], my proposal for __GFP_UNMAPPED is >> probably not needed for 32-bit. This offers a way out of the GFP flag >> scarcity so in preparation for this, flip gfp_t to be 64-bit on 64-bit >> machines, while leaving it 32-bit on 32-bit machines. > > Ugh. This grows struct xarray: > > struct xarray { > spinlock_t xa_lock; > /* private: The rest of the data structure is not to be used directly. */ > gfp_t xa_flags; > void __rcu * xa_head; > }; > > which grows a lot of key data structures. > > It would probably have been good for you to have run pahole before/after > this change and diff the results. I will paste the diff at the bottom. I _think_ all the problematic expansions are downstream of struct xarray, but it's quite likely my sense for problematic struct expansions is weak. > Now, you're probably saying "But this makes no damn sense, why on earth > is xa_flags of type gfp_t?" And the short answer is "because the radix > tree has a ridiculous API". But you'll learn all about it with your > new patch in this series which converts xa_flags from being gfp_t to a > plain unsigned int ;-) Hm... so Can We Just=E2=84=A2 turn: #define radix_tree_root xarray ... into ...=20 struct radix_tree_root { struct xarray xarray; gfp_t gfp; }; ...? Or do we actually need to find a way to keep the radix_tree_root from growing too? If so, given that (IIUC?) the radix-tree API is soft deprecated, I guess we can be pretty simple-minded about it and just define a fixed set of the GFP flag values people use for this: enum radix_tree_gfp { RADIX_TREE_GFP_KERNEL, ... RADIX_TREE_GFP_KERNEL_NOWARN, }; const gfp_t radix_tree_gfps[] =3D { [RADIX_TREE_GFP_KERNEL] =3D GFP_KERNEL, ... [RADIX_TREE_GFP_KERNEL_NOWARN] =3D GFP_KERNEL | __GFP_NOWARN, }; Would that make sense? --- struct acpi_device_bus_id | +8 struct address_space | +16 struct amd_iommu_viommu | +16 struct auxiliary_device | +8 struct bdev_inode | +16 struct blkcg | +8 struct cgroup_subsys | +8 struct chain_allocator | +8 struct compact_control | +8 struct debugfs_inode_info | +16 struct dma_device | +8 struct dmar_domain | +8 struct drm_conn_prop_enum_list | +8 struct drm_device | +32 struct drm_file | +16 struct drm_i915_file_private | +24 struct drm_i915_gem_object | +24 struct drm_i915_private | +40 struct drm_master | +24 struct drm_mode_config | +24 struct dw_dma | +8 struct ethtool_netdev_state | +8 struct ext4_inode_info | +16 struct fsnotify_group | +8 struct gendisk | +8 struct hsu_dma | +8 struct hugetlbfs_inode_info | +16 struct i915_gem_context | +8 struct i915_gem_object_page_iter | +8 struct i915_perf | +8 struct ida | +8 struct idr | +8 struct ieee80211_if_nan | +8 struct ieee80211_local | +8 struct inet_connection_sock | +16 struct inet_sock | +16 struct inode | +16 struct inotify_group_private_data | +8 struct __intel_generic_device | +32 struct intel_gt | +24 struct intel_guc | +24 struct intel_iommu | +8 struct intel_uc | +24 struct iommufd_viommu | +8 struct iommu_group | +8 struct ipc_ids | +8 struct irq_domain | +8 struct iso_inode_info | +16 struct kernfs_root | +8 struct kmem_cache | +8 struct kvm | +32 struct kvm_arch | +24 struct kvm_mmu_memory_cache | +8 struct kvm_vcpu | +40 struct kvm_vcpu_arch | +40 struct loop_device | +8 struct mei_aux_device | +8 struct migration_target_control | +8 struct mqueue_inode_info | +16 struct msdos_inode_info | +16 struct msi_dev_domain | +8 struct msi_device_data | +8 struct net_devmem_dmabuf_binding | +8 struct netfs_inode | +16 struct netlink_sock | +16 struct nfs_inode | +16 struct nfs_net | +8 struct objpool_head | +8 struct oom_control | +8 struct p9_client | +16 struct partial_context | +8 struct phy_link_topology | +8 struct proc_inode | +16 struct protection_domain | +8 struct pts_fs_info | +8 struct raw6_sock | +64 struct regmap | +8 struct rethook | +8 struct rpc_inode | +16 struct sctp_sock | +16 struct serial_ctrl_device | +8 struct shmem_inode_info | +16 struct shrink_control | +8 struct snd_card | +16 struct sock | +16 struct swnode | +8 struct tcf_block | +8 struct tcf_idrinfo | +8 struct tcf_net | +8 struct tg3_dev_id | +4 struct thermal_zone_device | +8 struct trace_event_raw_dma_alloc_class | +8 struct trace_event_raw_dma_alloc_sgt | +8 struct tracefs_inode | +16 struct ttm_bo_swapout_walk | +8 struct v9fs_inode | +16 struct virtio_gpu_device | +16 struct virtio_pci_admin_vq | +8 struct virtio_pci_device | +8 struct vmap_block_queue | +8 struct worker_pool | +8 struct xarray | +8 struct xhci_stream_info | +8