From: Mateusz Guzik <mjguzik@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] ratelimit: convert flags to int to save 8 bytes in size
Date: Sat, 17 Aug 2024 14:41:52 +0200 [thread overview]
Message-ID: <w65wgoyfu65xzeftqcc2xyrikvrq2nfmmqiq3z5jqytt65g3wu@2kykf4kwra3z> (raw)
In-Reply-To: <20240817123754.240924-1-mjguzik@gmail.com>
On Sat, Aug 17, 2024 at 02:37:54PM +0200, Mateusz Guzik wrote:
> Only bit 1 is used, making an unsigned long a total overkill.
>
> This brings it from 64 to 32 bytes, which in turn shrinks user_struct
sigh, 40 to 32 bytes of course
this is embedded into user_struct, avoidably pushing it past 128 bytes
of size
> from 136 to 128 bytes. Since the latter is allocated with hwalign, this
> means the total usage goes down from 192 to 128 bytes per object.
>
> No functional changes.
>
> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
> ---
>
> ./scripts/get_maintainer.pl --git was most unhelpful showing nothing
>
> I have no idea who to prod about it, I think it is pretty trivial not
> needing any discussion.
>
> Andrew Morton pulled in some of the changes to the file, so that's my
> primary recipient.
>
> include/linux/ratelimit_types.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/ratelimit_types.h b/include/linux/ratelimit_types.h
> index 002266693e50..765232ce0b5e 100644
> --- a/include/linux/ratelimit_types.h
> +++ b/include/linux/ratelimit_types.h
> @@ -19,8 +19,8 @@ struct ratelimit_state {
> int burst;
> int printed;
> int missed;
> + unsigned int flags;
> unsigned long begin;
> - unsigned long flags;
> };
>
> #define RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, flags_init) { \
> --
> 2.43.0
>
>
prev parent reply other threads:[~2024-08-17 12:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-17 12:37 Mateusz Guzik
2024-08-17 12:41 ` Mateusz Guzik [this message]
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=w65wgoyfu65xzeftqcc2xyrikvrq2nfmmqiq3z5jqytt65g3wu@2kykf4kwra3z \
--to=mjguzik@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox