lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100130212410.GI5675@nowhere>
Date:	Sat, 30 Jan 2010 22:24:11 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 5/6] tracing: reduce latency and remove percpu trace_seq

On Tue, Jan 26, 2010 at 11:07:05AM +0800, Lai Jiangshan wrote:
> Frederic Weisbecker wrote:
> > On Tue, Jan 19, 2010 at 03:34:22PM +0800, Lai Jiangshan wrote:
> >> __print_flags() and __print_symbolic() use percpu trace_seq:
> >>
> >> 1) Its memory is preallocated, it wastes memory when we don't use tracing.
> >> 2) It wastes memory for multi-cpus system.
> >> 3) It disables preemption when it executes its core routine
> >>    "trace_seq_printf(s, "%s: ", #call);" and introduce latency
> >>    for more important process.
> >>
> >> So we move this trace_seq to struct trace_iterator.
> >>
> >> Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
> >> ---
> >> diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
> >> index be9ece5..348500d 100644
> >> --- a/include/linux/ftrace_event.h
> >> +++ b/include/linux/ftrace_event.h
> >> @@ -12,9 +12,6 @@ struct dentry;
> >>  
> >>  #define FTRACE_SEQ_BUFSIZE PAGE_SIZE
> >>  
> >> -DECLARE_PER_CPU(struct trace_seq, ftrace_event_seq);
> >> -DECLARE_PER_CPU(unsigned char[FTRACE_SEQ_BUFSIZE], ftrace_event_buffer);
> >> -
> >>  struct trace_print_flags {
> >>  	unsigned long		mask;
> >>  	const char		*name;
> >> @@ -60,6 +57,10 @@ struct trace_iterator {
> >>  	struct trace_seq	seq;
> >>  	unsigned char		buffer[FTRACE_SEQ_BUFSIZE];
> >>  
> >> +	/* trace_seq for __print_flags() and __print_symbolic() */
> >> +	struct trace_seq	tmp_seq;
> >> +	unsigned char 		tmp_buffer[FTRACE_SEQ_BUFSIZE];
> > 
> > 
> > 
> > 
> > Well, I don't like much that because it's a temporary buffer
> > in trace iter only used by few events.
> > But the problem is indeed tricky.
> > 
> > May be should we use a kmalloc in raw_output?
> > 
> 
> But we have to preallocate it before raw_output().
> a kmalloc in raw_output make ftrace_dump() unhappy.


Ah, right.


> 
> At real system, tracepoints are used more frequently,
> So it is not "only used by few events."


No I mean, print_flags and print_symbolic are used by few
events.


> But maybe FTRACE_SEQ_BUFSIZE is too large, 128 is enough.


May be. Anyway, we should perhaps indeed make this change.

Steve?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ