From patchwork Mon Aug 12 18:22:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13760925 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 5F329C3DA7F for ; Mon, 12 Aug 2024 18:24:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3A4B6B00AF; Mon, 12 Aug 2024 14:24:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D76176B00B0; Mon, 12 Aug 2024 14:24:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C3CA06B00B1; Mon, 12 Aug 2024 14:24:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A58546B00AF for ; Mon, 12 Aug 2024 14:24:54 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 29435A0328 for ; Mon, 12 Aug 2024 18:24:54 +0000 (UTC) X-FDA: 82444419708.01.1D75F9F Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf02.hostedemail.com (Postfix) with ESMTP id 6F59E80027 for ; Mon, 12 Aug 2024 18:24:52 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="reVFN/xm"; spf=pass (imf02.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 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=1723487037; 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=pKF9l0pC2M5VhiBLUwxSWLkapZ8tnFexGOOoWBSoz2c=; b=I5xo4ZLH/9jmlq6gjNhU+NgkPFo+IG8bO50vf6FCtkGG79e1FyVYD5LJ8buW2C5nJzbyiM +iwkUNTFtizhatuerrA+5HgHnbDvUNPfv204U7Wwv7Vpz5A/OBcvRDc235Eoa3mrUqRNla XyXLtd2me04ZFBlZvUdJrDNcYv78WZw= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="reVFN/xm"; spf=pass (imf02.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 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=1723487037; a=rsa-sha256; cv=none; b=Wgbk2jhK/FQi2ej+9iVLQe9rFKMlZLrpjm1ukz/YF6yWFfEFtOtYH3i5gwaJPoCwXiRdJW rT03yHq0jfV9PNY3ulm5kAEbY33l/I9hkoNDAHR33/pF87VEVx0tWaFX4VTuAgZJ3chwFq wzy67o62Iqpt4l60hAeAsIRRBq1uYJc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A273B61369; Mon, 12 Aug 2024 18:24:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6456EC4AF0F; Mon, 12 Aug 2024 18:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723487091; bh=agb767SEFvgiUIEEXO9aVEplEpFhszjniHeGVU9yvoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=reVFN/xm1E8Zs+oww/Sm//2DAa2Rw+MuElDOYO76uoQ2MsmfiIDVMGPd3+hhKDUl+ ZKQ3On9ODtNcI1ec9Gz1esyaAfQgqu+caq+k+7BGJnkg4smIDMVmgLUMUzNBXsYHr2 wRMNNMkdq4gIyw8dCsSrjMSGSDiHLJ58KmnljgsSHRfbnClljfdgmafKb9Hlv/KcPn ZX+XPgkq446EUBGjR/c6fi3nsvTH/p3kI5Qu4gFCrqbAjky1zQB6UceDRGvu4d7xzO BkgNAqSFBF8Zc1vzaEIFNgbgYYyxRX8ki24XnarQxBT9QqrJaxvJuGcoSD2KFGaOAQ eOnr0J9FrL41w== 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 v5 08/26] rust: alloc: add __GFP_NOWARN to `Flags` Date: Mon, 12 Aug 2024 20:22:54 +0200 Message-ID: <20240812182355.11641-9-dakr@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240812182355.11641-1-dakr@kernel.org> References: <20240812182355.11641-1-dakr@kernel.org> MIME-Version: 1.0 X-Stat-Signature: etxtprra3p4ku9jtnefe3rjthj511cew X-Rspam-User: X-Rspamd-Queue-Id: 6F59E80027 X-Rspamd-Server: rspam02 X-HE-Tag: 1723487092-439570 X-HE-Meta: U2FsdGVkX19e04UtmlqM883RGXVihodqDxjNiqIYOo/ZHqe8TFZUDciM39qrMj0ccqedSL1xK9kM3rTKtraM3tLkJ/F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f6LhtYFbPkZmP8Ug/Q48LcLG2Kmnm2wzXKKqqFUSInaRtsHanb6CN9L0QoZKHiX6+6EQ325M0KqVQucDuUgb5lNNj7r92EIREEp62d3RxrY9JQ8VR2D5nZCXhBN2+/aLGAqBbcsghUW2es43QsfQJRQxMDX8RLb2nwS6Q= 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. Signed-off-by: Danilo Krummrich Reviewed-by: Alice Ryhl Reviewed-by: Benno Lossin --- 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 b940a5777330..7f781256fda9 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 f0c80ab78602..295107777a12 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.