All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/apic: Deinline __x2apic_disable, save 467 bytes
@ 2015-09-28 12:23 Denys Vlasenko
  2015-09-28 12:23 ` [PATCH] x86: Deinline e820_type_to_string, save 126 bytes Denys Vlasenko
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Denys Vlasenko @ 2015-09-28 12:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Denys Vlasenko, Andy Lutomirski, H. Peter Anvin, Borislav Petkov,
	Brian Gerst, x86, linux-kernel

This function compiles to 186 bytes of machine code.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Ingo Molnar <mingo@kernel.org>
CC: Andy Lutomirski <luto@amacapital.net>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Borislav Petkov <bp@alien8.de>
CC: Brian Gerst <brgerst@gmail.com>
CC: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/x86/kernel/apic/apic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index f49a956..78c0160 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1431,7 +1431,7 @@ enum {
 };
 static int x2apic_state;
 
-static inline void __x2apic_disable(void)
+static void __x2apic_disable(void)
 {
 	u64 msr;
 
-- 
1.8.1.4


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

* [PATCH] x86: Deinline e820_type_to_string, save 126 bytes
  2015-09-28 12:23 [PATCH] x86/apic: Deinline __x2apic_disable, save 467 bytes Denys Vlasenko
@ 2015-09-28 12:23 ` Denys Vlasenko
  2015-09-30 19:57   ` [tip:x86/cleanups] x86/e820: " tip-bot for Denys Vlasenko
  2015-09-28 12:23 ` [PATCH] x86: Deinline early_console_register, save 403 bytes Denys Vlasenko
  2015-09-28 12:23 ` [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes Denys Vlasenko
  2 siblings, 1 reply; 11+ messages in thread
From: Denys Vlasenko @ 2015-09-28 12:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Denys Vlasenko, Andy Lutomirski, H. Peter Anvin, Borislav Petkov,
	Brian Gerst, x86, linux-kernel

This function compiles to 102 bytes of machine code. It has two callsites.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Ingo Molnar <mingo@kernel.org>
CC: Andy Lutomirski <luto@amacapital.net>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Borislav Petkov <bp@alien8.de>
CC: Brian Gerst <brgerst@gmail.com>
CC: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/x86/kernel/e820.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index a102564..9e55f6f 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -911,7 +911,7 @@ void __init finish_e820_parsing(void)
 	}
 }
 
-static inline const char *e820_type_to_string(int e820_type)
+static const char *e820_type_to_string(int e820_type)
 {
 	switch (e820_type) {
 	case E820_RESERVED_KERN:
-- 
1.8.1.4


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

* [PATCH] x86: Deinline early_console_register, save 403 bytes
  2015-09-28 12:23 [PATCH] x86/apic: Deinline __x2apic_disable, save 467 bytes Denys Vlasenko
  2015-09-28 12:23 ` [PATCH] x86: Deinline e820_type_to_string, save 126 bytes Denys Vlasenko
@ 2015-09-28 12:23 ` Denys Vlasenko
  2015-09-30 19:57   ` [tip:x86/cleanups] " tip-bot for Denys Vlasenko
  2015-09-28 12:23 ` [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes Denys Vlasenko
  2 siblings, 1 reply; 11+ messages in thread
From: Denys Vlasenko @ 2015-09-28 12:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Denys Vlasenko, Andy Lutomirski, H. Peter Anvin, Borislav Petkov,
	Brian Gerst, x86, linux-kernel

This function compiles to 60 bytes of machine code.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Ingo Molnar <mingo@kernel.org>
CC: Andy Lutomirski <luto@amacapital.net>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Borislav Petkov <bp@alien8.de>
CC: Brian Gerst <brgerst@gmail.com>
CC: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/x86/kernel/early_printk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index eec40f5..d968ee5 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -316,7 +316,7 @@ static struct console early_serial_console = {
 	.index =	-1,
 };
 
-static inline void early_console_register(struct console *con, int keep_early)
+static void early_console_register(struct console *con, int keep_early)
 {
 	if (con->index != -1) {
 		printk(KERN_CRIT "ERROR: earlyprintk= %s already used\n",
-- 
1.8.1.4


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

* [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes
  2015-09-28 12:23 [PATCH] x86/apic: Deinline __x2apic_disable, save 467 bytes Denys Vlasenko
  2015-09-28 12:23 ` [PATCH] x86: Deinline e820_type_to_string, save 126 bytes Denys Vlasenko
  2015-09-28 12:23 ` [PATCH] x86: Deinline early_console_register, save 403 bytes Denys Vlasenko
@ 2015-09-28 12:23 ` Denys Vlasenko
  2015-09-28 12:33   ` H. Peter Anvin
  2015-09-30 19:58   ` [tip:x86/cleanups] " tip-bot for Denys Vlasenko
  2 siblings, 2 replies; 11+ messages in thread
From: Denys Vlasenko @ 2015-09-28 12:23 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Denys Vlasenko, Andy Lutomirski, H. Peter Anvin, Borislav Petkov,
	Brian Gerst, x86, linux-kernel

This function compiles to 277 bytes of machine code and has 4 callsites.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Ingo Molnar <mingo@kernel.org>
CC: Andy Lutomirski <luto@amacapital.net>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Borislav Petkov <bp@alien8.de>
CC: Brian Gerst <brgerst@gmail.com>
CC: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/x86/kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index da52e6b..054a4d0 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -196,7 +196,7 @@ static unsigned long align_sigframe(unsigned long sp)
 	return sp;
 }
 
-static inline void __user *
+static void __user *
 get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
 	     void __user **fpstate)
 {
-- 
1.8.1.4


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

* Re: [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes
  2015-09-28 12:23 ` [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes Denys Vlasenko
@ 2015-09-28 12:33   ` H. Peter Anvin
  2015-09-28 13:43     ` Denys Vlasenko
  2015-09-30 19:58   ` [tip:x86/cleanups] " tip-bot for Denys Vlasenko
  1 sibling, 1 reply; 11+ messages in thread
From: H. Peter Anvin @ 2015-09-28 12:33 UTC (permalink / raw)
  To: Denys Vlasenko, Ingo Molnar
  Cc: Andy Lutomirski, Borislav Petkov, Brian Gerst, x86, linux-kernel

This one makes me slightly nervous, because it isn't clear that these aren't potentially performance sensitive.

On September 28, 2015 5:23:57 AM PDT, Denys Vlasenko <dvlasenk@redhat.com> wrote:
>This function compiles to 277 bytes of machine code and has 4
>callsites.
>
>Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
>CC: Ingo Molnar <mingo@kernel.org>
>CC: Andy Lutomirski <luto@amacapital.net>
>CC: "H. Peter Anvin" <hpa@zytor.com>
>CC: Borislav Petkov <bp@alien8.de>
>CC: Brian Gerst <brgerst@gmail.com>
>CC: x86@kernel.org
>CC: linux-kernel@vger.kernel.org
>---
> arch/x86/kernel/signal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
>index da52e6b..054a4d0 100644
>--- a/arch/x86/kernel/signal.c
>+++ b/arch/x86/kernel/signal.c
>@@ -196,7 +196,7 @@ static unsigned long align_sigframe(unsigned long
>sp)
> 	return sp;
> }
> 
>-static inline void __user *
>+static void __user *
>get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t
>frame_size,
> 	     void __user **fpstate)
> {

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

* Re: [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes
  2015-09-28 12:33   ` H. Peter Anvin
@ 2015-09-28 13:43     ` Denys Vlasenko
  2015-09-28 20:24       ` Davidlohr Bueso
  0 siblings, 1 reply; 11+ messages in thread
From: Denys Vlasenko @ 2015-09-28 13:43 UTC (permalink / raw)
  To: H. Peter Anvin, Ingo Molnar
  Cc: Andy Lutomirski, Borislav Petkov, Brian Gerst, x86, linux-kernel

On 09/28/2015 02:33 PM, H. Peter Anvin wrote:
> This one makes me slightly nervous, because it isn't clear
> that these aren't potentially performance sensitive.

CALL instruction is not a crime :)
It costs about the same as one read-modify-write
operation on a memory operand.

This function is used in signal delivery code.
If performance critical code uses massive numbers
of signals, it already has a problem, Unix signals
are too inefficient. That's why we have futexes etc...

> On September 28, 2015 5:23:57 AM PDT, Denys Vlasenko <dvlasenk@redhat.com> wrote:
>> This function compiles to 277 bytes of machine code and has 4
>> callsites.

I must correct myself: there are two callsites, not four.
(There are four calls in the source, but two of them are
in 32-bit code and two are in 64-bit).



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

* Re: [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes
  2015-09-28 13:43     ` Denys Vlasenko
@ 2015-09-28 20:24       ` Davidlohr Bueso
  2015-09-29 18:54         ` Thomas Gleixner
  0 siblings, 1 reply; 11+ messages in thread
From: Davidlohr Bueso @ 2015-09-28 20:24 UTC (permalink / raw)
  To: Denys Vlasenko
  Cc: H. Peter Anvin, Ingo Molnar, Andy Lutomirski, Borislav Petkov,
	Brian Gerst, x86, linux-kernel

On Mon, 28 Sep 2015, Denys Vlasenko wrote:

>On 09/28/2015 02:33 PM, H. Peter Anvin wrote:
>> This one makes me slightly nervous, because it isn't clear
>> that these aren't potentially performance sensitive.
>
>CALL instruction is not a crime :)
>It costs about the same as one read-modify-write
>operation on a memory operand.
>
>This function is used in signal delivery code.
>If performance critical code uses massive numbers
>of signals, it already has a problem, Unix signals
>are too inefficient. That's why we have futexes etc...

True, but in general I don't think that justifies anything -- and not only
referring to this particular signal patch.

Nothing really against or in favor of these patches, but I don't think that
saving 240 bytes (or whatever) is worth such changes, in fact we have Josh's
tinyfication project for those systems that do in fact care.

Thanks,
Davidlohr

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

* Re: [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes
  2015-09-28 20:24       ` Davidlohr Bueso
@ 2015-09-29 18:54         ` Thomas Gleixner
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Gleixner @ 2015-09-29 18:54 UTC (permalink / raw)
  To: Davidlohr Bueso
  Cc: Denys Vlasenko, H. Peter Anvin, Ingo Molnar, Andy Lutomirski,
	Borislav Petkov, Brian Gerst, x86, linux-kernel

On Mon, 28 Sep 2015, Davidlohr Bueso wrote:
> Nothing really against or in favor of these patches, but I don't think that
> saving 240 bytes (or whatever) is worth such changes, in fact we have Josh's
> tinyfication project for those systems that do in fact care.

And what exactly is wrong with slimming down the mainline kernel? We
have tons of inlines which are way too fat and an extra unconditional
function call is not going to show up as a performance degradation by
any means.

Thanks,

	tglx



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

* [tip:x86/cleanups] x86/e820: Deinline e820_type_to_string, save 126 bytes
  2015-09-28 12:23 ` [PATCH] x86: Deinline e820_type_to_string, save 126 bytes Denys Vlasenko
@ 2015-09-30 19:57   ` tip-bot for Denys Vlasenko
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for Denys Vlasenko @ 2015-09-30 19:57 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: brgerst, hpa, mingo, bp, luto, dvlasenk, linux-kernel, tglx

Commit-ID:  e6e5f84092b1f3a8733c20e26838af4e21a4854f
Gitweb:     http://git.kernel.org/tip/e6e5f84092b1f3a8733c20e26838af4e21a4854f
Author:     Denys Vlasenko <dvlasenk@redhat.com>
AuthorDate: Mon, 28 Sep 2015 14:23:55 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 30 Sep 2015 21:54:40 +0200

x86/e820: Deinline e820_type_to_string, save 126 bytes

This function compiles to 102 bytes of machine code. It has two
callsites.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Link: http://lkml.kernel.org/r/1443443037-22077-2-git-send-email-dvlasenk@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/e820.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index a102564..569c1e4 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -911,7 +911,7 @@ void __init finish_e820_parsing(void)
 	}
 }
 
-static inline const char *e820_type_to_string(int e820_type)
+static const char *e820_type_to_string(int e820_type)
 {
 	switch (e820_type) {
 	case E820_RESERVED_KERN:

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

* [tip:x86/cleanups] x86: Deinline early_console_register, save 403 bytes
  2015-09-28 12:23 ` [PATCH] x86: Deinline early_console_register, save 403 bytes Denys Vlasenko
@ 2015-09-30 19:57   ` tip-bot for Denys Vlasenko
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot for Denys Vlasenko @ 2015-09-30 19:57 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: brgerst, dvlasenk, tglx, mingo, luto, hpa, bp, linux-kernel

Commit-ID:  c368ef2866adbfc0e90fdecc09e3b3fe2cddcd14
Gitweb:     http://git.kernel.org/tip/c368ef2866adbfc0e90fdecc09e3b3fe2cddcd14
Author:     Denys Vlasenko <dvlasenk@redhat.com>
AuthorDate: Mon, 28 Sep 2015 14:23:56 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 30 Sep 2015 21:54:40 +0200

x86: Deinline early_console_register, save 403 bytes

This function compiles to 60 bytes of machine code.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Link: http://lkml.kernel.org/r/1443443037-22077-3-git-send-email-dvlasenk@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/early_printk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index eec40f5..076a4a7 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -316,7 +316,7 @@ static struct console early_serial_console = {
 	.index =	-1,
 };
 
-static inline void early_console_register(struct console *con, int keep_early)
+static void early_console_register(struct console *con, int keep_early)
 {
 	if (con->index != -1) {
 		printk(KERN_CRIT "ERROR: earlyprintk= %s already used\n",

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

* [tip:x86/cleanups] x86/signal: Deinline get_sigframe, save 240 bytes
  2015-09-28 12:23 ` [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes Denys Vlasenko
  2015-09-28 12:33   ` H. Peter Anvin
@ 2015-09-30 19:58   ` tip-bot for Denys Vlasenko
  1 sibling, 0 replies; 11+ messages in thread
From: tip-bot for Denys Vlasenko @ 2015-09-30 19:58 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: brgerst, bp, mingo, dvlasenk, luto, hpa, tglx, linux-kernel

Commit-ID:  dae0f305d61b07933a129dfe975342f3177277d5
Gitweb:     http://git.kernel.org/tip/dae0f305d61b07933a129dfe975342f3177277d5
Author:     Denys Vlasenko <dvlasenk@redhat.com>
AuthorDate: Mon, 28 Sep 2015 14:23:57 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 30 Sep 2015 21:54:40 +0200

x86/signal: Deinline get_sigframe, save 240 bytes

This function compiles to 277 bytes of machine code and has 4 callsites.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Link: http://lkml.kernel.org/r/1443443037-22077-4-git-send-email-dvlasenk@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index da52e6b..2c3336b 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -196,7 +196,7 @@ static unsigned long align_sigframe(unsigned long sp)
 	return sp;
 }
 
-static inline void __user *
+static void __user *
 get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
 	     void __user **fpstate)
 {

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

end of thread, other threads:[~2015-09-30 19:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-28 12:23 [PATCH] x86/apic: Deinline __x2apic_disable, save 467 bytes Denys Vlasenko
2015-09-28 12:23 ` [PATCH] x86: Deinline e820_type_to_string, save 126 bytes Denys Vlasenko
2015-09-30 19:57   ` [tip:x86/cleanups] x86/e820: " tip-bot for Denys Vlasenko
2015-09-28 12:23 ` [PATCH] x86: Deinline early_console_register, save 403 bytes Denys Vlasenko
2015-09-30 19:57   ` [tip:x86/cleanups] " tip-bot for Denys Vlasenko
2015-09-28 12:23 ` [PATCH] x86/signal: Deinline get_sigframe, save 240 bytes Denys Vlasenko
2015-09-28 12:33   ` H. Peter Anvin
2015-09-28 13:43     ` Denys Vlasenko
2015-09-28 20:24       ` Davidlohr Bueso
2015-09-29 18:54         ` Thomas Gleixner
2015-09-30 19:58   ` [tip:x86/cleanups] " tip-bot for Denys Vlasenko

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.