Re: Red zones

From: Eric Dumazet
Date: Thu Jan 26 2006 - 00:26:43 EST


Bernd Eckenfels a écrit :
Eric Dumazet <dada1@xxxxxxxxxxxxx> wrote:
We can use a red zone big enough to hold the whole per_cpu data.

I am trying to learn a bit here: why is it required to have a speciel red
zone for this case? Wouldnt it make more sence to have a single red zone
which can be used by all locations in the kernel for unused structures? That
would reduce the number of wasted segements in the page table, or?


On x86_64, available virtual space is huge, so having different red zones can spot the fault more easily : If the target of the fault is in the PER_CPU redzone given range, we can instantly knows there is still a per_cpu() user accessing a non possible cpu area. As the red zone is not mapped at all, no page table is setup.


On 32 bits platforms, this is completely different : space is scarse (typical User/Kernel split of 3GB/1GB), so we should avoid to reserve even a 32 KB redzone. We could do it in DEBUG mode for example. Current interim patch in 2.6.16-rc1-mm3 is using NULL pointer but this is not a perfect solution since the underlying current user process can perfectly map something in this 'zone'.

Eric


-
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/