From patchwork Fri Oct 4 15:41:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13822621 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 26B29CF8849 for ; Fri, 4 Oct 2024 15:43:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B5A728D0005; Fri, 4 Oct 2024 11:43:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE2188D0003; Fri, 4 Oct 2024 11:43:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9355C8D0005; Fri, 4 Oct 2024 11:43:02 -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 736218D0003 for ; Fri, 4 Oct 2024 11:43:02 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 22FE5A195D for ; Fri, 4 Oct 2024 15:43:02 +0000 (UTC) X-FDA: 82636338204.27.D5E6F17 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf23.hostedemail.com (Postfix) with ESMTP id 8A7A5140018 for ; Fri, 4 Oct 2024 15:43:00 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=G0SZdVWM; spf=pass (imf23.hostedemail.com: domain of dakr@kernel.org designates 147.75.193.91 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=1728056449; 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=ZDarUeJtIOZtgw3vVOZFHi4KS4Nr8i9TiefmdjI2B94=; b=CGdcv0s/Xbh/ZnJ2CiuBGK/B5aTTHTJyqukIkMNd694xyuT9t+6fRm4TBWGPKwVPXNmGhz bMeEwWMqR1drybe013ThOrAdHKpLTzAc7kUGN4WeMEBXVLH36rqKIxI5a/LbY1AgrYgCMp x9oh1/0AoIzb92QZ7AxAN708HkxLX5s= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728056449; a=rsa-sha256; cv=none; b=baSUeQDjBSO6X1XX/MIJtdn63lsHM+JHh7LK3PelslmhoXl03zC0ksLQ8murKqUyZwRiv9 qRxkGKDx2JmqW12EkYwTq2hYMavMXazUPANVj2CdaeVbvoXR5RNeFbhieztR0CFApOy3CM UKKttA7umZNAv4ULgOyLCZ5otRnuNCs= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=G0SZdVWM; spf=pass (imf23.hostedemail.com: domain of dakr@kernel.org designates 147.75.193.91 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 nyc.source.kernel.org (Postfix) with ESMTP id 86F72A44B76; Fri, 4 Oct 2024 15:42:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEA1DC4CEC7; Fri, 4 Oct 2024 15:42:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728056579; bh=k3fbnNVumq3p6Zkau+316hxp1LWKMWboxrOE8MJqOiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G0SZdVWM49uPjrTKdSFLLtEup1HwgkGeO9v9ZDDnn5aHOC/i/t7QB+rI7DTTt8Uhq QGpzMmjDSv5/Qv/j/7F92bzQpromwD9bU8z7/bweJ/CYCoVL41kbiK/SbygAqIxBqN ibze+ncGEHEUljEJDwBQobzEi4pp4I/Pns6sFjuwbCew0cB3cspYtq0kXvPTFLk78v Aeb6O8+lSbL51Amuo3xpUiptRKKfFv4hWnWZuI711Rj8/Jweg3w+7pIusrhns+Cf39 Y6cq0XQxjySmgv72xnyort+/t+OcltdJQA1mHzJ2oDHuSaE7N3SLbHuRI5O+FZnjPk 4TnpYuFKDci8A== 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 v9 10/29] rust: alloc: add __GFP_NOWARN to `Flags` Date: Fri, 4 Oct 2024 17:41:14 +0200 Message-ID: <20241004154149.93856-11-dakr@kernel.org> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241004154149.93856-1-dakr@kernel.org> References: <20241004154149.93856-1-dakr@kernel.org> MIME-Version: 1.0 X-Stat-Signature: fdo95c69ojtrymbk74mco9yr3qxu5ign X-Rspamd-Queue-Id: 8A7A5140018 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1728056580-415347 X-HE-Meta: U2FsdGVkX19Yxt6UCbsYCegbLL6Epx9ECHHotzdnFIJHMk1Suxuultvjd8iE7e1BKyJ37aKGuGgGiRB5RgD64A6OZba+e+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S8lEy4F4uHG8r2xtm+XAA5nAKsQbUUZrKb2oXxHD8UTWgkz5szwMs8vOfjbzfv5RicQEYhC1Ofgk5hJL6+sP7C4zt9e5ZLJtk5XcIEOjRy1bHU6tCamokXu4lCCAydn/ehw5KUS9ackajC/H8r8srWjXMKURcm6xaq19MOl1lKRvpXZlNvuN10cXLoX7bbUEqACXK7tcQB1z9sZKejLLlj0qOv4U454i+ayZf5Bi1WOpAMxU3cCb2mufRonJZx0IA== 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 Reviewed-by: Gary Guo 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 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 f8ddc8d96da9..97defee1d6a1 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.