From patchwork Wed Sep 11 22:52:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13801181 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 9752FEE57D7 for ; Wed, 11 Sep 2024 22:55:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 32E516B009C; Wed, 11 Sep 2024 18:55:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2DEB96B009D; Wed, 11 Sep 2024 18:55:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 17F726B009E; Wed, 11 Sep 2024 18:55:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id ED1336B009C for ; Wed, 11 Sep 2024 18:55:46 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7B2971C5C8D for ; Wed, 11 Sep 2024 22:55:46 +0000 (UTC) X-FDA: 82553966292.11.64206E0 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf11.hostedemail.com (Postfix) with ESMTP id CD7AE40009 for ; Wed, 11 Sep 2024 22:55:44 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=QPvCMXFp; spf=pass (imf11.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726095241; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bkSQM67IdFsrXjQ4lzr33DtOqD4RTup7jocShUepuMA=; b=EHKR8JT0YExsgP3piTfrGnMd+pnb8boVgwgD1JKgnAFof5JN/pIiD83YMwZwmCPV7wPAaP gopNSJ0Jk/sbXUBHPmVA2e/eMtqw9WD1lzy3uwbvon/wb1+TKsYhTpGbSlL7hJ5U/AjDTm AVK/aqQQwc+xCjawQ5vQ2VVcCY0k2Bc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726095241; a=rsa-sha256; cv=none; b=Gtu+4Ef50k23fo4zpMJ5xPyPX8iWhj3bHbbzKijujAxaezG9UjoywegyzYMKMb4/IsJvzX aSyr1UF+Y35iVjKR3evK4TaR+sthHJ35BNtXCEPGfRdZwCpAf15mb/majGwgqaeWNS/USc uw9BxvFyy97rz0CEAg2Tp+zJqARu99k= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=QPvCMXFp; spf=pass (imf11.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 619F75C0131; Wed, 11 Sep 2024 22:55:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A63D1C4CEC0; Wed, 11 Sep 2024 22:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726095343; bh=cw4d7ozoaPZp9ThW0IiXPabVi14FeEz+TkCXge43sLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QPvCMXFpIwzfoZbpxM2gjuVdmtZUL2+Yc6GhKLt//9t7CDDcaB8AgbIiSKcHmTb0C x3EGE9ZzTqaLvqTvzVZYjvTAg13F3eEJnh3cJJEWio3yD+JN8s3DsYCmcMLD9Yc97W A/GUrN62DQFaaEosXHom6aUqb6ujSOgzzIhn+XhM/km6w65C3We22AI9nBIBuXuu/5 L4MD9j0pviw9fbRrP/07HmRhI3G5Zllhkjf4P9q9vlqmXaWmXUuzLzM1PyTb8m68c9 3xPHmt7Mu/gEjvkGoVc4YPmFE+GRhsiPEmyJRhGJ6rKl7lsXMWukOy0DuYZ/aXCFf6 o5h4yzR932z0Q== From: Danilo Krummrich To: ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, benno.lossin@proton.me, a.hindborg@samsung.com, aliceryhl@google.com, akpm@linux-foundation.org Cc: daniel.almeida@collabora.com, faith.ekstrand@collabora.com, boris.brezillon@collabora.com, lina@asahilina.net, mcanal@igalia.com, zhiw@nvidia.com, cjia@nvidia.com, jhubbard@nvidia.com, airlied@redhat.com, ajanulgu@redhat.com, lyude@redhat.com, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-mm@kvack.org, Danilo Krummrich Subject: [PATCH v7 08/26] rust: alloc: add __GFP_NOWARN to `Flags` Date: Thu, 12 Sep 2024 00:52:44 +0200 Message-ID: <20240911225449.152928-9-dakr@kernel.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240911225449.152928-1-dakr@kernel.org> References: <20240911225449.152928-1-dakr@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: CD7AE40009 X-Stat-Signature: xfwipc9zufs4cp8xg5qmdmi47iuizbry X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1726095344-65324 X-HE-Meta: U2FsdGVkX1+aIZDhUCBlA0yEF8Jw90ppCJ0dkKHqL4h9hIgwpYF8lZOJlYj1Auo5vLDY4KuH6+sW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v+3fFXJYJ0gS+QDqPqcbus2YxbhYwyzMVHnqdmsE3LC792soVIutlwCcM/eBXuFEDyb9ERRPpwW27o9UO6uGdr+3FLXr0Hco1WyTi52ZB2IVALCB++Jcms4RuQ9JJP4oQrE1x/27H4eYKgfgTO5urNdCImS3Oj8h0vOinkFUrYsCCIossXsmGY4u29dXsZatAKFEZTQXtiYjQg== 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: Some test cases in subsequent patches provoke allocation failures. Add `__GFP_NOWARN` to enable test cases to silence unpleasant warnings. Reviewed-by: Alice Ryhl Reviewed-by: Benno Lossin Signed-off-by: Danilo Krummrich Reviewed-by: Gary Guo --- rust/bindings/bindings_helper.h | 1 + rust/kernel/alloc.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h index ae82e9c941af..a80783fcbe04 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -31,4 +31,5 @@ const gfp_t RUST_CONST_HELPER_GFP_KERNEL_ACCOUNT = GFP_KERNEL_ACCOUNT; const gfp_t RUST_CONST_HELPER_GFP_NOWAIT = GFP_NOWAIT; const gfp_t RUST_CONST_HELPER___GFP_ZERO = __GFP_ZERO; const gfp_t RUST_CONST_HELPER___GFP_HIGHMEM = ___GFP_HIGHMEM; +const gfp_t RUST_CONST_HELPER___GFP_NOWARN = ___GFP_NOWARN; const blk_features_t RUST_CONST_HELPER_BLK_FEAT_ROTATIONAL = BLK_FEAT_ROTATIONAL; diff --git a/rust/kernel/alloc.rs b/rust/kernel/alloc.rs index da025faf07f8..7a405d6f3034 100644 --- a/rust/kernel/alloc.rs +++ b/rust/kernel/alloc.rs @@ -91,6 +91,11 @@ pub mod flags { /// use any filesystem callback. It is very likely to fail to allocate memory, even for very /// small allocations. pub const GFP_NOWAIT: Flags = Flags(bindings::GFP_NOWAIT); + + /// Suppresses allocation failure reports. + /// + /// This is normally or'd with other flags. + pub const __GFP_NOWARN: Flags = Flags(bindings::__GFP_NOWARN); } /// The kernel's [`Allocator`] trait.