From: Matthew Wilcox <willy@infradead.org>
To: Manuel Ebner <manuelebner@mailbox.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
linux-doc@vger.kernel.org, Kees Cook <kees@kernel.org>,
linux-kernel@vger.kernel.org, workflows@vger.kernel.org,
linux-sound@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH v2 1/3] Documentation: adopt new coding style of type-aware kmalloc-family
Date: Tue, 21 Apr 2026 20:24:57 +0100 [thread overview]
Message-ID: <aefPCV4ZvrnrCmoH@casper.infradead.org> (raw)
In-Reply-To: <20260421180200.225244-2-manuelebner@mailbox.org>
On Tue, Apr 21, 2026 at 08:01:58PM +0200, Manuel Ebner wrote:
> +++ b/Documentation/core-api/memory-allocation.rst
> @@ -135,7 +135,7 @@ Selecting memory allocator
> The most straightforward way to allocate memory is to use a function
> from the kmalloc() family. And, to be on the safe side it's best to use
> routines that set memory to zero, like kzalloc(). If you need to
> -allocate memory for an array, there are kmalloc_array() and kcalloc()
> +allocate memory for an array, there are kmalloc_objs() and kzalloc_objs()
> helpers. The helpers struct_size(), array_size() and array3_size() can
> be used to safely calculate object sizes without overflowing.
This seems to have been done without any thought. kmalloc_array() still
exists and has over 500 callers. It should not be de-documented.
> @@ -151,7 +151,7 @@ sizes, the alignment is guaranteed to be at least the largest power-of-two
> divisor of the size.
>
> Chunks allocated with kmalloc() can be resized with krealloc(). Similarly
> -to kmalloc_array(): a helper for resizing arrays is provided in the form of
> +to kmalloc_objs(): a helper for resizing arrays is provided in the form of
> krealloc_array().
Think about why this is wrong too.
And you should have cc'd linux-mm on this.
next prev parent reply other threads:[~2026-04-21 19:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 17:55 [PATCH v2 0/3] Documentation: adopt new coding style of type-aware kmalloc-family Manuel Ebner
2026-04-21 18:01 ` [PATCH v2 1/3] " Manuel Ebner
2026-04-21 19:24 ` Matthew Wilcox [this message]
2026-04-21 19:50 ` Manuel Ebner
2026-04-21 18:06 ` [PATCH v2 2/3] Documentation: RCU: " Manuel Ebner
2026-04-21 18:41 ` Paul E. McKenney
2026-04-25 5:39 ` [PATCH v3 " Manuel Ebner
2026-04-21 18:09 ` [PATCH v2 3/3] Documentation: deprecated.rst: kmalloc-family: mark argument as optional Manuel Ebner
2026-04-22 7:14 ` Geert Uytterhoeven
2026-04-22 12:09 ` Manuel Ebner
2026-04-22 12:15 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aefPCV4ZvrnrCmoH@casper.infradead.org \
--to=willy@infradead.org \
--cc=corbet@lwn.net \
--cc=kees@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=manuelebner@mailbox.org \
--cc=skhan@linuxfoundation.org \
--cc=workflows@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.