Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-09 Thread Andy Lutomirski
On 08/07/2013 02:56 PM, Linus Torvalds wrote: > > Both of the biased cases *might* also want things like "save register > state in the unlikely path so that the *likely* path doesn't have to". > Think things like "it's a leaf function, and the likely path doesn't > need any temporaries, but the

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-09 Thread Andy Lutomirski
On 08/07/2013 02:56 PM, Linus Torvalds wrote: Both of the biased cases *might* also want things like save register state in the unlikely path so that the *likely* path doesn't have to. Think things like it's a leaf function, and the likely path doesn't need any temporaries, but the unlikely

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Linus Torvalds
On Wed, Aug 7, 2013 at 2:37 PM, Jason Baron wrote: > > ok - I can see 2 variants here as you mentioned: > > 1) 'Unbiased' - we want to treat both branches equally but don't want > the load/test/jmp sequence. For things like the scheduler stats. > > 2) 'Biased' - where the unlikely path is moved

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Jason Baron
On 08/07/2013 04:47 PM, Linus Torvalds wrote: > On Wed, Aug 7, 2013 at 1:19 PM, Jason Baron wrote: >> The whole point of the thread started with wanting to move the default >> 'disabled' branch further out-of-line. > Yeah, but I always disagreed with that. > > Putting the unusual code out-of-line

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Linus Torvalds
On Wed, Aug 7, 2013 at 1:19 PM, Jason Baron wrote: > > The whole point of the thread started with wanting to move the default > 'disabled' branch further out-of-line. Yeah, but I always disagreed with that. Putting the unusual code out-of-line (as in "at the end of the function") is a good

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Steven Rostedt
On Wed, 2013-08-07 at 16:19 -0400, Jason Baron wrote: > The whole point of the thread started with wanting to move the default > 'disabled' branch further out-of-line. We could get there with better > compiler support for the 'cold' label attribute. Thus, in theory the > whole 2-byte jmp is just

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Steven Rostedt
On Wed, 2013-08-07 at 12:49 -0700, Linus Torvalds wrote: > On Wed, Aug 7, 2013 at 12:27 PM, H. Peter Anvin wrote: > > Well we do... both to extract relocations and to sort the exception table. > > Perhaps we need to merge those kinds of postprocessing tools? > > If we can do this generically

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Jason Baron
On 08/07/2013 03:22 PM, Linus Torvalds wrote: > On Wed, Aug 7, 2013 at 10:54 AM, Steven Rostedt wrote: >> On another box, using a distro config, I had even better results: >> >> [2.352448] short jumps: 193 >> [2.355407] long jumps: 219 > .. well, another way of looking at this is to say

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Linus Torvalds
On Wed, Aug 7, 2013 at 12:27 PM, H. Peter Anvin wrote: > Well we do... both to extract relocations and to sort the exception table. > Perhaps we need to merge those kinds of postprocessing tools? If we can do this generically and without adding 500 lines of specialized code, my argument

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread H. Peter Anvin
Well we do... both to extract relocations and to sort the exception table. Perhaps we need to merge those kinds of postprocessing tools? Linus Torvalds wrote: >On Wed, Aug 7, 2013 at 10:54 AM, Steven Rostedt >wrote: >> >> On another box, using a distro config, I had even better results: >> >>

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Linus Torvalds
On Wed, Aug 7, 2013 at 10:54 AM, Steven Rostedt wrote: > > On another box, using a distro config, I had even better results: > > [2.352448] short jumps: 193 > [2.355407] long jumps: 219 .. well, another way of looking at this is to say that all of this effort saves just 579 bytes. Yes,

[RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Steven Rostedt
On Wed, 2013-08-07 at 13:36 -0400, Steven Rostedt wrote: > As I said, I would post the patches that let the jmps used by jump labels > be turn to 2 bytes where possible. These are a bit controversial due > to the complexity of the update_jump_label code. > > These patches are based off of tip's

[RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Steven Rostedt
On Wed, 2013-08-07 at 13:36 -0400, Steven Rostedt wrote: As I said, I would post the patches that let the jmps used by jump labels be turn to 2 bytes where possible. These are a bit controversial due to the complexity of the update_jump_label code. These patches are based off of tip's

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Linus Torvalds
On Wed, Aug 7, 2013 at 10:54 AM, Steven Rostedt rost...@goodmis.org wrote: On another box, using a distro config, I had even better results: [2.352448] short jumps: 193 [2.355407] long jumps: 219 .. well, another way of looking at this is to say that all of this effort saves just

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread H. Peter Anvin
Well we do... both to extract relocations and to sort the exception table. Perhaps we need to merge those kinds of postprocessing tools? Linus Torvalds torva...@linux-foundation.org wrote: On Wed, Aug 7, 2013 at 10:54 AM, Steven Rostedt rost...@goodmis.org wrote: On another box, using a

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Linus Torvalds
On Wed, Aug 7, 2013 at 12:27 PM, H. Peter Anvin h...@zytor.com wrote: Well we do... both to extract relocations and to sort the exception table. Perhaps we need to merge those kinds of postprocessing tools? If we can do this generically and without adding 500 lines of specialized code, my

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Jason Baron
On 08/07/2013 03:22 PM, Linus Torvalds wrote: On Wed, Aug 7, 2013 at 10:54 AM, Steven Rostedt rost...@goodmis.org wrote: On another box, using a distro config, I had even better results: [2.352448] short jumps: 193 [2.355407] long jumps: 219 .. well, another way of looking at this

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Steven Rostedt
On Wed, 2013-08-07 at 12:49 -0700, Linus Torvalds wrote: On Wed, Aug 7, 2013 at 12:27 PM, H. Peter Anvin h...@zytor.com wrote: Well we do... both to extract relocations and to sort the exception table. Perhaps we need to merge those kinds of postprocessing tools? If we can do this

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Steven Rostedt
On Wed, 2013-08-07 at 16:19 -0400, Jason Baron wrote: The whole point of the thread started with wanting to move the default 'disabled' branch further out-of-line. We could get there with better compiler support for the 'cold' label attribute. Thus, in theory the whole 2-byte jmp is just an

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Linus Torvalds
On Wed, Aug 7, 2013 at 1:19 PM, Jason Baron jba...@akamai.com wrote: The whole point of the thread started with wanting to move the default 'disabled' branch further out-of-line. Yeah, but I always disagreed with that. Putting the unusual code out-of-line (as in at the end of the function) is

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Jason Baron
On 08/07/2013 04:47 PM, Linus Torvalds wrote: On Wed, Aug 7, 2013 at 1:19 PM, Jason Baron jba...@akamai.com wrote: The whole point of the thread started with wanting to move the default 'disabled' branch further out-of-line. Yeah, but I always disagreed with that. Putting the unusual code

Re: [RFC][PATCH 3/2] x86/jump labels: Count and display the short jumps used

2013-08-07 Thread Linus Torvalds
On Wed, Aug 7, 2013 at 2:37 PM, Jason Baron jba...@akamai.com wrote: ok - I can see 2 variants here as you mentioned: 1) 'Unbiased' - we want to treat both branches equally but don't want the load/test/jmp sequence. For things like the scheduler stats. 2) 'Biased' - where the unlikely path