Message ID | 20240321163705.3067592-25-surenb@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 30FB4C54E58 for <linux-mm@archiver.kernel.org>; Thu, 21 Mar 2024 16:38:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DD6A66B00B8; Thu, 21 Mar 2024 12:38:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5F556B00B9; Thu, 21 Mar 2024 12:38:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8D796B00BA; Thu, 21 Mar 2024 12:38:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 9D5B16B00B8 for <linux-mm@kvack.org>; Thu, 21 Mar 2024 12:38:04 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7DA3712104E for <linux-mm@kvack.org>; Thu, 21 Mar 2024 16:38:04 +0000 (UTC) X-FDA: 81921603288.26.A13C279 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf19.hostedemail.com (Postfix) with ESMTP id D0EEE1A0003 for <linux-mm@kvack.org>; Thu, 21 Mar 2024 16:38:02 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=KlioJpZB; spf=pass (imf19.hostedemail.com: domain of 3aWL8ZQYKCFYGIF2Bz4CC492.0CA96BIL-AA8Jy08.CF4@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3aWL8ZQYKCFYGIF2Bz4CC492.0CA96BIL-AA8Jy08.CF4@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711039082; a=rsa-sha256; cv=none; b=cuF8W3FNhhdppyhnR9ag7rooUywf+ZgQR+3Glinm67S0uFDgjgA79NvtLztSPApjAqwCvl Nr24Hocd6kSwdf/2xqHAkF6EKTLVEsKuBId4lsQTyZTgjMTAvv1c8hx20L2lgoqGbkEq+G O91tT/v93LRjvpwwT3O8foBu3P09XyM= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=KlioJpZB; spf=pass (imf19.hostedemail.com: domain of 3aWL8ZQYKCFYGIF2Bz4CC492.0CA96BIL-AA8Jy08.CF4@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3aWL8ZQYKCFYGIF2Bz4CC492.0CA96BIL-AA8Jy08.CF4@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711039082; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=s40WFNE8AOKkW3fMlFNAMtyrdkqCS9mljSRdY//hl9w=; b=MQd/js7AODVXhXe8eDV/aeuI5/87Rx3SPi+HfnJD485Bhaot/jX1BLHnOIQfpxcUK3+l4q t0DBQxTjCpx0PSmCLJux0TmeI+HO75k4GQqUzrfYuN3N0Whg9c3xmGwtM4DzZa6z6H8t/U 520mbp73UYK6DdoRq5LYGJxKtvo4rhI= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-60a54004e9fso21458087b3.3 for <linux-mm@kvack.org>; Thu, 21 Mar 2024 09:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711039082; x=1711643882; darn=kvack.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=s40WFNE8AOKkW3fMlFNAMtyrdkqCS9mljSRdY//hl9w=; b=KlioJpZBvXl0OOuJiIG4vgwvWwnja4FOJxl9t6cXp2M9XhWtf6aRJ2h9Dqpnza/wK0 5WchBX+VD8oq0skCVcj20KL4/jdLbYITYN+ri659hV0QDLiIxeItJ4pcoxixtBwpNRz9 m9hqj2+1yY5L1RpNSztUp8N5gb/3Pig9/s4jLFJlWHf17w1p5dbvyE63BZ/psNXa8zYS Py6AMf+6m8nFZ/o3TsIMiIPs22PiyYmY+p6O7la3k2EVRzMgIUdhoXLEqnrsIHn6cEGD ImJqrw2baw4+Y4CSReB55z8AZl5W2xHdbRSZ1/0nOy0QW+K3m/mZbJnthQl0udbVDTz4 Z/+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711039082; x=1711643882; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=s40WFNE8AOKkW3fMlFNAMtyrdkqCS9mljSRdY//hl9w=; b=T8iC5LxNP9dE+3xuIYEeetYrGWzeSbtNRdLDiyxKTtibwqEssSch2YuOfn4GuUA4w5 59zQCE91zfK1yGSJds0hr4nPvCGWmMxYVYVUHW+uxODSweAxyYrRV/n5tItHWwx/9nGF TasQCamfic9fAJAJh1VA7O/+U9NKohIo2WAcylsYylN9U4KAASYHnrnLQqNpfYnGCGB3 mnJAC7yyvENn/TnIWJPjej9JxGIWhT6Nc0ac13itcITx56M6lpy2GUJPvXxiYBwyu1Fm DnyvGOpQC8hhrMU1ETRpEy+hxninILx5cD9evavlQQB4zHJfZ53gbzUX4XgNDqzLqRbe rEQQ== X-Forwarded-Encrypted: i=1; AJvYcCWX+r2j7yRY6J7FYydfL7B+3yP38aSxS/hMHcwT3owrf5ccKdXXr8Lx3p916aSyYvFxZ43G+bJfBGaOgVOoczgjPLU= X-Gm-Message-State: AOJu0Yx0qi9x5oT6CW1hrfo9pcnYr0e+I+hCg4eKF67z7Tn3GQHMaV5J GUmp960Ykz+p61dZKf1UY7Lcv2x4wwqvuPKt3MvTj8UKWM2jK/awqAAANGkPykLwurP9OvmO4Jz 1Fw== X-Google-Smtp-Source: AGHT+IFs+Nf82Ul1t74I4vPuVX4weNJROFN7yWXEOAVfX30LUtXPCkGRPdyvAgyHRn4LwSGt1RsLpaikF8g= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:a489:6433:be5d:e639]) (user=surenb job=sendgmr) by 2002:a0d:ca91:0:b0:610:fc58:5b83 with SMTP id m139-20020a0dca91000000b00610fc585b83mr1061193ywd.8.1711039081806; Thu, 21 Mar 2024 09:38:01 -0700 (PDT) Date: Thu, 21 Mar 2024 09:36:46 -0700 In-Reply-To: <20240321163705.3067592-1-surenb@google.com> Mime-Version: 1.0 References: <20240321163705.3067592-1-surenb@google.com> X-Mailer: git-send-email 2.44.0.291.gc1ea87d7ee-goog Message-ID: <20240321163705.3067592-25-surenb@google.com> Subject: [PATCH v6 24/37] rust: Add a rust helper for krealloc() From: Suren Baghdasaryan <surenb@google.com> To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, penguin-kernel@i-love.sakura.ne.jp, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, jhubbard@nvidia.com, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, songmuchun@bytedance.com, jbaron@akamai.com, aliceryhl@google.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org, Miguel Ojeda <ojeda@kernel.org>, Alex Gaynor <alex.gaynor@gmail.com>, Wedson Almeida Filho <wedsonaf@gmail.com>, Boqun Feng <boqun.feng@gmail.com>, Gary Guo <gary@garyguo.net>, " =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= " <bjorn3_gh@protonmail.com>, Benno Lossin <benno.lossin@proton.me>, Andreas Hindborg <a.hindborg@samsung.com>, rust-for-linux@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: D0EEE1A0003 X-Stat-Signature: wb4mfyky9qrbhrojwt6dknhdjmpti53z X-Rspam-User: X-HE-Tag: 1711039082-430054 X-HE-Meta: U2FsdGVkX1/BjQqeFUh1pBfKYUr0XUb2aQmOO7nvozZf6a+NRnSm12Pz1XLDQBbIDFiizvAULQm87Y2Ka0hJ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BHCc9iDTQzANegdDf2zSGgzsRKJsWz8+dpysmg+sWzK8rtPM5biH2qm/w6i6WL87Lw/GbeNERwL1P4aZd2Plmy+KjNqs81VkZ+k56soGRT+WVWitoM+mDgXNfDhOmDaa9xTFnXJKCC+3tDTkZRgLpQn2Ezpvpv7ZvyHoO06/zCHNp+ggyy8F4Xls5zrOtklcI906QEX9ArD6TjZsSBtwPZXxhSDhLpdgRe7i6n73zsfwHoBHtv 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Memory allocation profiling
|
expand
|
diff --git a/rust/helpers.c b/rust/helpers.c index 70e59efd92bc..858d802abd11 100644 --- a/rust/helpers.c +++ b/rust/helpers.c @@ -28,6 +28,7 @@ #include <linux/mutex.h> #include <linux/refcount.h> #include <linux/sched/signal.h> +#include <linux/slab.h> #include <linux/spinlock.h> #include <linux/wait.h> #include <linux/workqueue.h> @@ -157,6 +158,13 @@ void rust_helper_init_work_with_key(struct work_struct *work, work_func_t func, } EXPORT_SYMBOL_GPL(rust_helper_init_work_with_key); +void * __must_check __realloc_size(2) +rust_helper_krealloc(const void *objp, size_t new_size, gfp_t flags) +{ + return krealloc(objp, new_size, flags); +} +EXPORT_SYMBOL_GPL(rust_helper_krealloc); + /* * `bindgen` binds the C `size_t` type as the Rust `usize` type, so we can * use it in contexts where Rust expects a `usize` like slice (array) indices.