linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	David Rientjes <rientjes@google.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH 1/2] percpu: make @dyn_size always mean min dyn_size in first chunk init functions
Date: Sat, 19 Jun 2010 10:23:04 +0200	[thread overview]
Message-ID: <4C1C7E68.8080700@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1006181300320.14715@router.home>

Hello,

On 06/18/2010 08:03 PM, Christoph Lameter wrote:
>> Yeah, something like that but I would add some buffer there for
>> alignment and whatnot.
> 
> Only the percpu allocator would know the waste for alignment and
> "whatnot". What would you like me to add to the above formula to make it
> safe?

I'm not sure, some sensible slack.  :-)

>>> What is the role of SLOTS?
>>
>> It's allocation map.  Each consecutive allocs consume one if alignment
>> doesn't require padding but two if it does.  ie. It limits how many
>> items one can allocate.
>>
>>> Each kmem_cache_cpu structure is a separate percpu allocation.
>>
>> If it's a single item.  Nothing to worry about.
> 
> ok so
> 
> BUILD_BUG_ON(SLUB_PAGE_SHIFT * <fuzz-factor> > SLOTS);
> 
> I dont know what fuzz factor would be needed.
> 
> Maybe its best to have a macro provided by percpu?
> 
> VERIFY_EARLY_ALLOCS(<nr-of-allocs>,<total-size-consumed>)
> 
> The macro would generate the proper BUILD_BUG_ON?

The problem is that alignment of each item and their allocation order
also matter.  Even the percpu allocator itself can't tell for sure
before actually allocating it.  As it's gonna be used only by the slab
allocator at least for now && those preallocated areas aren't wasted
anyway, just giving it enough should work good enough, I think.  Say,
multiply everything by two.

Thanks.

-- 
tejun

--
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>

  reply	other threads:[~2010-06-19  8:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-15 19:07 slub: remove dynamic dma slab allocation Christoph Lameter
2010-06-15 19:11 ` [RFC] slub: Simplify boot kmem_cache_cpu allocations Christoph Lameter
2010-06-16  8:53   ` Tejun Heo
2010-06-16 16:33     ` Christoph Lameter
2010-06-16 17:18       ` Tejun Heo
2010-06-16 17:35         ` Christoph Lameter
2010-06-17  8:49           ` Tejun Heo
2010-06-17  9:01             ` Pekka Enberg
2010-06-17 13:43             ` Christoph Lameter
2010-06-18 16:58               ` [PATCH 1/2] percpu: make @dyn_size always mean min dyn_size in first chunk init functions Tejun Heo
2010-06-18 17:29                 ` Christoph Lameter
2010-06-18 17:31                 ` Christoph Lameter
2010-06-18 17:39                   ` Tejun Heo
2010-06-18 18:03                     ` Christoph Lameter
2010-06-19  8:23                       ` Tejun Heo [this message]
2010-06-18 16:58               ` [PATCH 2/2] percpu: allow limited allocation before slab is online Tejun Heo
2010-06-18 22:30 ` slub: remove dynamic dma slab allocation David Rientjes
2010-06-21 14:25   ` Christoph Lameter
2010-06-21 19:56     ` David Rientjes
2010-06-21 20:32       ` Christoph Lameter
2010-06-21 21:08         ` David Rientjes

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=4C1C7E68.8080700@kernel.org \
    --to=tj@kernel.org \
    --cc=cl@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=rientjes@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).