Re: [PATCH][RFC] 4K stacks default, not a debug thing any more...?

Dan Merillat
2007-08-10T01:03:50Z

On 8/1/07, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Wed, 1 Aug 2007 15:33:58 +0200
> Andrea Arcangeli <andrea@suse.de> wrote:
> > Tweaking kernel ptes is prohibitive during clone() because that's
> > kernel memory and it would require a flush tlb all with IPIs that
> > won't scale (IPIs are really the blocker)
>
> Agreed - except when doing debug work then its an acceptable cost. You
> still have to sort the debug side out because you are going to fault the
> kernel stack which will probably then cause a triple fault and reboot on
> the spot.

I was assuming debugging work, yes. I was also thinking it wouldn't
be done at clone() time, but mapped (on a single CPU) at the time of a
context switch. It would eliminate IPI, but would probably make the
rest of the TLB handling much too ugly to contemplate. As an
alternative, could the TLB flush and associated IPI be deferred until
the process migrates? First migration would trigger flush/IPI,
further migration would be as now, no? I'd happily run it with
various dm/md layers underneath

On 8/1/07, Denis Vlasenko <vda.linux@googlemail.com> wrote:
> Hmm, neat. Why do you need to _allocate second page_ at all?
> Just mark it "not present"...

Because the kernel mapping covers all physical memory contiguously, so
if the page isn't allocated, it could be used by a kernel data
structure you need to access. Same reason the kernel stack has to be
contiguous pages. Well, for non-highmem at least. Either way, you
don't want to mark an in-use page as inaccessable, you never know
what's under there.