linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux@rasmusvillemoes.dk, Peter Zijlstra <peterz@infradead.org>,
	Tejun Heo <tj@kernel.org>,
	Denis Vlasenko <vda.linux@googlemail.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: + lib-vsprintfc-even-faster-decimal-conversion.patch added to -mm tree
Date: Fri, 13 Mar 2015 16:00:06 +0300	[thread overview]
Message-ID: <CACVxJT-K1ZBYw=16+XWWv_06MVKrLgqC5W8QOYGjWKmomKkVBA@mail.gmail.com> (raw)
In-Reply-To: <CACVxJT-vtOVbM9wTFoJe01i2CxxcJYsMdg5kCR4S9tfzxe883Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

On Fri, Mar 13, 2015 at 3:56 PM, Alexey Dobriyan <adobriyan@gmail.com> wrote:
> On Fri, Mar 13, 2015 at 3:49 PM, Alexey Dobriyan <adobriyan@gmail.com> wrote:
>> Legend is "number avg+-1sigma min-max". Every number is CPU cycles.
>> Great care was taken to remove interrupt noise.
>
> To reproduce numbers:
> * apply the patch which adds sys_nr_irq() system call.

attached

[-- Attachment #2: sys-nr-irq-3.19.diff --]
[-- Type: text/plain, Size: 2915 bytes --]

commit 4a79e45e0a03843489de0987eb6be84222201c10
Author: Aliaksei Dabryian <aliaksei_dabryian@epam.com>
Date:   Fri Mar 13 12:56:37 2015 +0300

    sys_nr_irq()

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 547e344..cc4d656 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -35,6 +35,7 @@ struct thread_info {
 	void __user		*sysenter_return;
 	unsigned int		sig_on_uaccess_error:1;
 	unsigned int		uaccess_err:1;	/* uaccess failed */
+	__u64			nr_irq;
 };
 
 #define INIT_THREAD_INFO(tsk)			\
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
index 9f6b934..1b2158d 100644
--- a/arch/x86/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets.c
@@ -32,6 +32,7 @@ void common(void) {
 	OFFSET(TI_flags, thread_info, flags);
 	OFFSET(TI_status, thread_info, status);
 	OFFSET(TI_addr_limit, thread_info, addr_limit);
+	OFFSET(TI_nr_irq, thread_info, nr_irq);
 
 	BLANK();
 	OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 9ebaf63..c4ee124 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -808,6 +808,7 @@ ret_from_intr:
 
 exit_intr:
 	GET_THREAD_INFO(%rcx)
+	addq $1, TI_nr_irq(%rcx)
 	testl $3,CS-ARGOFFSET(%rsp)
 	je retint_kernel
 
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl
index 8d656fb..f61a380 100644
--- a/arch/x86/syscalls/syscall_64.tbl
+++ b/arch/x86/syscalls/syscall_64.tbl
@@ -329,6 +329,7 @@
 320	common	kexec_file_load		sys_kexec_file_load
 321	common	bpf			sys_bpf
 322	64	execveat		stub_execveat
+323	64	nr_irq			sys_nr_irq
 
 #
 # x32-specific system call numbers start at 512 to avoid cache impact
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 85893d7..811b0dc 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -205,6 +205,8 @@ extern struct trace_event_functions exit_syscall_print_funcs;
 	}								\
 	static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__))
 
+asmlinkage long sys_nr_irq(void);
+
 asmlinkage long sys32_quotactl(unsigned int cmd, const char __user *special,
 			       qid_t id, void __user *addr);
 asmlinkage long sys_time(time_t __user *tloc);
diff --git a/kernel/Makefile b/kernel/Makefile
index a59481a..3d3d425 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -27,6 +27,8 @@ obj-y += printk/
 obj-y += irq/
 obj-y += rcu/
 
+obj-y += sys_nr_irq.o
+
 obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o
 obj-$(CONFIG_FREEZER) += freezer.o
 obj-$(CONFIG_PROFILING) += profile.o
diff --git a/kernel/sys_nr_irq.c b/kernel/sys_nr_irq.c
new file mode 100644
index 0000000..b57f482
--- /dev/null
+++ b/kernel/sys_nr_irq.c
@@ -0,0 +1,7 @@
+#include <linux/syscalls.h>
+#include <asm/thread_info.h>
+
+SYSCALL_DEFINE0(nr_irq)
+{
+	return current_thread_info()->nr_irq;
+}

  reply	other threads:[~2015-03-13 13:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5500b987.kerYYCYfIffruy3Z%akpm@linux-foundation.org>
2015-03-13 12:49 ` + lib-vsprintfc-even-faster-decimal-conversion.patch added to -mm tree Alexey Dobriyan
2015-03-13 12:56   ` Alexey Dobriyan
2015-03-13 13:00     ` Alexey Dobriyan [this message]
2015-03-13 23:53   ` Rasmus Villemoes
2015-03-14  9:21     ` Alexey Dobriyan
2015-03-16 15:19       ` Alexey Dobriyan
2015-03-17 22:04         ` Andrew Morton
2015-03-19 12:17           ` Alexey Dobriyan
2015-03-19 22:15             ` Rasmus Villemoes
2015-03-22 17:29             ` Denys Vlasenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACVxJT-K1ZBYw=16+XWWv_06MVKrLgqC5W8QOYGjWKmomKkVBA@mail.gmail.com' \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=peterz@infradead.org \
    --cc=tj@kernel.org \
    --cc=vda.linux@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).