From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Tuckfield <paul@tuckfield.com>
Cc: pg@fastcrypt.com, Anjan Dave <adave@vantage.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Neil Conway <neilc@samurai.com>
Cc: Dirk Lutzebäck <lutzeb@aeccom.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Wierd context-switching issue on Xeon
Date: Wed, 21 Apr 2004 14:51:31 -0400
Message-ID: <14264.1082573491@sss.pgh.pa.us> (raw)
In-Reply-To: <78427208-93C0-11D8-BA67-000393BD6C3E@tuckfield.com>
References: <4BAFBB6B9CC46F41B2AD7D9F4BBAF78509814A@vt-pe2550-001.vantage.vantage.com>
<200404200959.52813.josh@agliodbs.com>
<1082515263.1558.214.camel@localhost.localdomain>
<78427208-93C0-11D8-BA67-000393BD6C3E@tuckfield.com>
Paul Tuckfield <paul@tuckfield.com> writes:
> I wonder do the threads stall so badly when pinging cache lines back
> and forth, that the kernel sees it as an opportunity to put the
> process to sleep? or do these worst case misses cause an interrupt?
No; AFAICS the kernel could not even be aware of that behavior.
The context swap storm is happening because of contention at the next
level up (LWLocks rather than spinlocks). It could be an independent
issue that just happens to be triggered by the same sort of access
pattern. I put forward a hypothesis that the cache miss storm caused by
the test-and-set ops induces the context swap storm by making the code
more likely to be executing in certain places at certain times ... but
it's only a hypothesis.
Yesterday evening I had pretty well convinced myself that they were
indeed independent issues: profiling on a single-CPU machine was telling
me that the test case I proposed spends over 10% of its time inside
ReadBuffer, which certainly seems like enough to explain a high rate of
contention on the BufMgrLock, without any assumptions about funny
behavior at the hardware level. However, your report and Dave's suggest
that there really is some linkage. So I'm still confused.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, paul@tuckfield.com, adave@vantage.com, josh@agliodbs.com, neilc@samurai.com, lutzeb@aeccom.com
Subject: Re: Wierd context-switching issue on Xeon
In-Reply-To: <14264.1082573491@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox