Re: [patch 7/8] Immediate Values - Documentation

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mathieu Desnoyers <mathieu.desnoyers@...>
Cc: <akpm@...>, <linux-kernel@...>
Date: Friday, September 21, 2007 - 11:51 am

On Friday 21 September 2007 14:31, Mathieu Desnoyers wrote:

For 32-bit value, you won't be so lucky.


I agree on this wholeheartedy. However, current kernel mostly uses int
even for yes/no style flags.


Exactly my point: this speedup is not measurable on realistic workload.


Yes. *Per immediate value reference*.

Therefore I don't think it's wise to recommend to use __immediate
for any variables which are referenced many times. "Many" defined as
"more than ten".

IOW: I think that this last paragraph shouldn't be there:

On Tuesday 18 September 2007 22:07, Mathieu Desnoyers wrote:


A few crazy ideas how you can make it slightly less painful for 64-bit arch:

* Pack last long ('size') into low bits of other fields.
  (I expect link stage problems, tho)


* Make last field uint8_t and pack whole struct into 17 bytes (__attribute__((packed)))
  instead of 24 bytes.
  Expect align-happy folks faint left and right at such horrendous crime :) but
  other than that, it will work. Updates of immediates will *maybe* get a tiny bit slower
  (which is unimportant anyway).

  [btw, this can be done for i386 too]


* Turn long's into int32_t, since kernel's text addresses (at least on AMD64)
  fit into int32_t (sign-extend will give you correct 64-bit address):

  ffffffff80200000 A _text
  ffffffff80200000 T startup_64
  ffffffff802000b7 t ident_complete
  ffffffff80200110 T secondary_startup_64
  ffffffff802001a8 T initial_code
  ffffffff802001b0 T init_rsp
  ffffffff802001b8 t bad_address
  ffffffff802001c0 T early_idt_handler

  [I hope there is suitable reloc type for AMD64 and ld won't complain]
--
vda
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 7/8] Immediate Values - Documentation, Mathieu Desnoyers, (Mon Aug 27, 11:59 am)
Re: [patch 7/8] Immediate Values - Documentation, Denys Vlasenko, (Thu Sep 20, 6:46 am)
Re: [patch 7/8] Immediate Values - Documentation, Mathieu Desnoyers, (Fri Sep 21, 9:31 am)
Re: [patch 7/8] Immediate Values - Documentation, Denys Vlasenko, (Fri Sep 21, 11:51 am)