* [PATCH 1/2] mm/slub: correct the comment in calculate_order()
@ 2015-09-29 1:06 Wei Yang
2015-09-29 1:06 ` [PATCH 2/2] mm/slub: use get_order() instead of fls() Wei Yang
0 siblings, 1 reply; 7+ messages in thread
From: Wei Yang @ 2015-09-29 1:06 UTC (permalink / raw)
To: cl, penberg, rientjes; +Cc: linux-mm, Wei Yang
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.
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/slub.c b/mm/slub.c
index f614b5d..a94b9f4 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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;
--
2.5.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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] mm/slub: use get_order() instead of fls()
2015-09-29 1:06 [PATCH 1/2] mm/slub: correct the comment in calculate_order() Wei Yang
@ 2015-09-29 1:06 ` Wei Yang
2015-09-29 8:08 ` Pekka Enberg
0 siblings, 1 reply; 7+ messages in thread
From: Wei Yang @ 2015-09-29 1:06 UTC (permalink / raw)
To: cl, penberg, rientjes; +Cc: linux-mm, Wei Yang
get_order() is more easy to understand.
This patch just replaces it.
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
---
mm/slub.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index a94b9f4..e309ed1 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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;
--
2.5.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/ .
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 2/2] mm/slub: use get_order() instead of fls()
2015-09-29 1:06 ` [PATCH 2/2] mm/slub: use get_order() instead of fls() Wei Yang
@ 2015-09-29 8:08 ` Pekka Enberg
2015-09-30 2:23 ` Wei Yang
2015-10-21 7:42 ` Wei Yang
0 siblings, 2 replies; 7+ messages in thread
From: Pekka Enberg @ 2015-09-29 8:08 UTC (permalink / raw)
To: Wei Yang, cl, penberg, rientjes; +Cc: linux-mm
On 09/29/2015 04:06 AM, Wei Yang wrote:
> get_order() is more easy to understand.
>
> This patch just replaces it.
>
> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] mm/slub: use get_order() instead of fls()
2015-09-29 8:08 ` Pekka Enberg
@ 2015-09-30 2:23 ` Wei Yang
2015-10-21 7:42 ` Wei Yang
1 sibling, 0 replies; 7+ messages in thread
From: Wei Yang @ 2015-09-30 2:23 UTC (permalink / raw)
To: Pekka Enberg; +Cc: Wei Yang, cl, penberg, rientjes, linux-mm
On Tue, Sep 29, 2015 at 11:08:28AM +0300, Pekka Enberg wrote:
>On 09/29/2015 04:06 AM, Wei Yang wrote:
>>get_order() is more easy to understand.
>>
>>This patch just replaces it.
>>
>>Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>
>Reviewed-by: Pekka Enberg <penberg@kernel.org>
Thanks Pekka ~
--
Richard Yang
Help you, Help me
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] mm/slub: use get_order() instead of fls()
2015-09-29 8:08 ` Pekka Enberg
2015-09-30 2:23 ` Wei Yang
@ 2015-10-21 7:42 ` Wei Yang
2015-10-21 8:07 ` Vlastimil Babka
1 sibling, 1 reply; 7+ messages in thread
From: Wei Yang @ 2015-10-21 7:42 UTC (permalink / raw)
To: Pekka Enberg; +Cc: Wei Yang, cl, penberg, rientjes, linux-mm
On Tue, Sep 29, 2015 at 11:08:28AM +0300, Pekka Enberg wrote:
>On 09/29/2015 04:06 AM, Wei Yang wrote:
>>get_order() is more easy to understand.
>>
>>This patch just replaces it.
>>
>>Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>
>Reviewed-by: Pekka Enberg <penberg@kernel.org>
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?
--
Richard Yang
Help you, Help me
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] mm/slub: use get_order() instead of fls()
2015-10-21 7:42 ` Wei Yang
@ 2015-10-21 8:07 ` Vlastimil Babka
2015-10-21 8:09 ` Wei Yang
0 siblings, 1 reply; 7+ messages in thread
From: Vlastimil Babka @ 2015-10-21 8:07 UTC (permalink / raw)
To: Wei Yang, Pekka Enberg; +Cc: cl, penberg, rientjes, linux-mm
On 10/21/2015 09:42 AM, Wei Yang wrote:
> On Tue, Sep 29, 2015 at 11:08:28AM +0300, Pekka Enberg wrote:
>> On 09/29/2015 04:06 AM, Wei Yang wrote:
>>> get_order() is more easy to understand.
>>>
>>> This patch just replaces it.
>>>
>>> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>>
>> Reviewed-by: Pekka Enberg <penberg@kernel.org>
>
> 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 majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] mm/slub: use get_order() instead of fls()
2015-10-21 8:07 ` Vlastimil Babka
@ 2015-10-21 8:09 ` Wei Yang
0 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2015-10-21 8:09 UTC (permalink / raw)
To: Vlastimil Babka; +Cc: Wei Yang, Pekka Enberg, cl, penberg, rientjes, linux-mm
On Wed, Oct 21, 2015 at 10:07:04AM +0200, Vlastimil Babka wrote:
>On 10/21/2015 09:42 AM, Wei Yang wrote:
>>On Tue, Sep 29, 2015 at 11:08:28AM +0300, Pekka Enberg wrote:
>>>On 09/29/2015 04:06 AM, Wei Yang wrote:
>>>>get_order() is more easy to understand.
>>>>
>>>>This patch just replaces it.
>>>>
>>>>Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>>>
>>>Reviewed-by: Pekka Enberg <penberg@kernel.org>
>>
>>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
--
Richard Yang
Help you, Help me
--
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/ .
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:[~2015-10-21 8:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-29 1:06 [PATCH 1/2] mm/slub: correct the comment in calculate_order() Wei Yang
2015-09-29 1:06 ` [PATCH 2/2] mm/slub: use get_order() instead of fls() Wei Yang
2015-09-29 8:08 ` Pekka Enberg
2015-09-30 2:23 ` Wei Yang
2015-10-21 7:42 ` Wei Yang
2015-10-21 8:07 ` Vlastimil Babka
2015-10-21 8:09 ` Wei Yang
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).