Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2001 15:23:02 +0000
From:      Tony Finch <dot@dotat.at>
To:        freebsd-smp@freebsd.org
Subject:   Locked data-structures and delayed writes.
Message-ID:  <E14g6vW-00077j-00@hand.dotat.at>

next in thread | raw e-mail | index | archive | help

I've been having an interesting discussion elsewhere with someone
about the problems caused by delayed writes within the CPU. He's of
the general opinion that everything is broken and can be very
enlightening when explaining why he thinks this but he can also be
frustratingly vague.

Anyway, the question at hand is what happens if two threads on
different CPUs are accessing the same locked data structure when the
CPU delays writes to RAM, i.e.

	acquire_lock(s);
	modify(s);
	release_lock(s);

Things are very broken if the write can be delayed until after the
lock is released. What prevents that?

A related question, but perhaps more implausible, is what happens if a
page is unmapped from underneath a delayed write. This is particularly
pathological if the destination page was mmapped and the program is
exiting: the write may be lost.

Tony.
-- 
f.a.n.finch      fanf@covalent.net      dot@dotat.at


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E14g6vW-00077j-00>