Re: [PATCH v5] RO/NX protection for loadable kernel modules

From: Roland Dreier
Date: Mon Jul 13 2009 - 12:59:14 EST



> > (I like the idea of trying kmalloc and falling back, simply because it reduces
> > TLB pressure,
>
> I implemented this for 32bit in 2.4, but I always had second thoughts
> if that was really reducing TLB pressure.

Certainly for non-x86 it can be very worthwhile. A long time ago I
worked on an embedded product that used PowerPC 440, which has only 64
(software-loaded) TLB entries. On PPC 440, Linux has a pinned TLB entry
for the kernel mapping, and modifying how the module loader allocated
space to load modules into that mapping vs. one that had dynamic TLB
entries was worth a factor of 2 in performance -- ie the TLB miss
handling for .text was literally taking half the CPU time of the module
code!

- R.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/