From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Add basic spinlock tests to regression tests. |
Date: | 2020-06-18 21:36:31 |
Message-ID: | E1jm2D1-0006Xq-2M@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Add basic spinlock tests to regression tests.
As s_lock_test, the already existing test for spinlocks, isn't run in
an automated fashion (and doesn't test a normal backend environment),
adding tests that are run as part of a normal regression run is a good
idea. Particularly in light of several recent and upcoming spinlock
related fixes.
Currently the new tests are run as part of the pre-existing
test_atomic_ops() test. That perhaps can be quibbled about, but for
now seems ok.
The only operations that s_lock_test tests but the new tests don't are
the detection of a stuck spinlock and S_LOCK_FREE (which is otherwise
unused, not implemented on all platforms, and will be removed).
This currently contains a test for more than INT_MAX spinlocks (only
run with --disable-spinlocks), to ensure the recent commit fixing a
bug with more than INT_MAX spinlock initializations is correct. That
test is somewhat slow, so we might want to disable it after a few
days.
It might be worth retiring s_lock_test after this. The added coverage
of a stuck spinlock probably isn't worth the added complexity?
Author: Andres Freund
Discussion: https://postgr.es/m/20200606023103.avzrctgv7476xj7i@alap3.anarazel.de
Branch
------
REL9_5_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/7e91f90a8ed4af18f4d2a3cb1b657b4296e2e710
Modified Files
--------------
src/test/regress/regress.c | 109 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 109 insertions(+)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2020-06-18 21:44:47 | Re: pgsql: Add basic spinlock tests to regression tests. |
Previous Message | Andres Freund | 2020-06-18 21:36:27 | pgsql: Fix deadlock danger when atomic ops are done under spinlock. |