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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191022174551.2fcc85fd@gandalf.local.home>
Date:   Tue, 22 Oct 2019 17:45:51 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Hassan Naveed <hnaveed@...ecomp.com>
Cc:     Ingo Molnar <mingo@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Paul Burton <pburton@...ecomp.com>
Subject: Re: [PATCH] TRACING: FTRACE: Use xarray structure for ftrace
 syscalls

On Tue, 22 Oct 2019 15:51:04 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:

> >  static struct syscall_metadata *syscall_nr_to_meta(int nr)
> >  {
> > -	if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
> > -		return NULL;
> > -
> > -	return syscalls_metadata[nr];
> > +	return xa_load(&syscalls_metadata, (unsigned long)nr);
> >  }
> >  

There appears to be a slight overhead to this for archs that do not
have a sparse syscall array. I wonder if we should make this only
applicable for archs (via adding a HAVE_SPARSE_SYSCALL_NR define and
checking against it). Then if an arch doesn't have a sparse array of
system calls, it uses a normal lookup, but for archs that do, it can
define this for this type of lookup.

There's not much to this patch, so it wouldn't be too difficult to
support both methods.

Without this patch I ran:

# trace-cmd start -e syscalls
# /work/c/hackbench 50
Time: 15.702
# /work/c/hackbench 50
Time: 15.932
# /work/c/hackbench 50
Time: 15.893
# /work/c/hackbench 50
Time: 16.038
# /work/c/hackbench 50
Time: 15.429


With the patch it had:

# trace-cmd start -e syscalls
# /work/c/hackbench 50
Time: 16.582
# /work/c/hackbench 50
Time: 15.972
# /work/c/hackbench 50
Time: 16.078
# /work/c/hackbench 50
Time: 16.133
# /work/c/hackbench 50
Time: 16.263

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ