Skip to contentSkip to conversation

mm/slub: correct the comment in calculate_order()

PATCH In review Wei Yang 3 participants 7 messages Sep 29, 2015 – Oct 21, 2015

Subsystems (2)
lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/2 mm/slub: correct the comment in calculate_order()

In calculate_order(), it tries to calculate the best order by adjusting the fraction and min_objects. On each iteration on min_objects, fraction iterates on 16, 8, 4. Which means the acceptable waste increases with 1/16, 1/8, 1/4.

This patch corrects the comment according to the code.

---
 mm/slub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/slub.c +1 -1
index f614b5d..a94b9f4 100644
@@ -2943,7 +2943,7 @@ static inline int calculate_order(int size, int reserved)
 	 * works by first attempting to generate a layout with
 	 * the best configuration and backing off gradually.
 	 *
-	 * First we reduce the acceptable waste in a slab. Then
+	 * First we increase the acceptable waste in a slab. Then
 	 * we reduce the minimum objects required in a slab.
 	 */
 	min_objects = slub_min_objects;
Signature · 7 lines
2.5.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
author
#1 lore raw

PATCH 2/2 mm/slub: use get_order() instead of fls()

get_order() is more easy to understand.

This patch just replaces it.

---
 mm/slub.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/slub.c +1 -2
index a94b9f4..e309ed1 100644
@@ -2912,8 +2912,7 @@ static inline int slab_order(int size, int min_objects,
 	if (order_objects(min_order, size, reserved) > MAX_OBJS_PER_PAGE)
 		return get_order(size * MAX_OBJS_PER_PAGE) - 1;
 
-	for (order = max(min_order,
-				fls(min_objects * size - 1) - PAGE_SHIFT);
+	for (order = max(min_order, get_order(min_objects * size));
 			order <= max_order; order++) {
 
 		unsigned long slab_size = PAGE_SIZE << order;
Signature · 7 lines
2.5.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] mm/slub: use get_order() instead of fls()

Quoted 5 lines · Wei Yang

get_order() is more easy to understand.

This patch just replaces it.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#3 lore raw

Re: [PATCH 2/2] mm/slub: use get_order() instead of fls()

Quoted 8 lines · Pekka Enberg
Quoted 5 lines · Wei Yang

get_order() is more easy to understand.

This patch just replaces it.

Thanks Pekka ~

Signature · 8 lines
Richard Yang
Help you, Help me

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
author
#4 lore raw

Re: [PATCH 2/2] mm/slub: use get_order() instead of fls()

In reply to Pekka Enberg
Quoted 8 lines · Pekka Enberg
Quoted 5 lines · Wei Yang

get_order() is more easy to understand.

This patch just replaces it.

Is this patch accepted or not?

I don't receive an "Apply" or "Accepted", neither see it in a git tree. Not sure if I missed something or the process is different as I know?

Signature · 8 lines
Richard Yang
Help you, Help me

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#5 lore raw

Re: [PATCH 2/2] mm/slub: use get_order() instead of fls()

Quoted 6 lines · Wei Yang
Quoted 5 lines · Pekka Enberg
Quoted 4 lines · Wei Yang

get_order() is more easy to understand.

This patch just replaces it.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Is this patch accepted or not?

I don't receive an "Apply" or "Accepted", neither see it in a git tree. Not sure if I missed something or the process is different as I know?

You should probably resend and include Andrew Morton in To/CC, instead of just linux-mm.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author
#6 lore raw

Re: [PATCH 2/2] mm/slub: use get_order() instead of fls()

Quoted 11 lines · Vlastimil Babka
Quoted 10 lines · Wei Yang
Quoted 8 lines · Pekka Enberg
Quoted 5 lines · Wei Yang

get_order() is more easy to understand.

This patch just replaces it.

Quoted 7 lines
Quoted 4 lines

Is this patch accepted or not?

I don't receive an "Apply" or "Accepted", neither see it in a git tree. Not sure if I missed something or the process is different as I know?

You should probably resend and include Andrew Morton in To/CC, instead of just linux-mm.

Oh, got it.

Thanks

Signature · 8 lines
Richard Yang
Help you, Help me

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>