All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing: use kvzalloc for tgid_map array allocation
@ 2019-10-24  2:39 Chunyan Zhang
  2019-10-24  3:34 ` [PATCH] tracing: use kvcalloc " Chunyan Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Chunyan Zhang @ 2019-10-24  2:39 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: linux-kernel, Yuming Han, Chunyan Zhang


From: Yuming Han <yuming.han@unisoc.com>

Fail to allocate memory for tgid_map, because it requires order-6 page.
detail as:

c3 sh: page allocation failure: order:6,
   mode:0x140c0c0(GFP_KERNEL), nodemask=(null)
c3 sh cpuset=/ mems_allowed=0
c3 CPU: 3 PID: 5632 Comm: sh Tainted: G        W  O    4.14.133+ #10
c3 Hardware name: Generic DT based system
c3 Backtrace:
c3 [<c010bdbc>] (dump_backtrace) from [<c010c08c>](show_stack+0x18/0x1c)
c3 [<c010c074>] (show_stack) from [<c0993c54>](dump_stack+0x84/0xa4)
c3 [<c0993bd0>] (dump_stack) from [<c0229858>](warn_alloc+0xc4/0x19c)
c3 [<c0229798>] (warn_alloc) from [<c022a6e4>](__alloc_pages_nodemask+0xd18/0xf28)
c3 [<c02299cc>] (__alloc_pages_nodemask) from [<c0248344>](kmalloc_order+0x20/0x38)
c3 [<c0248324>] (kmalloc_order) from [<c0248380>](kmalloc_order_trace+0x24/0x108)
c3 [<c024835c>] (kmalloc_order_trace) from [<c01e6078>](set_tracer_flag+0xb0/0x158)
c3 [<c01e5fc8>] (set_tracer_flag) from [<c01e6404>](trace_options_core_write+0x7c/0xcc)
c3 [<c01e6388>] (trace_options_core_write) from [<c0278b1c>](__vfs_write+0x40/0x14c)
c3 [<c0278adc>] (__vfs_write) from [<c0278e10>](vfs_write+0xc4/0x198)
c3 [<c0278d4c>] (vfs_write) from [<c027906c>](SyS_write+0x6c/0xd0)
c3 [<c0279000>] (SyS_write) from [<c01079a0>](ret_fast_syscall+0x0/0x54)

Switch to use kvzmalloc to avoid unexpected allocation failures.

Signed-off-by: Yuming Han <yuming.han@unisoc.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 6a0ee9178365..2fa72419bbd7 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4609,7 +4609,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled)
 
 	if (mask == TRACE_ITER_RECORD_TGID) {
 		if (!tgid_map)
-			tgid_map = kcalloc(PID_MAX_DEFAULT + 1,
+			tgid_map = kvcalloc(PID_MAX_DEFAULT + 1,
 					   sizeof(*tgid_map),
 					   GFP_KERNEL);
 		if (!tgid_map) {
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] tracing: use kvcalloc for tgid_map array allocation
  2019-10-24  2:39 [PATCH] tracing: use kvzalloc for tgid_map array allocation Chunyan Zhang
@ 2019-10-24  3:34 ` Chunyan Zhang
  2019-11-01  3:21   ` Chunyan Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Chunyan Zhang @ 2019-10-24  3:34 UTC (permalink / raw)
  To: Steven Rostedt, Ingo Molnar; +Cc: linux-kernel, Yuming Han, Chunyan Zhang


From: Yuming Han <yuming.han@unisoc.com>

Fail to allocate memory for tgid_map, because it requires order-6 page.
detail as:

c3 sh: page allocation failure: order:6,
   mode:0x140c0c0(GFP_KERNEL), nodemask=(null)
c3 sh cpuset=/ mems_allowed=0
c3 CPU: 3 PID: 5632 Comm: sh Tainted: G        W  O    4.14.133+ #10
c3 Hardware name: Generic DT based system
c3 Backtrace:
c3 [<c010bdbc>] (dump_backtrace) from [<c010c08c>](show_stack+0x18/0x1c)
c3 [<c010c074>] (show_stack) from [<c0993c54>](dump_stack+0x84/0xa4)
c3 [<c0993bd0>] (dump_stack) from [<c0229858>](warn_alloc+0xc4/0x19c)
c3 [<c0229798>] (warn_alloc) from [<c022a6e4>](__alloc_pages_nodemask+0xd18/0xf28)
c3 [<c02299cc>] (__alloc_pages_nodemask) from [<c0248344>](kmalloc_order+0x20/0x38)
c3 [<c0248324>] (kmalloc_order) from [<c0248380>](kmalloc_order_trace+0x24/0x108)
c3 [<c024835c>] (kmalloc_order_trace) from [<c01e6078>](set_tracer_flag+0xb0/0x158)
c3 [<c01e5fc8>] (set_tracer_flag) from [<c01e6404>](trace_options_core_write+0x7c/0xcc)
c3 [<c01e6388>] (trace_options_core_write) from [<c0278b1c>](__vfs_write+0x40/0x14c)
c3 [<c0278adc>] (__vfs_write) from [<c0278e10>](vfs_write+0xc4/0x198)
c3 [<c0278d4c>] (vfs_write) from [<c027906c>](SyS_write+0x6c/0xd0)
c3 [<c0279000>] (SyS_write) from [<c01079a0>](ret_fast_syscall+0x0/0x54)

Switch to use kvcalloc to avoid unexpected allocation failures.

Signed-off-by: Yuming Han <yuming.han@unisoc.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 6a0ee9178365..2fa72419bbd7 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4609,7 +4609,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled)
 
 	if (mask == TRACE_ITER_RECORD_TGID) {
 		if (!tgid_map)
-			tgid_map = kcalloc(PID_MAX_DEFAULT + 1,
+			tgid_map = kvcalloc(PID_MAX_DEFAULT + 1,
 					   sizeof(*tgid_map),
 					   GFP_KERNEL);
 		if (!tgid_map) {
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tracing: use kvcalloc for tgid_map array allocation
  2019-10-24  3:34 ` [PATCH] tracing: use kvcalloc " Chunyan Zhang
@ 2019-11-01  3:21   ` Chunyan Zhang
  2019-11-13 19:40     ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Chunyan Zhang @ 2019-11-01  3:21 UTC (permalink / raw)
  To: Chunyan Zhang
  Cc: Steven Rostedt, Ingo Molnar, Linux Kernel Mailing List, Yuming Han

gentle ping

On Thu, 24 Oct 2019 at 11:34, Chunyan Zhang <chunyan.zhang@unisoc.com> wrote:
>
>
> From: Yuming Han <yuming.han@unisoc.com>
>
> Fail to allocate memory for tgid_map, because it requires order-6 page.
> detail as:
>
> c3 sh: page allocation failure: order:6,
>    mode:0x140c0c0(GFP_KERNEL), nodemask=(null)
> c3 sh cpuset=/ mems_allowed=0
> c3 CPU: 3 PID: 5632 Comm: sh Tainted: G        W  O    4.14.133+ #10
> c3 Hardware name: Generic DT based system
> c3 Backtrace:
> c3 [<c010bdbc>] (dump_backtrace) from [<c010c08c>](show_stack+0x18/0x1c)
> c3 [<c010c074>] (show_stack) from [<c0993c54>](dump_stack+0x84/0xa4)
> c3 [<c0993bd0>] (dump_stack) from [<c0229858>](warn_alloc+0xc4/0x19c)
> c3 [<c0229798>] (warn_alloc) from [<c022a6e4>](__alloc_pages_nodemask+0xd18/0xf28)
> c3 [<c02299cc>] (__alloc_pages_nodemask) from [<c0248344>](kmalloc_order+0x20/0x38)
> c3 [<c0248324>] (kmalloc_order) from [<c0248380>](kmalloc_order_trace+0x24/0x108)
> c3 [<c024835c>] (kmalloc_order_trace) from [<c01e6078>](set_tracer_flag+0xb0/0x158)
> c3 [<c01e5fc8>] (set_tracer_flag) from [<c01e6404>](trace_options_core_write+0x7c/0xcc)
> c3 [<c01e6388>] (trace_options_core_write) from [<c0278b1c>](__vfs_write+0x40/0x14c)
> c3 [<c0278adc>] (__vfs_write) from [<c0278e10>](vfs_write+0xc4/0x198)
> c3 [<c0278d4c>] (vfs_write) from [<c027906c>](SyS_write+0x6c/0xd0)
> c3 [<c0279000>] (SyS_write) from [<c01079a0>](ret_fast_syscall+0x0/0x54)
>
> Switch to use kvcalloc to avoid unexpected allocation failures.
>
> Signed-off-by: Yuming Han <yuming.han@unisoc.com>
> Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
> ---
>  kernel/trace/trace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 6a0ee9178365..2fa72419bbd7 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -4609,7 +4609,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled)
>
>         if (mask == TRACE_ITER_RECORD_TGID) {
>                 if (!tgid_map)
> -                       tgid_map = kcalloc(PID_MAX_DEFAULT + 1,
> +                       tgid_map = kvcalloc(PID_MAX_DEFAULT + 1,
>                                            sizeof(*tgid_map),
>                                            GFP_KERNEL);
>                 if (!tgid_map) {
> --
> 2.20.1
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tracing: use kvcalloc for tgid_map array allocation
  2019-11-01  3:21   ` Chunyan Zhang
@ 2019-11-13 19:40     ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2019-11-13 19:40 UTC (permalink / raw)
  To: Chunyan Zhang
  Cc: Chunyan Zhang, Ingo Molnar, Linux Kernel Mailing List, Yuming Han

On Fri, 1 Nov 2019 11:21:11 +0800
Chunyan Zhang <zhang.lyra@gmail.com> wrote:

> gentle ping

Sorry, was traveling during this time, and my INBOX exploded :-p

> 
> On Thu, 24 Oct 2019 at 11:34, Chunyan Zhang <chunyan.zhang@unisoc.com> wrote:
> >
> >
> > From: Yuming Han <yuming.han@unisoc.com>
> >
> > Fail to allocate memory for tgid_map, because it requires order-6 page.
> > detail as:
> >
> > c3 sh: page allocation failure: order:6,
> >    mode:0x140c0c0(GFP_KERNEL), nodemask=(null)
> > c3 sh cpuset=/ mems_allowed=0
> > c3 CPU: 3 PID: 5632 Comm: sh Tainted: G        W  O    4.14.133+ #10
> > c3 Hardware name: Generic DT based system
> > c3 Backtrace:
> > c3 [<c010bdbc>] (dump_backtrace) from [<c010c08c>](show_stack+0x18/0x1c)
> > c3 [<c010c074>] (show_stack) from [<c0993c54>](dump_stack+0x84/0xa4)
> > c3 [<c0993bd0>] (dump_stack) from [<c0229858>](warn_alloc+0xc4/0x19c)
> > c3 [<c0229798>] (warn_alloc) from [<c022a6e4>](__alloc_pages_nodemask+0xd18/0xf28)
> > c3 [<c02299cc>] (__alloc_pages_nodemask) from [<c0248344>](kmalloc_order+0x20/0x38)
> > c3 [<c0248324>] (kmalloc_order) from [<c0248380>](kmalloc_order_trace+0x24/0x108)
> > c3 [<c024835c>] (kmalloc_order_trace) from [<c01e6078>](set_tracer_flag+0xb0/0x158)
> > c3 [<c01e5fc8>] (set_tracer_flag) from [<c01e6404>](trace_options_core_write+0x7c/0xcc)
> > c3 [<c01e6388>] (trace_options_core_write) from [<c0278b1c>](__vfs_write+0x40/0x14c)
> > c3 [<c0278adc>] (__vfs_write) from [<c0278e10>](vfs_write+0xc4/0x198)
> > c3 [<c0278d4c>] (vfs_write) from [<c027906c>](SyS_write+0x6c/0xd0)
> > c3 [<c0279000>] (SyS_write) from [<c01079a0>](ret_fast_syscall+0x0/0x54)
> >
> > Switch to use kvcalloc to avoid unexpected allocation failures.
> >
> > Signed-off-by: Yuming Han <yuming.han@unisoc.com>

OK, I'll apply this.

-- Steve

> > Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
> > ---
> >  kernel/trace/trace.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index 6a0ee9178365..2fa72419bbd7 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -4609,7 +4609,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled)
> >
> >         if (mask == TRACE_ITER_RECORD_TGID) {
> >                 if (!tgid_map)
> > -                       tgid_map = kcalloc(PID_MAX_DEFAULT + 1,
> > +                       tgid_map = kvcalloc(PID_MAX_DEFAULT + 1,
> >                                            sizeof(*tgid_map),
> >                                            GFP_KERNEL);
> >                 if (!tgid_map) {
> > --
> > 2.20.1
> >
> >  


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-13 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24  2:39 [PATCH] tracing: use kvzalloc for tgid_map array allocation Chunyan Zhang
2019-10-24  3:34 ` [PATCH] tracing: use kvcalloc " Chunyan Zhang
2019-11-01  3:21   ` Chunyan Zhang
2019-11-13 19:40     ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.