From: Peter Rival <frival@zk3.dec.com>
To: axp-list@redhat.com
Cc: jmartin@pdgsrv.hlo.dec.com, jestabro@pdgsrv.hlo.dec.com,
torvalds@transmeta.com
Subject: Re: instability
Date: Mon, 21 Jun 1999 14:48:26 -0400 [thread overview]
Message-ID: <376E88FA.9D75E4DD@zk3.dec.com> (raw)
In-Reply-To: 19990619125843.A8357@twiddle.net
Richard Henderson wrote:
> On Sat, Jun 19, 1999 at 01:08:38PM -0400, Jay Estabrook wrote:
> > Any progress on the ASN/TLB stuff we were discussing?
>
> Yes. I sent a message to axp-list in the wee hours Friday morning, but
> sent it from the wrong account and it bounced.
>
> It's because we made no effort to validate p->tss.asn, only p->mm->context.
> This is a mistake whenever there exist multiple processes that share VM, as
> with threads or vfork.
>
> Consider two processes A and B sharing a VM. Allow that both have slept
> across the asn rollover. Process A gets scheduled first, notes that
> A->mm->context is out of date, allocates a new one, and updates A->tss.asn
> and A->mm->context. Process B gets scheduled, notes that B->mm->context
> is up to date, and proceeds to use an out of date asn, causing all sorts
> of havok.
>
> A similar problem occurs on SMP when a pair of threads migrates to a
> different processor.
>
> I've played around with a couple of variations on a patch. Attached
> is my favourite so far.
>
> A variant that I'm considering relies on the fact that the PALcode only
> reads tss.asn, and that the hardware ignores bits outside the supported
> range. As it is, we have to also keep a shadow field in tss with the
> full context.
>
> One problem that variant is that it narrows the context from 64 bits
> to 32 bits, due to the field width of tss.asn. Which means there are
> now only 19 instead of 51 bits of serial number, which means that the
> possibility of a process sleeping through serial number rollover and
> running with an invalid asn is real.
>
> I'm half convinced that the cure (detecting serial number rollover and
> walking the process list to reset everyone's context) is worse than
> just keeping a second field in the tss.
>
> (Linus, this is different from the patch I sent Friday -- that one
> had a silly thinko that allocated asn contexts more often than needed,
> and in the SMP case where two threads run on different processors
> would allocate new contexts every time they are scheduled.)
>
> In addition to solving this problem, the patch also fixes EV4, which
> was broken when the tbia was removed from alpha_switch_to. Also,
> the SMP last_asn array is dispersed into per-cpu local data to avoid
> fighting over cache lines. Also, __reload_tss is cleaned up to
> properly use virt_to_phys instead of doing some silly masking thing.
>
Grabbed the patch, applied it, got the following when compiling for
rawhide. I'll look into it as soon as I have a chance (hopefully today...).
....
/usr/src/linux/arch/alpha/lib/lib.a /usr/src/linux/lib/lib.a
/usr/src/linux/arch/alpha/lib/lib.a \
--end-group \
-o vmlinux
arch/alpha/kernel/kernel.o: In function `exit_thread':
process.c(.text.init+0x216c): undefined reference to `mcpcia_srm_readb'
arch/alpha/kernel/kernel.o: In function `flush_thread':
process.c(.text.init+0x2184): undefined reference to `mcpcia_srm_readw'
process.c(.text.init+0x2190): undefined reference to `mcpcia_srm_writeb'
process.c(.text.init+0x21a0): undefined reference to `mcpcia_srm_writew'
arch/alpha/kernel/kernel.o: In function `get_irq_list':
irq.c(.data+0x5e00): undefined reference to `mcpcia_virt_to_bus'
irq.c(.data+0x5e08): undefined reference to `mcpcia_bus_to_virt'
irq.c(.data+0x5e10): undefined reference to `mcpcia_inb'
irq.c(.data+0x5e18): undefined reference to `mcpcia_inw'
irq.c(.data+0x5e20): undefined reference to `mcpcia_inl'
irq.c(.data+0x5e28): undefined reference to `mcpcia_outb'
irq.c(.data+0x5e30): undefined reference to `mcpcia_outw'
irq.c(.data+0x5e38): undefined reference to `mcpcia_outl'
irq.c(.data+0x5e40): undefined reference to `mcpcia_readb'
irq.c(.data+0x5e48): undefined reference to `mcpcia_readw'
irq.c(.data+0x5e50): undefined reference to `mcpcia_readl'
irq.c(.data+0x5e58): undefined reference to `mcpcia_readq'
irq.c(.data+0x5e60): undefined reference to `mcpcia_writeb'
irq.c(.data+0x5e68): undefined reference to `mcpcia_writew'
irq.c(.data+0x5e70): undefined reference to `mcpcia_writel'
irq.c(.data+0x5e78): undefined reference to `mcpcia_writeq'
irq.c(.data+0x5e80): undefined reference to `mcpcia_dense_mem'
make: *** [vmlinux] Error 1
next prev parent reply other threads:[~1999-06-21 19:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <376BCE96.8CACBF27@ma.ultranet.com>
1999-06-19 19:58 ` instability Richard Henderson
1999-06-20 23:30 ` instability (patch) Darren Breeze
1999-06-21 18:48 ` Peter Rival [this message]
1999-06-22 4:45 ` instability Richard Henderson
1999-06-22 12:07 ` instability Peter Rival
1999-06-22 17:00 ` instability Richard Henderson
1999-06-22 18:42 ` instability Peter Rival
1999-06-22 4:45 ` instability Michael Ivanov
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox