mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@quark.didntduck.org>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: Brian Gerst <bgerst@didntduck.org>,
	Anton Blanchard <anton@samba.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] slab.c cleanup
Date: Sun, 23 Mar 2003 16:51:37 -0500	[thread overview]
Message-ID: <3E7E2C69.5080401@quark.didntduck.org> (raw)
In-Reply-To: <3E7E252A.2030902@colorfullife.com>

Manfred Spraul wrote:
> Brian Gerst wrote:
> 
>>
>> Perhaps, but it currently is already allocating 128 bytes for smaller 
>> caches, because the cache is created with SLAB_HWCACHE_ALIGN.  So we 
>> ended up with redundantly sized caches.
>>
> 
> linux/mm/slab.c:
> 
>>     if (flags & SLAB_HWCACHE_ALIGN) {
>>         /* Need to adjust size so that objs are cache aligned. */
>>         /* Small obj size, can get at least two per cache line. */
>>         while (size < align/2)
>>             align /= 2;
>>         size = (size+align-1)&(~(align-1));
>>     }
>>  
>>
> HWALIGN is just a hint, the implementation ignores it if it results in 
> unreasonable wasting of memory.

I think I see what was causing be to believe it was always rounding up 
to the cache size.  The while test should be while (size <= align/2). 
On my machine (athlon, 64 byte cache), the size-32 cache was rounded up 
to 64 bytes because of this.

size-128            1416   1470    128   49   49    1 :  248  124
size-64              351    413     64    7    7    1 :  248  124
size-32              649    649     64   11   11    1 :  248  124
                                    ^^^^

--
				Brian Gerst



  reply	other threads:[~2003-03-23 21:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-23 20:59 Manfred Spraul
2003-03-23 21:07 ` Brian Gerst
2003-03-23 21:20   ` Manfred Spraul
2003-03-23 21:51     ` Brian Gerst [this message]
     [not found] <20030323211010$1215@gated-at.bofh.it>
     [not found] ` <20030323211014$2f0c@gated-at.bofh.it>
2003-03-23 21:24   ` Arnd Bergmann
     [not found] <20030323191010$7678@gated-at.bofh.it>
2003-03-23 21:11 ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2003-03-23 18:58 Brian Gerst
2003-03-23 19:12 ` Anton Blanchard

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=3E7E2C69.5080401@quark.didntduck.org \
    --to=bgerst@quark.didntduck.org \
    --cc=anton@samba.org \
    --cc=bgerst@didntduck.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.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

all inboxes | Powered by JetHome®