From patchwork Fri Aug 16 00:10:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13765289 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 221F6C52D7D for ; Fri, 16 Aug 2024 00:13:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4E7C8D0018; Thu, 15 Aug 2024 20:13:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FEF28D0002; Thu, 15 Aug 2024 20:13:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C6A88D0018; Thu, 15 Aug 2024 20:13:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 6F74D8D0002 for ; Thu, 15 Aug 2024 20:13:13 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 25602818AD for ; Fri, 16 Aug 2024 00:13:13 +0000 (UTC) X-FDA: 82456183866.17.B5D4CA8 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf01.hostedemail.com (Postfix) with ESMTP id 2A6E640015 for ; Fri, 16 Aug 2024 00:13:10 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SEO7hcjA; spf=pass (imf01.hostedemail.com: domain of dakr@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723767094; 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=xY2q6TvN5yPmUZeWZDEd6ys9gSCkNIy8fcuOjgTyz0c=; b=3J8Dp8hCIOhhyMrG4/NlYpOoWV1Uy2BLMcxpcU/PZo1noi0r94tLXw6oBRQClzcqCQeT77 O1YM3jRRRNGX2v6SWxCT2V9RAGJhwia5RiO26Ylgl1PciEGOrVgBVcQ1WLStIK+NSVzcQ0 9kz4TKmjJ6h/iNgzmDEkgidu9G3n55g= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SEO7hcjA; spf=pass (imf01.hostedemail.com: domain of dakr@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723767094; a=rsa-sha256; cv=none; b=yG2cOSCnDsZCh5U4ksfoTX7TJajJtrlf45Trw4uV0D2KWfS8xX+fZEv1nl7GkUaZILxEdX l/tvFt2+UaZdcnw4Yxbk3Uy8KPYxR2D1CrvicHNRloKIH+MIlK0fprbMPqj1pV4A8E4SCx WdhnafppEXQzCsKeqV10H7BFFb/T8Kk= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 4F36ACE1EA1; Fri, 16 Aug 2024 00:13:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 983CDC32786; Fri, 16 Aug 2024 00:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723767187; bh=+Q2tfhai1Eb3pcjdgIQSFOSo90TRqwwdVLlFVhO/a9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SEO7hcjAZYf/irob5D8Xw7gx/QKeDkU6wXpp9wkrJJsPCfb9CjhnaFsZ5HNsBgSDE irKx2T7ipVZQrSJqixDZslXSvkuJz0aXVX7zN/9ex7LjN3/siJjE0uNCThMuBNPlLg BcKzkZBkEM20+7krNm2Vg4Befyih+8/cnV1r0nT/+bIfvzyiPA6hAjeK9jHds0Qxq4 KZOvf7wrDkmxjBx1HjqZd9GTUKy72/AiJzmuGJogJjUvUQQF+Tap3uTQDP0sfCNJKv K6jmZhLMqiHZv2JTAz6oo3AxoE70dkyO7U9B/32lJJJz2WAIZNGlnuIsLNOecf2QO2 o8IKcWJdImKlw== 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 v6 08/26] rust: alloc: add __GFP_NOWARN to `Flags` Date: Fri, 16 Aug 2024 02:10:50 +0200 Message-ID: <20240816001216.26575-9-dakr@kernel.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240816001216.26575-1-dakr@kernel.org> References: <20240816001216.26575-1-dakr@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 2A6E640015 X-Stat-Signature: siwupr7syzbu5cxcggnda5ewai8tmh3b X-Rspam-User: X-HE-Tag: 1723767190-912545 X-HE-Meta: U2FsdGVkX1+4GSqGmoEZ+0b/fhlVtDnIzA5TDKnsGcfEdSzlWBZiJ/BfYyxPEtGe8eqhl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c/YKyviDWIQPrn/Eqm/4KnsFKxKuXNynVc38/zstBPFXE7XRDGFVXGbBaFSggTMNkvLbSn0s4GNyUxNl8sM/8xX/OXtuuxNq4WJcT39Oj2usDYeAla7WozZqgWi49TD5MCmgQIhOIsnLxoRk5mbNcYs3OJvUctRCXPJWIDX4NcFox6Usl6y3VSgHG6ox9k6bUd5IAvJFJ9jy2Q7hwjf2PKWA== 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 --- 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 b5793142904d..90493123bdf1 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -37,4 +37,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 91a367a58f36..53a93617a9f6 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.