lkml.org 
[lkml]   [2011]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [patch 2/2]slub: add a type for slab partial list position
From
Date
On Wed, 2011-08-24 at 08:57 +0800, Li, Shaohua wrote:
> On Tue, 2011-08-23 at 23:25 +0800, Christoph Lameter wrote:
> > On Tue, 23 Aug 2011, Shaohua Li wrote:
> >
> > > Adding slab to partial list head/tail is sensentive to performance.
> > > So adding a type to document it to avoid we get it wrong.
> >
> > I think that if you want to make it more descriptive then using the stats
> > values (DEACTIVATE_TO_TAIL/HEAD) would avoid having to introduce an
> > additional enum and it would also avoid the if statement in the stat call.
> ok, that's better.
>
> Subject: slub: explicitly document position of inserting slab to partial list
>
> Adding slab to partial list head/tail is sensitive to performance.
> So explicitly uses DEACTIVATE_TO_TAIL/DEACTIVATE_TO_HEAD to document
> it to avoid we get it wrong.

Frankly speaking, using DEACTIVATE_TO_TAIL/DEACTIVATE_TO_HEAD in
slab_alloc, slab_free make code hard to understand. Just adding some
comments will be more clear and understandable. like the following:
Do you think so?


--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2377,6 +2377,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page,
*/
if (unlikely(!prior)) {
remove_full(s, page);
+ /* only one object left in the page, so add to partial tail */
add_partial(n, page, 1);
stat(s, FREE_ADD_PARTIAL);
}



\
 
 \ /
  Last update: 2011-08-29 05:03    [W:0.076 / U:2.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site