From: "Alex,Shi" <alex.shi@intel.com>
To: "Li, Shaohua" <shaohua.li@intel.com>
Cc: Christoph Lameter <cl@linux.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm <linux-mm@kvack.org>,
lkml <linux-kernel@vger.kernel.org>,
"penberg@kernel.org" <penberg@kernel.org>,
"Chen, Tim C" <tim.c.chen@intel.com>
Subject: Re: [patch 2/2]slub: add a type for slab partial list position
Date: Mon, 29 Aug 2011 11:06:27 +0800 [thread overview]
Message-ID: <1314587187.4523.55.camel@debian> (raw)
In-Reply-To: <1314147472.29510.25.camel@sli10-conroe>
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);
}
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-08-29 3:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-23 0:37 [patch 2/2]slub: add a type for slab partial list position Shaohua Li
2011-08-23 15:25 ` Christoph Lameter
2011-08-24 0:57 ` Shaohua Li
2011-08-24 13:55 ` Christoph Lameter
2011-08-29 3:06 ` Alex,Shi [this message]
2011-08-29 14:20 ` Christoph Lameter
2011-08-30 1:51 ` Shaohua Li
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=1314587187.4523.55.camel@debian \
--to=alex.shi@intel.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=shaohua.li@intel.com \
--cc=tim.c.chen@intel.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).