From: Vlastimil Babka <vbabka@suse.cz>
To: Matthew Wilcox <willy@infradead.org>, linux-mm@kvack.org
Subject: Re: Number of arguments in vmalloc.c
Date: Mon, 3 Dec 2018 14:59:36 +0100 [thread overview]
Message-ID: <3264149f-e01e-faa2-3bc8-8aa1c255e075@suse.cz> (raw)
In-Reply-To: <20181128140136.GG10377@bombadil.infradead.org>
On 11/28/18 3:01 PM, Matthew Wilcox wrote:
>
> Some of the functions in vmalloc.c have as many as nine arguments.
> So I thought I'd have a quick go at bundling the ones that make sense
> into a struct and pass around a pointer to that struct. Well, it made
> the generated code worse,
Worse in which metric?
> so I thought I'd share my attempt so nobody
> else bothers (or soebody points out that I did something stupid).
I guess in some of the functions the args parameter could be const?
Might make some difference.
Anyway this shouldn't be a fast path, so even if the generated code is
e.g. somewhat larger, then it still might make sense to reduce the
insane parameter lists.
> I tried a few variations on this theme; bundling gfp_t and node into
> the struct made it even worse, as did adding caller and vm_flags. This
> is the least bad version.
>
> (Yes, the naming is bad; I'm not tidying this up for submission, I'm
> showing an experiment that didn't work).
>
> Nacked-by: Matthew Wilcox <willy@infradead.org>
>
next prev parent reply other threads:[~2018-12-03 13:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-28 14:01 Matthew Wilcox
2018-12-03 13:59 ` Vlastimil Babka [this message]
2018-12-03 16:13 ` Matthew Wilcox
2018-12-03 22:04 ` Nadav Amit
2018-12-03 22:49 ` Matthew Wilcox
2018-12-04 3:12 ` Nadav Amit
2018-12-06 8:28 ` Nadav Amit
2018-12-06 10:25 ` Peter Zijlstra
2018-12-06 11:24 ` Peter Zijlstra
2018-12-06 17:26 ` Nadav Amit
2018-12-07 8:45 ` Peter Zijlstra
2018-12-07 23:12 ` Nadav Amit
2018-12-08 0:40 ` Should this_cpu_read() be volatile? Nadav Amit
2018-12-08 10:52 ` Peter Zijlstra
2018-12-10 0:57 ` Nadav Amit
2018-12-10 8:55 ` Peter Zijlstra
2018-12-11 17:11 ` Nadav Amit
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=3264149f-e01e-faa2-3bc8-8aa1c255e075@suse.cz \
--to=vbabka@suse.cz \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.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