From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795404681; b=VG6qUQVM43p8HeiBUPPl8Fiu/Gsg8bprWa040GMWWci8s+0UqlGfn9FyfTs3qaF2OXST YoBhisBFtsY7HdgYht6sIikI9TOEOeFq6t7oGMQBX6uGC94baPZVkugqA6eGUqwYSkYHc zAV4CVsSfi9Z11iKgglf0S5tL8vbMpymX9+dpCh5WfDuXHlRtqEQEnYxW+vE6FQqZhs5Y NjZGEAY2xZQg8a+ogqxuT22AadUL6HhBDICdqdcSnsaw+Bpj5gDZs1f38En4EDo5lwExr HnF8JRaO2pqPK4VDCS9sNfDqSaxiKmnOwFu9cL3ijRHdHHa9L2GE54Eb0HVd/+Gw30g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795404681; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=n3/QgCFjzvK6G73Tiampz5hPbLES3QQEgOsn43qeBn8=; b=C6TdpMPKhUuXaBTqIvwb1KYBhEBADiK6rcxGpn1N9WoAVJWcZ5BvC5cDUL+4VowuB8zb 5eFExzO82yPpwoiTqVButNFuAB7UfF4IKTYo1uI4f9XovRlyCVqNCslkJyF/Q3YV+fDrA iP6fN/ttC1Pjw2sEQUCFciUkhbE4ghqbA4C5eKeuG412L7dxMMoh7C/TaE6L98arrLSyB J1ZzDkzIhs6ayVDD9lvcWTa4DEzSbrnnP/nnenKyHMbOkRuaYpIOF/x8jNzV2zWjjatPj Lrqihl+g9PRBjlrVvyPEw2E4e8sVyO4vxww+2fmT5tZ7XWSTGIfTnalCQ8IZk/3t2Kg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Edl3tDou; arc=none smtp.remote-ip=209.85.210.172 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5816606A31A for ; Mon, 23 Nov 2026 03:31:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D5816606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Edl3tDou Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-8b3d544148dso36682b3a.3 for ; Sun, 22 Nov 2026 19:31:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1795404680; x=1796009480; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=n3/QgCFjzvK6G73Tiampz5hPbLES3QQEgOsn43qeBn8=; b=Edl3tDoudDKu8O2PRwvYnO8MJvLjWtgoT26qqZAO1ooxzE3Tz8K2jSrkMRJ74CY71T gmeUGNF0Du2akiiBchns1KHvONx24mVE1qX81TBQ16SMRNqU5PNNIc/hqFlKoySErJOB LBybGaxPrLQI6vmhdHWQGORNw914goHqfldQc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795404680; x=1796009480; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=n3/QgCFjzvK6G73Tiampz5hPbLES3QQEgOsn43qeBn8=; b=nnKIHQVILF0DKG78O6xyJxG96358C2DVUFqvehFCCwWu0W/qBeGAa5YvXpGvRcGtb9 3UkSORACslWK/SswysXkgKm7R4Tl2Kvdy0RnU3PBaH+GK4KDz1hoykyeBYG6BGu2CYhl 35yJgAPmE440w9nPyiVV+i/GPpcIJaMUFWy6dJQZ2MQMlM+F5uBEuupMkhcy6Hms453f 2Gs047LtJIvZAdkHxSEBSeDYPnmSkkjL8xY//dJlq9FXHW8+Dmtsx0EWUbOuI9XsUWX5 Btf4uSue22camdDYfmrNiiF/KEMUvBAJUtO7DscQ6pnytJ9f4QQ2mVC7kW2bDxwIZxaC odQg== X-Forwarded-Encrypted: i=1; AL+hErGYDv7LQRUdtfYqraC4wk/HB/cSjDEbgDoegmViitYuEOJWCXYVuYh+Zuqn/55xuxiAnsVpesQ=@vger.kernel.org X-Gm-Message-State: APuU4Z8h7P1rPL/aQBEDTjR82SshyDmQnOCgfQIE4VuyJ5uakyTpSmrq 6lnzBz/V1Lw3NIe3WT/PfIx5f1KOnZbic6MLzCPi70udzm/9C+yRQchQ4IBd0ho0/w== X-Gm-Gg: AZFdTZdE6BAoA7C+p/8mN33JJHxVbPND/3oTmAaHwYnItWtMa5HF8wngRv0zDjkoFGZ njuK7QqgPH+9EcCX2NE0JG3wnKiBpe4pJ2ANPpAMj6RxT3BxNfH+zT+ufcLK5Wxc9loyQWB0y6z H9pElGpKefeKCjNcnCO17fz4z4mNaJFiwtmJuuEYBpiWPZN5tIDpKFy2C7lzcWWTaeM5eUsRwW8 /51uOCuRnPJAwvUW1DyRRz/4rYmK1moWVluRC3z29RKQ6a+ti0uB5CmWMsGXij9AMBSk020Jp14 MZEgb5VRFQk080lgFZ0NrlIRy+iixErY64E6NrK1CwKLs7XV1MZ19fCXiVC7qDvHeZszrs0KQ8i Rff5whHnN/csFFgo1WJydDSwPrMcxNFWQSa8e6FQCTIttBQHiVupjnQA7Taff5wl3EHhZpmyPS3 BNI5RfqO6cjxTKgBv4urjuacgJW0rv7VnkEi/eDeFosOzdxWLPD2gQvIhOa4KF/4scY1JYQi69Z RMU5hpYtGNl7L5b3i4jRLg+MXO9VvNfggqAapHm5BXCYbveugIv6d6CO7wJ5cgkxadosquQ77hu 6lALNRKu/RZwwTwjh4QdlgY9w4ONDjQg68At8uzbad8Xp7A1nF97tYlhYtuUYF94SKYoCQ== X-Received: by 2002:a05:6a00:c1ca:20b0:8b0:4ee8:10b7 with SMTP id d2e1a72fcca58-8c8792b617bmr11211724b3a.1.1795404680238; Sun, 22 Nov 2026 19:31:20 -0800 (PST) Received: from localhost (221.247.125.34.bc.googleusercontent.com. [34.125.247.221]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-8c87285c14fsm4712022b3a.15.2026.11.22.19.31.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Nov 2026 19:31:19 -0800 (PST) From: Jeff Xu To: Andrew Morton , David Hildenbrand , Vlastimil Babka , Johannes Weiner , Andrey Ryabinin Cc: Jeff Xu , Lorenzo Stoakes , "Liam R . Howlett" , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Zi Yan , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Marco Elver , Boris Brezillon , Catalin Marinas , Chia-I Wu , Dev Jain , Ian Rickards , Jann Horn , Jeff Vander Stoep , Jeff Xu , Kees Cook , Mark Rutland , Peter Collingbourne , =?UTF-8?q?Pierre-Cl=C3=A9ment=20Tosi?= , Ryan Roberts , Tomasz Figa , Will Deacon , Alexander Viro , Christian Brauner , Jan Kara , Miklos Szeredi , Baoquan He , Pasha Tatashin , Pratyush Yadav , Allison Henderson , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-mm@kvack.org, kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, fuse-devel@lists.linux.dev, kexec@lists.infradead.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] mm: kasan: skip KASAN for GFP_HIGHUSER Date: Sun, 22 Nov 2026 19:31:09 -0800 Message-ID: <20261123033111.2349160-1-jeffxu@chromium.org> X-Mailer: git-send-email 2.56.1.750.gf70dc682cf-goog X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi all, This series moves __GFP_SKIP_KASAN from GFP_HIGHUSER_MOVABLE to GFP_HIGHUSER (patch 1) and adds a KUnit test for __GFP_SKIP_KASAN (patch 2). GFP_HIGHUSER_MOVABLE already skips KASAN tagging under CONFIG_KASAN_HW_TAGS, whereas GFP_HIGHUSER does not despite sharing the same userspace-allocation contract. On an Armv9.2-A device (6.12 kernel, kasan.mode=sync), skipping KASAN on GFP_HIGHUSER cuts 32 MB /dev/dma_heap/system alloc+free latency by ~80% and improves an app-loading OpenGL benchmark by 15-23%. As a side effect, GFP_HIGHUSER shmem mappings (such as drm_gem_shmem_helper / panthor [1, 2]) stop hitting the swap-in readahead PROT_MTE tag mismatch, though the general readahead issue for other gfp masks remains separate. Changes since v1 [3]: - Dropped GFP_HIGHUSER_KASAN, the pipe/FUSE/kexec/RDS conversions, and page_alloc_highuser_kasan (v1 patches 1-4 and 7) following David Hildenbrand's and Tomasz Figa's feedback; kept those callers on GFP_HIGHUSER (2 patches instead of 7). - Rewrote patch 1's commit message concisely (Lorenzo Stoakes). - Dropped Assisted-by: trailers from the patches, keeping tool disclosure here (Lorenzo Stoakes). - Rebased onto mm-unstable (d12eccbcb79a). - Kept the fs/kexec/RDS maintainers from v1 on Cc for visibility since those patches were dropped. Testing: built and booted both commits on arm64 with CONFIG_KASAN_HW_TAGS under QEMU (virt,mte=on) across kasan.mode=sync, async, and asymm (9/9 runs passed for page_alloc_skip_kasan; 3/3 failed as expected when patch 1 was reverted, with the next test still passing). Verified W=1 builds with 0 warnings across arm64 (HW_TAGS, generic, SW_TAGS, no KASAN) and x86_64 (generic, no KASAN). KUnit tests were not run on real hardware. Tooling: an AI coding assistant was used under the author's direction to audit GFP_HIGHUSER callers, draft the KUnit test helper and changelog revisions, and run the QEMU/KUnit build and test matrix. Link: https://lore.kernel.org/r/20260519-panthor-kasan-v2-1-b7384458f076@gmail.com/ [1] Link: https://lore.kernel.org/r/20260521105148.5497c281@fedora/ [2] Link: https://lore.kernel.org/all/20261116230627.3537051-1-jeffxu@chromium.org/ [3] Jeff Xu (2): mm: kasan: skip KASAN for GFP_HIGHUSER mm/kasan/kunit: add page_alloc_skip_kasan test include/linux/gfp_types.h | 4 ++-- mm/kasan/kasan_test_c.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) base-commit: d12eccbcb79a4fa35c3aa588eb79056af62eb859 -- 2.56.1.750.gf70dc682cf-goog