All of lore.kernel.org
 help / color / mirror / Atom feed
* module allocation
@ 2006-04-28 13:04 moreau francis
  2006-04-28 20:03 ` Ralf Baechle
  0 siblings, 1 reply; 6+ messages in thread
From: moreau francis @ 2006-04-28 13:04 UTC (permalink / raw)
  To: linux-mips

Hi

Maybe a silly question...why do we use mapped memory (allocated by
vmalloc) for inserting a module into the kernel ?

I can see only drawbacks:

  - It consumes TLB entries,

  - When accessing to the module's code, we use TLB entries which can
    be bad for interrupt latencies. For instance: if the module has an
    interrupt handler and the module's code in still not mapped in the
    TLB, we got a page fault...

  - Modules are usually loaded at startup, at this time the memory
    should not be fragmented.

Thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re : module allocation
@ 2006-04-29  9:41 moreau francis
  2006-04-29 20:39 ` Ralf Baechle
  0 siblings, 1 reply; 6+ messages in thread
From: moreau francis @ 2006-04-29  9:41 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips

On Fri, Apr 28, 2006 at 01:04:17PM +0000, moreau francis wrote:

> Maybe a silly question...why do we use mapped memory (allocated by
> vmalloc) for inserting a module into the kernel ?
> 

Ok, to sum up things:

Pros:
  - allocation granularity is a page size  where as GFP allocations is a power
    of two...
  - better chance for the module to get loaded into fragmented memory.

Cons:
  - it consumes TLB entries, (usually one ?)
  - it needs to generate the module with "-mlong-calls" switch which generates
    larger and less efficient code.
  - there will be a refill exception overhead each time the module code will be
    executed and it's not mapped through TLB.

maybe that would make sense to do some benchmarks ?

Thanks

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

end of thread, other threads:[~2006-05-02  9:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-28 13:04 module allocation moreau francis
2006-04-28 20:03 ` Ralf Baechle
2006-05-02  7:19   ` Re : " moreau francis
2006-05-02  9:36     ` Ralf Baechle
  -- strict thread matches above, loose matches on Subject: below --
2006-04-29  9:41 moreau francis
2006-04-29 20:39 ` Ralf Baechle

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.