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

From: Arjan van de Ven
Date: Sun Jul 12 2009 - 11:31:21 EST


On Sun, 12 Jul 2009 19:28:27 +0930
Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:

> On Sun, 12 Jul 2009 05:15:24 pm Arjan van de Ven wrote:
> > Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
> > > (I like the idea of trying kmalloc and falling back, simply
> > > because it reduces TLB pressure, but that's probably best done
> > > after unification).
> >
> > or using a non-power-of-two get_free_pages() thing...
> >
> > some architectures will need to know that memory needs to be
> > executable at allocation time so that it can be put in an
> > executable address range etc...
>
> Yes, maybe that's better than kmalloc. On my laptop I have 105
> modules loaded, with 3778464 total length: I'm wasting 206944 bytes
> on unused tails of pages. But that's only 0.06% of my memory.
>

105 is also a sign that you picked a somewhat suboptimal config...
that's of course your choice but it's a choice that has a small price,
if you don't want to pay that price, changing the config to not be
entirely insane is a good answer as well ;-)



--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
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/