From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Jon Tollefson <kniht@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
penberg@cs.helsinki.fi, mpm@selenic.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, cl@linux-foundation.org
Subject: Re: SL*B: drop kmem cache argument from constructor
Date: Mon, 14 Jul 2008 14:48:21 +1000 [thread overview]
Message-ID: <200807141448.22233.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <4877D35E.8080209@linux.vnet.ibm.com>
On Saturday 12 July 2008 07:40, Jon Tollefson wrote:
> Andrew Morton wrote:
> > btw, Nick, what's with that dopey
> >
> > huge_pgtable_cache(psize) = kmem_cache_create(...
> >
> > trick? The result of a function call is not an lvalue, and writing a
> > macro which pretends to be a function and then using it in some manner
> > in which a function cannot be used is seven ways silly :(
I agree it isn't nice.
> That silliness came from me.
> It came from my simplistic translation of the existing code to handle
> multiple huge page sizes. I would agree it would be easier to read and
> more straight forward to just have the indexed array directly on the
> left side instead of a macro. I can send out a patch that makes that
> change if desired.
> Something such as
>
> +#define HUGE_PGTABLE_INDEX(psize) (HUGEPTE_CACHE_NUM + psize - 1)
>
> -huge_pgtable_cache(psize) = kmem_cache_create(...
> +pgtable_cache[HUGE_PGTABLE_INDEX(psize)] = kmem_cache_create(...
>
>
> or if there is a more accepted way of handling this situation I can
> amend it differently.
If it is a once off initialization (which it is), that's probably fine
like that. Otherwise, the convention is to have a set_huge_pgtable_cache
function as well. But whatever you prefer. Yes if you can send a patch,
that would be good, thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-07-14 4:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-10 1:11 Alexey Dobriyan
2008-07-10 7:13 ` Pekka Enberg
2008-07-10 13:24 ` Christoph Lameter
2008-07-10 16:44 ` Jon Tollefson
2008-07-11 19:22 ` Andrew Morton
2008-07-11 19:38 ` Matt Mackall
2008-07-11 21:40 ` Jon Tollefson
2008-07-14 4:48 ` Nick Piggin [this message]
2008-07-14 4:44 ` Nick Piggin
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=200807141448.22233.nickpiggin@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=kniht@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.com \
--cc=penberg@cs.helsinki.fi \
/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