* [PATCH] sched: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
@ 2019-12-23 1:52 Yi Wang
2019-12-23 16:07 ` Markus Elfring
0 siblings, 1 reply; 5+ messages in thread
From: Yi Wang @ 2019-12-23 1:52 UTC (permalink / raw)
To: mingo
Cc: peterz, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
bsegall, mgorman, linux-kernel, xue.zhihong, wang.yi59, up2wing,
wang.liang82, Huang Zijiang
From: Huang Zijiang <huang.zijiang@zte.com.cn>
Use kmem_cache_zalloc instead of manually setting kmem_cache_alloc
with flag GFP_ZERO since kzalloc sets allocated memory
to zero.
Signed-off-by: Huang Zijiang <huang.zijiang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f2b111b..981ee92 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6939,7 +6939,7 @@ struct task_group *sched_create_group(struct task_group *parent)
{
struct task_group *tg;
- tg = kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO);
+tg = kmem_cache_zalloc(task_group_cache, GFP_KERNEL);
if (!tg)
return ERR_PTR(-ENOMEM);
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sched: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
2019-12-23 1:52 [PATCH] sched: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO Yi Wang
@ 2019-12-23 16:07 ` Markus Elfring
0 siblings, 0 replies; 5+ messages in thread
From: Markus Elfring @ 2019-12-23 16:07 UTC (permalink / raw)
To: Yi Wang, Huang Zijiang
Cc: LKML, kernel-janitors, Ben Segall, Dietmar Eggemann, Ingo Molnar,
Juri Lelli, Mel Gorman, Peter Zijlstra, Steven Rostedt, up2wing,
Vincent Guittot, Wang Liang, Xue Zhihong
…
> +++ b/kernel/sched/core.c
> @@ -6939,7 +6939,7 @@ struct task_group *sched_create_group(struct task_group *parent)
…
> - tg = kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO);
> +tg = kmem_cache_zalloc(task_group_cache, GFP_KERNEL);
> if (!tg)
…
Please fix the indentation.
Would you like to apply a script for the semantic patch language
like the following?
@replacement@
expression gfp, x;
@@
x =
(
- kmalloc
+ kzalloc
|
- kmem_cache_alloc
+ kmem_cache_zalloc
)
(...,
gfp
- | __GFP_ZERO
)
Regards,
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] sched: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
@ 2020-02-12 9:54 Yi Wang
2020-02-12 10:11 ` Peter Zijlstra
0 siblings, 1 reply; 5+ messages in thread
From: Yi Wang @ 2020-02-12 9:54 UTC (permalink / raw)
To: mingo
Cc: peterz, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
bsegall, mgorman, linux-kernel, xue.zhihong, wang.yi59,
wang.liang82, Huang Zijiang
From: Huang Zijiang <huang.zijiang@zte.com.cn>
Use kmem_cache_zalloc instead of manually setting kmem_cache_alloc
with flag GFP_ZERO since kzalloc sets allocated memory
to zero.
Change in v2:
add indation
Signed-off-by: Huang Zijiang <huang.zijiang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 90e4b00..20ea28f 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6949,7 +6949,7 @@ struct task_group *sched_create_group(struct task_group *parent)
{
struct task_group *tg;
- tg = kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO);
+ tg = kmem_cache_zalloc(task_group_cache, GFP_KERNEL);
if (!tg)
return ERR_PTR(-ENOMEM);
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sched: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
2020-02-12 9:54 Yi Wang
@ 2020-02-12 10:11 ` Peter Zijlstra
0 siblings, 0 replies; 5+ messages in thread
From: Peter Zijlstra @ 2020-02-12 10:11 UTC (permalink / raw)
To: Yi Wang
Cc: mingo, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
bsegall, mgorman, linux-kernel, xue.zhihong, wang.liang82,
Huang Zijiang
On Wed, Feb 12, 2020 at 05:54:21PM +0800, Yi Wang wrote:
> From: Huang Zijiang <huang.zijiang@zte.com.cn>
>
> Use kmem_cache_zalloc instead of manually setting kmem_cache_alloc
> with flag GFP_ZERO since kzalloc sets allocated memory
> to zero.
>
> Change in v2:
> add indation
Why? Isn't this more or less a whitespace change?
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] sched: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
@ 2020-06-17 7:54 Yi Wang
0 siblings, 0 replies; 5+ messages in thread
From: Yi Wang @ 2020-06-17 7:54 UTC (permalink / raw)
To: mingo
Cc: peterz, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
bsegall, mgorman, linux-kernel, xue.zhihong, wang.yi59,
wang.liang82, Liao Pingfang
From: Liao Pingfang <liao.pingfang@zte.com.cn>
Use kmem_cache_zalloc instead of calling kmem_cache_alloc
with flag GFP_ZERO.
Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 8f36032..5aac3ca 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7024,7 +7024,7 @@ struct task_group *sched_create_group(struct task_group *parent)
{
struct task_group *tg;
- tg = kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO);
+ tg = kmem_cache_zalloc(task_group_cache, GFP_KERNEL);
if (!tg)
return ERR_PTR(-ENOMEM);
--
2.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-06-17 7:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-23 1:52 [PATCH] sched: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO Yi Wang
2019-12-23 16:07 ` Markus Elfring
2020-02-12 9:54 Yi Wang
2020-02-12 10:11 ` Peter Zijlstra
2020-06-17 7:54 Yi Wang
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).