From nobody Thu Nov 14 03:57:55 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16A9B1BC065; Wed, 11 Sep 2024 22:55:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726095344; cv=none; b=SfdjO01GTlz5wHcxSPn3qS2tYDgZiacishBlayb1Nz0H2PTvMCRL+iFEvMfcMOjd0ErDpluOkRgdgVJBvulNividuLcWDlqY0665umyqd+bpD12CBPofnjRy9Q5OqVdM6JiRbBC2l0m1cahmQq1zOGDHJKyzgtY2X8GwTBUhoNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726095344; c=relaxed/simple; bh=cw4d7ozoaPZp9ThW0IiXPabVi14FeEz+TkCXge43sLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FBN1WfpRBljlzE5tVyWqXs6G2gmB0mSKXfY2CWwy1vsyZzYBM9TY9tu0ohqVnRoxPx1ADE8ZVsPahmAHTOOlePA9p0NBzMTSlR6PV2jN1a6awrFs0CTVAZQJNizo3kB2Vbnk2scy3qpvjYxMs0p6kEQhXLuBbahJo35HJ/4cNhw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QPvCMXFp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QPvCMXFp" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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_helpe= r.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 =3D GFP_= KERNEL_ACCOUNT; const gfp_t RUST_CONST_HELPER_GFP_NOWAIT =3D GFP_NOWAIT; const gfp_t RUST_CONST_HELPER___GFP_ZERO =3D __GFP_ZERO; const gfp_t RUST_CONST_HELPER___GFP_HIGHMEM =3D ___GFP_HIGHMEM; +const gfp_t RUST_CONST_HELPER___GFP_NOWARN =3D ___GFP_NOWARN; const blk_features_t RUST_CONST_HELPER_BLK_FEAT_ROTATIONAL =3D BLK_FEAT_RO= TATIONAL; 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 allocat= e memory, even for very /// small allocations. pub const GFP_NOWAIT: Flags =3D Flags(bindings::GFP_NOWAIT); + + /// Suppresses allocation failure reports. + /// + /// This is normally or'd with other flags. + pub const __GFP_NOWARN: Flags =3D Flags(bindings::__GFP_NOWARN); } =20 /// The kernel's [`Allocator`] trait. --=20 2.46.0