Linux-arch Archive on lore.kernel.org
 help / color / Atom feed
* [RFC][ATCH 0/3] sycalls: Remove args i and n from syscall_get_arguments()
@ 2016-11-07 21:26 Steven Rostedt
  2016-11-07 21:26 ` [RFC][ATCH 1/3] ptrace: Remove maxargs from task_current_syscall() Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Steven Rostedt @ 2016-11-07 21:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Torvalds, Ingo Molnar, Andrew Morton, Andy Lutomirski,
	Roland McGrath, Oleg Nesterov, linux-arch, Peter Zijlstra

At Linux Plumbers, Andy Lutomirski approached me to tell me that the
syscall_get_arguments() implementation in x86 was horrible and gcc
certainly gets it wrong. He said that since the tracepoints only pass
in 0 and 6 for i and n repectively, it should be optimized for that case.
Inspecting the kernel, I discovered that all users pass in 0 for i and
only one file passing in something other than 6 for the number of arguments.
That code happens to be my own code used for the special syscall tracing.
That can easily be converted to just using 0 and 6 as well, and only copying
what is needed. Which is probably the faster path anyway for that case.

I haven't run the numbers (I can do that when I get some time), but since
pretty much all use cases use 0 and 6 and that would allow these functions
not to need strange logic to handle odd cases, I think this is still a win.

I haven't looked at removing those same parameters from syscall_set_arguments()
yet.

Thoughts?

-- Steve


Steven Rostedt (3):
      ptrace: Remove maxargs from task_current_syscall()
      tracing/syscalls: Pass in hardcoded '6' into syscall_get_arguments()
      syscalls: Remove start and number from syscall_get_arguments() args

----
 arch/arc/include/asm/syscall.h        |  7 ++--
 arch/arm/include/asm/syscall.h        | 23 ++---------
 arch/arm64/include/asm/syscall.h      | 22 ++---------
 arch/blackfin/include/asm/syscall.h   | 22 +++++++----
 arch/c6x/include/asm/syscall.h        | 41 ++++----------------
 arch/frv/include/asm/syscall.h        | 26 +++----------
 arch/h8300/include/asm/syscall.h      | 34 ++++-------------
 arch/hexagon/include/asm/syscall.h    |  4 +-
 arch/ia64/include/asm/syscall.h       |  5 +--
 arch/metag/include/asm/syscall.h      |  4 +-
 arch/microblaze/include/asm/syscall.h |  4 +-
 arch/mips/include/asm/syscall.h       |  3 +-
 arch/mn10300/include/asm/syscall.h    | 32 +++-------------
 arch/nios2/include/asm/syscall.h      | 42 ++++----------------
 arch/openrisc/include/asm/syscall.h   |  6 +--
 arch/parisc/include/asm/syscall.h     | 30 ++++-----------
 arch/powerpc/include/asm/syscall.h    |  8 ++--
 arch/s390/include/asm/syscall.h       | 11 +++---
 arch/sh/include/asm/syscall_32.h      | 26 +++----------
 arch/sh/include/asm/syscall_64.h      |  4 +-
 arch/sparc/include/asm/syscall.h      |  4 +-
 arch/tile/include/asm/syscall.h       |  4 +-
 arch/um/include/asm/syscall-generic.h | 39 +++----------------
 arch/x86/include/asm/syscall.h        | 72 ++++++++---------------------------
 fs/proc/base.c                        |  2 +-
 include/asm-generic/syscall.h         | 11 ++----
 include/linux/ptrace.h                |  4 +-
 include/trace/events/syscalls.h       |  2 +-
 kernel/seccomp.c                      |  2 +-
 kernel/trace/trace_syscalls.c         | 10 +++--
 lib/syscall.c                         | 22 ++++-------
 31 files changed, 139 insertions(+), 387 deletions(-)

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

end of thread, back to index

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07 21:26 [RFC][ATCH 0/3] sycalls: Remove args i and n from syscall_get_arguments() Steven Rostedt
2016-11-07 21:26 ` [RFC][ATCH 1/3] ptrace: Remove maxargs from task_current_syscall() Steven Rostedt
2016-11-07 21:26   ` Steven Rostedt
2016-11-07 23:51   ` Andy Lutomirski
2016-11-07 23:51     ` Andy Lutomirski
2016-11-08 16:16   ` Linus Torvalds
2016-11-08 16:20     ` Andy Lutomirski
2016-11-08 19:48       ` Steven Rostedt
2016-11-08 21:06         ` Andy Lutomirski
2016-11-08 21:13           ` Steven Rostedt
2016-11-07 21:26 ` [RFC][ATCH 2/3] tracing/syscalls: Pass in hardcoded 6 into syscall_get_arguments() Steven Rostedt
2016-11-07 21:26   ` Steven Rostedt
2016-11-07 21:26 ` [RFC][ATCH 3/3] syscalls: Remove start and number from syscall_get_arguments() args Steven Rostedt
2016-11-07 21:26   ` Steven Rostedt
2016-11-07 23:54   ` Andy Lutomirski
2016-11-08 19:21     ` Steven Rostedt
2016-11-08 19:21       ` Steven Rostedt

Linux-arch Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arch/0 linux-arch/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arch linux-arch/ https://lore.kernel.org/linux-arch \
		linux-arch@vger.kernel.org
	public-inbox-index linux-arch

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arch


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git