* [PATCH] slub: remove a minus instruction in get_partial_node
@ 2011-09-29 10:05 Alex,Shi
2011-09-29 14:18 ` Christoph Lameter
0 siblings, 1 reply; 7+ messages in thread
From: Alex,Shi @ 2011-09-29 10:05 UTC (permalink / raw)
To: cl@linux.com, Pekka Enberg; +Cc: linux-mm, Chen, Tim C, Huang, Ying
Don't do a minus action in get_partial_node function here, since
it is always zero.
Signed-off-by: Alex Shi <alex.shi@intel.com>
---
mm/slub.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 492beab..eb36a6b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1613,7 +1613,7 @@ static void *get_partial_node(struct kmem_cache *s,
spin_lock(&n->list_lock);
list_for_each_entry_safe(page, page2, &n->partial, lru) {
void *t = acquire_slab(s, n, page, object == NULL);
- int available;
+ int available = 0;
if (!t)
continue;
@@ -1623,7 +1623,6 @@ static void *get_partial_node(struct kmem_cache *s,
c->node = page_to_nid(page);
stat(s, ALLOC_FROM_PARTIAL);
object = t;
- available = page->objects - page->inuse;
} else {
page->freelist = t;
available = put_cpu_partial(s, page, 0);
--
1.7.0
--
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>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] slub: remove a minus instruction in get_partial_node
2011-09-29 10:05 [PATCH] slub: remove a minus instruction in get_partial_node Alex,Shi
@ 2011-09-29 14:18 ` Christoph Lameter
2011-10-02 12:55 ` Shi, Alex
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Lameter @ 2011-09-29 14:18 UTC (permalink / raw)
To: Alex,Shi; +Cc: Pekka Enberg, linux-mm, Chen, Tim C, Huang, Ying
On Thu, 29 Sep 2011, Alex,Shi wrote:
> Don't do a minus action in get_partial_node function here, since
> it is always zero.
A slab on the partial lists always has objects available. Why would it be
zero?
--
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>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] slub: remove a minus instruction in get_partial_node
2011-09-29 14:18 ` Christoph Lameter
@ 2011-10-02 12:55 ` Shi, Alex
2011-10-03 13:55 ` Christoph Lameter
0 siblings, 1 reply; 7+ messages in thread
From: Shi, Alex @ 2011-10-02 12:55 UTC (permalink / raw)
To: Christoph Lameter
Cc: Pekka Enberg, linux-mm@kvack.org, Chen, Tim C, Huang, Ying
> -----Original Message-----
> From: Christoph Lameter [mailto:cl@gentwo.org]
> Sent: Thursday, September 29, 2011 10:19 PM
> To: Shi, Alex
> Cc: Pekka Enberg; linux-mm@kvack.org; Chen, Tim C; Huang, Ying
> Subject: Re: [PATCH] slub: remove a minus instruction in get_partial_node
>
> On Thu, 29 Sep 2011, Alex,Shi wrote:
>
> > Don't do a minus action in get_partial_node function here, since
> > it is always zero.
>
> A slab on the partial lists always has objects available. Why would it be
> zero?
Um, my mistaken. The reason should be: if code is here, the slab will be per cpu slab.
It is no chance to be in per cpu partial and no relationship with per cpu partial. So
no reason to use this value as a criteria for filling per cpu 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>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] slub: remove a minus instruction in get_partial_node
2011-10-02 12:55 ` Shi, Alex
@ 2011-10-03 13:55 ` Christoph Lameter
2011-10-08 2:48 ` Alex,Shi
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Lameter @ 2011-10-03 13:55 UTC (permalink / raw)
To: Shi, Alex; +Cc: Pekka Enberg, linux-mm@kvack.org, Chen, Tim C, Huang, Ying
On Sun, 2 Oct 2011, Shi, Alex wrote:
> > A slab on the partial lists always has objects available. Why would it be
> > zero?
>
> Um, my mistaken. The reason should be: if code is here, the slab will be per cpu slab.
> It is no chance to be in per cpu partial and no relationship with per cpu partial. So
> no reason to use this value as a criteria for filling per cpu partial.
I am not sure I understand you. The point of the code is to count the
objects available in the per cpu partial pages so that we can limit the
number of pages we fetch from the per node partial list.
--
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>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] slub: remove a minus instruction in get_partial_node
2011-10-03 13:55 ` Christoph Lameter
@ 2011-10-08 2:48 ` Alex,Shi
2011-10-10 17:11 ` Christoph Lameter
0 siblings, 1 reply; 7+ messages in thread
From: Alex,Shi @ 2011-10-08 2:48 UTC (permalink / raw)
To: Christoph Lameter
Cc: Pekka Enberg, linux-mm@kvack.org, Chen, Tim C, Huang, Ying
On Mon, 2011-10-03 at 21:55 +0800, Christoph Lameter wrote:
> On Sun, 2 Oct 2011, Shi, Alex wrote:
>
> > > A slab on the partial lists always has objects available. Why would it be
> > > zero?
> >
> > Um, my mistaken. The reason should be: if code is here, the slab will be per cpu slab.
> > It is no chance to be in per cpu partial and no relationship with per cpu partial. So
> > no reason to use this value as a criteria for filling per cpu partial.
>
> I am not sure I understand you. The point of the code is to count the
> objects available in the per cpu partial pages so that we can limit the
> number of pages we fetch from the per node partial list.
Maybe my understanding is incorrect for PCP. :)
What I thought is: when object == null, the page we got from node
partial list will be added into cpu slab. It has no chance to become per
cpu partial page. And it has no relationship with further per cpu
partial count checking. Since even 'available > cpu_partial/2', it
doesn't mean per cpu partial objects number > cpu_partial/2.
--
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>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] slub: remove a minus instruction in get_partial_node
2011-10-08 2:48 ` Alex,Shi
@ 2011-10-10 17:11 ` Christoph Lameter
2011-10-11 9:50 ` Alex,Shi
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Lameter @ 2011-10-10 17:11 UTC (permalink / raw)
To: Alex,Shi; +Cc: Pekka Enberg, linux-mm@kvack.org, Chen, Tim C, Huang, Ying
On Sat, 8 Oct 2011, Alex,Shi wrote:
> On Mon, 2011-10-03 at 21:55 +0800, Christoph Lameter wrote:
> > On Sun, 2 Oct 2011, Shi, Alex wrote:
> >
> > > > A slab on the partial lists always has objects available. Why would it be
> > > > zero?
> > >
> > > Um, my mistaken. The reason should be: if code is here, the slab will be per cpu slab.
> > > It is no chance to be in per cpu partial and no relationship with per cpu partial. So
> > > no reason to use this value as a criteria for filling per cpu partial.
> >
> > I am not sure I understand you. The point of the code is to count the
> > objects available in the per cpu partial pages so that we can limit the
> > number of pages we fetch from the per node partial list.
>
> Maybe my understanding is incorrect for PCP. :)
> What I thought is: when object == null, the page we got from node
> partial list will be added into cpu slab. It has no chance to become per
> cpu partial page. And it has no relationship with further per cpu
> partial count checking. Since even 'available > cpu_partial/2', it
> doesn't mean per cpu partial objects number > cpu_partial/2.
acquire_slab should not return NULL unless something seriously goes wrong.
I think we can remove the]
if (!t)
statement to avoid futher confusion?
--
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>
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] slub: remove a minus instruction in get_partial_node
2011-10-10 17:11 ` Christoph Lameter
@ 2011-10-11 9:50 ` Alex,Shi
0 siblings, 0 replies; 7+ messages in thread
From: Alex,Shi @ 2011-10-11 9:50 UTC (permalink / raw)
To: Christoph Lameter
Cc: Pekka Enberg, linux-mm@kvack.org, Chen, Tim C, Huang, Ying
On Tue, 2011-10-11 at 01:11 +0800, Christoph Lameter wrote:
> On Sat, 8 Oct 2011, Alex,Shi wrote:
>
> > On Mon, 2011-10-03 at 21:55 +0800, Christoph Lameter wrote:
> > > On Sun, 2 Oct 2011, Shi, Alex wrote:
> > >
> > > > > A slab on the partial lists always has objects available. Why would it be
> > > > > zero?
> > > >
> > > > Um, my mistaken. The reason should be: if code is here, the slab will be per cpu slab.
> > > > It is no chance to be in per cpu partial and no relationship with per cpu partial. So
> > > > no reason to use this value as a criteria for filling per cpu partial.
> > >
> > > I am not sure I understand you. The point of the code is to count the
> > > objects available in the per cpu partial pages so that we can limit the
> > > number of pages we fetch from the per node partial list.
> >
> > Maybe my understanding is incorrect for PCP. :)
> > What I thought is: when object == null, the page we got from node
> > partial list will be added into cpu slab. It has no chance to become per
> > cpu partial page. And it has no relationship with further per cpu
> > partial count checking. Since even 'available > cpu_partial/2', it
> > doesn't mean per cpu partial objects number > cpu_partial/2.
>
> acquire_slab should not return NULL unless something seriously goes wrong.
> I think we can remove the]
>
> if (!t)
>
> statement to avoid futher confusion?
That is another story.
Wondering if a page freeing by discard_slab impact this or not. I don't
fully understand the slub page alloc/free now, may study this later. :)
--
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>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-10-11 9:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-29 10:05 [PATCH] slub: remove a minus instruction in get_partial_node Alex,Shi
2011-09-29 14:18 ` Christoph Lameter
2011-10-02 12:55 ` Shi, Alex
2011-10-03 13:55 ` Christoph Lameter
2011-10-08 2:48 ` Alex,Shi
2011-10-10 17:11 ` Christoph Lameter
2011-10-11 9:50 ` Alex,Shi
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).