login
Header Space

 
 

Re: [patch 0/2] Immediate Values - jump patching update

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: H. Peter Anvin <hpa@...>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...>, <akpm@...>, <linux-kernel@...>
Date: Monday, April 28, 2008 - 6:11 pm

* H. Peter Anvin <hpa@zytor.com> wrote:


the counter argument was that by specific sched.o analysis, this results 
in slower code. The reason is that the "function call parameter 
preparation" halo around that 5-byte patch site is larger than that 
single conditional branch operation to an offline place of the current 
function is.

i.e. the current optimized marker approach does roughly this:

  [ .... fastpath head ....       ]
  [ immediate value instruction   ]  --->
  [ branch instruction            ]  ---> these two get NOP-ed out
  [ .... fastpath tail ....       ]
  [ ............................. ]
  [ ... offline area ............ ]
  [ ... parameter preparation ... ]
  [ ... marker call ............. ]

your proposed 5-byte call NOP approach (which btw. was what i proposed 
multiple times in the past 2 years) would do this:

  [ .... fastpath head ......     ]
  [ ... parameter preparation ... ]
  [ ....   5-byte CALL .......... ]  ---> NOP-ed out
  [ .... fastpath tail .......... ]
  [ ............................. ]

in the first case we have little "marker parameter/value preparation" 
cost: it all happens in the 'offline area' _by GCC_. I.e. the fastpath 
is relatively undisturbed.

in the latter case, all the 'parameter preparation' phase has to happen 
at around the 5-byte CALL site, in the fastpath. This, in the specific, 
assembly level analysis of sched.o, was shown by Matthieu to be a 
pessimisation. We are better off by inserting that conditional and 
letting gcc generate the call, than by forcing it in the middle of the 
fastpath - even if we end up NOP-ing out the call.

wrt. complexity i agree with you - if the current optimization cannot be 
made correctly we have to fall back to a simpler variant, even if it's 
slower.

	Ingo
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 0/2] Immediate Values - jump patching update, Mathieu Desnoyers, (Sun Apr 27, 11:34 pm)
Re: [patch 0/2] Immediate Values - jump patching update, H. Peter Anvin, (Mon Apr 28, 1:21 pm)
Re: [patch 0/2] Immediate Values - jump patching update, H. Peter Anvin, (Mon Apr 28, 5:03 pm)
Re: [patch 0/2] Immediate Values - jump patching update, Ingo Molnar, (Mon Apr 28, 6:11 pm)
Re: [patch 0/2] Immediate Values - jump patching update, H. Peter Anvin, (Mon Apr 28, 6:25 pm)
Re: [patch 0/2] Immediate Values - jump patching update, H. Peter Anvin, (Mon Apr 28, 7:06 pm)
Re: [patch 0/2] Immediate Values - jump patching update, Mathieu Desnoyers, (Mon Apr 28, 9:46 pm)
Re: [patch 0/2] Immediate Values - jump patching update, H. Peter Anvin, (Mon Apr 28, 10:07 pm)
Re: [patch 0/2] Immediate Values - jump patching update, Mathieu Desnoyers, (Tue Apr 29, 8:18 am)
Re: [patch 0/2] Immediate Values - jump patching update, H. Peter Anvin, (Tue Apr 29, 11:35 am)
Re: [patch 0/2] Immediate Values - jump patching update, Mathieu Desnoyers, (Sun May 4, 10:54 am)
Re: [patch 0/2] Immediate Values - jump patching update, H. Peter Anvin, (Sun May 4, 5:05 pm)
Re: [patch 0/2] Immediate Values - jump patching update, Frank Ch. Eigler, (Mon Apr 28, 8:47 pm)
Re: [patch 0/2] Immediate Values - jump patching update, H. Peter Anvin, (Mon Apr 28, 9:08 pm)
Re: [patch 0/2] Immediate Values - jump patching update, Pavel Machek, (Wed May 14, 10:53 am)
Re: [patch 0/2] Immediate Values - jump patching update, Mathieu Desnoyers, (Mon Apr 28, 10:35 am)
speck-geostationary