Messages in this thread | | | Date | Thu, 17 Feb 2011 18:04:13 -0500 | From | Chris Metcalf <> | Subject | Re: IGMP and rwlock: Dead ocurred again on TILEPro |
| |
On 2/17/2011 5:53 PM, David Miller wrote: > From: Chris Metcalf <cmetcalf@tilera.com> > Date: Thu, 17 Feb 2011 17:49:46 -0500 > >> The fix is to disable interrupts for the arch_read_lock family of methods. > How does that help handle the race when it happens between different > cpus, instead of between IRQ and non-IRQ context on the same CPU?
There's no race in that case, since the lock code properly backs off and retries until the other cpu frees it. The distinction here is that the non-IRQ context is "wedged" by the IRQ context.
> Why don't you just use the generic spinlock based rwlock code on Tile, > since that is all that your atomic instructions can handle > sufficiently?
The tile-specific code encodes reader/writer information in the same 32-bit word that the test-and-set instruction manipulates, so it's more efficient both in space and time. This may not really matter for rwlocks, since no one cares much about them any more, but that was the motivation.
-- Chris Metcalf, Tilera Corp. http://www.tilera.com
| |