9fans archive / 2000 / 07 / 538 /    prev next

From: miller@ham...
Subject: Re: [9fans] Kernel question: i386 test-and-set problem
Date: Fri, 21 Jul 2000 10:10:39 BST

> r->p is either 0 or a valid process number.  Therefore, the r->p
> access shouldn't cause a crash.

Sorry, I'm being sloppy with terminology.  By "crash" I meant that
kfs became internally deadlocked by the failure of sleep/wakeup,
forcing me to reboot without syncing the local file system.

> In v2 the lock was providing the coherence() that we put herein v3.

Yes, I agree -- that's exactly my point.  Locking instructions should
imply memory coherence, however outlandish the memory architecture
might be.  So a conservative locking discipline means not having
to worry about coherence issues.

I know I'm being annoyingly preachy here.  You could say that my
preference for lock() over coherence() is just personal bias.  But
it seems to me that reasoning about weakly coherent memory is
subtle and difficult -- I certainly don't understand it fully.
Synchronisation with locks is more straightforward, and makes sense
on any shared memory architecture.

I'll shut up now.

-- Richard