From: Michael Neuling <mikey@neuling.org>
To: Breno Leitao <leitao@debian.org>, linuxppc-dev@lists.ozlabs.org
Cc: paulus@ozlabs.org, gromero@linux.vnet.ibm.com,
mpe@ellerman.id.au, ldufour@linux.vnet.ibm.com
Subject: Re: [RFC PATCH 11/11] selftests/powerpc: Adapt the test
Date: Tue, 18 Sep 2018 16:36:23 +1000 [thread overview]
Message-ID: <b544029461059473cb7b8b6c66815a3ff31ec540.camel@neuling.org> (raw)
In-Reply-To: <1536781219-13938-12-git-send-email-leitao@debian.org>
On Wed, 2018-09-12 at 16:40 -0300, Breno Leitao wrote:
> The Documentation/powerpc/transactional_memory.txt says:
>=20
> "Syscalls made from within a suspended transaction are performed as norm=
al
> and the transaction is not explicitly doomed by the kernel. However,
> what the kernel does to perform the syscall may result in the transacti=
on
> being doomed by the hardware."
>=20
> With this new TM mechanism, the syscall will continue to be executed if t=
he
> syscall happens on a suspended syscall, but, the syscall will *fail* if t=
he
> transaction is still active during the syscall invocation.
Not sure I get this. This doesn't seem any different to before.
An active (not suspended) transaction *will* result in the syscall failing =
and
the transaction being doomed. =20
A syscall in a suspended transaction should succeed and the transaction.
You might need to clean up the language. I try to use:
Active =3D=3D transactional but not suspended (ie MSR[TS] =3D T)
Suspended =3D=3D suspended (ie MSR [TS] =3D S)
Doomed =3D=3D transaction to be rolled back at next opportinity (ie tche=
ck returns doomed)
(note: the kernel MSR_TM_ACTIVE() macro is not consistent with this since i=
t's
MSR[TS] =3D=3D S or T).
> On the syscall path, if the transaction is active and not suspended, it
> will call TM_KERNEL_ENTRY which will reclaim and recheckpoint the
> transaction, thus, dooming the transaction on userspace return, with
> failure code TM_CAUSE_SYSCALL.
But the test below is on a suspend transaction?
> This new model will break part of this test, but I understand that that t=
he
> documentation above didn't guarantee that the syscall would succeed, and =
it
> will never succeed anymore now on.
The syscall should pass in suspend (modulo the normal syscall checks). The
transaction may fail as a result.
> In fact, glibc is calling 'tabort' before every syscalls, thus, any sysca=
ll
> called through glibc from inside a transaction will be doomed anyhow.
>=20
> This patch updates the test case to not assume that a syscall inside a
> active transaction will succeed, because it will not anymore.
>=20
> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
> tools/testing/selftests/powerpc/tm/tm-syscall.c | 6 ------
> 1 file changed, 6 deletions(-)
>=20
> diff --git a/tools/testing/selftests/powerpc/tm/tm-syscall.c
> b/tools/testing/selftests/powerpc/tm/tm-syscall.c
> index 454b965a2db3..1439a87eba3a 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-syscall.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-syscall.c
> @@ -78,12 +78,6 @@ int tm_syscall(void)
> timeradd(&end, &now, &end);
> =20
> for (count =3D 0; timercmp(&now, &end, <); count++) {
> - /*
> - * Test a syscall within a suspended transaction and verify
> - * that it succeeds.
> - */
> - FAIL_IF(getppid_tm(true) =3D=3D -1); /* Should succeed. */
> -
> /*
> * Test a syscall within an active transaction and verify that
> * it fails with the correct failure code.
next prev parent reply other threads:[~2018-09-18 6:36 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 19:40 [RFC PATCH 00/11] New TM Model Breno Leitao
2018-09-12 19:40 ` [RFC PATCH 01/11] powerpc/tm: Reclaim transaction on kernel entry Breno Leitao
2018-09-18 1:31 ` Michael Neuling
2018-09-27 20:28 ` Breno Leitao
2018-09-27 20:28 ` Breno Leitao
2018-09-12 19:40 ` [RFC PATCH 02/11] powerpc/tm: Reclaim on unavailable exception Breno Leitao
2018-09-12 19:40 ` [RFC PATCH 03/11] powerpc/tm: Recheckpoint when exiting from kernel Breno Leitao
2018-09-12 19:40 ` [RFC PATCH 04/11] powerpc/tm: Always set TIF_RESTORE_TM on reclaim Breno Leitao
2018-09-12 19:40 ` [RFC PATCH 05/11] powerpc/tm: Function that updates the failure code Breno Leitao
2018-09-17 5:29 ` Michael Neuling
2018-09-18 1:29 ` Michael Neuling
2018-09-27 20:58 ` Breno Leitao
2018-09-28 5:27 ` Michael Neuling
2018-09-18 3:27 ` Michael Neuling
2018-09-12 19:40 ` [RFC PATCH 06/11] powerpc/tm: Refactor the __switch_to_tm code Breno Leitao
2018-09-18 4:04 ` Michael Neuling
2018-09-27 20:48 ` Breno Leitao
2018-09-12 19:40 ` [RFC PATCH 07/11] powerpc/tm: Do not recheckpoint at sigreturn Breno Leitao
2018-09-18 5:32 ` Michael Neuling
2018-09-12 19:40 ` [RFC PATCH 08/11] powerpc/tm: Do not reclaim on ptrace Breno Leitao
2018-09-18 5:36 ` Michael Neuling
2018-09-27 21:03 ` Breno Leitao
2018-09-28 5:36 ` Michael Neuling
2018-09-30 23:51 ` Breno Leitao
2018-10-01 0:34 ` Michael Neuling
2018-09-12 19:40 ` [RFC PATCH 09/11] powerpc/tm: Do not restore default DSCR Breno Leitao
2018-09-18 5:41 ` Michael Neuling
2018-09-27 20:51 ` Breno Leitao
2018-09-28 5:03 ` Michael Neuling
2018-09-12 19:40 ` [RFC PATCH 10/11] powerpc/tm: Set failure summary Breno Leitao
2018-09-18 5:50 ` Michael Neuling
2018-09-27 20:52 ` Breno Leitao
2018-09-28 5:17 ` Michael Neuling
2018-09-12 19:40 ` [RFC PATCH 11/11] selftests/powerpc: Adapt the test Breno Leitao
2018-09-18 6:36 ` Michael Neuling [this message]
2018-09-27 20:57 ` Breno Leitao
2018-09-28 5:25 ` Michael Neuling
2018-10-01 17:50 ` Breno Leitao
2018-09-17 5:25 ` [RFC PATCH 00/11] New TM Model Michael Neuling
2018-09-27 20:13 ` Breno Leitao
2018-09-27 20:13 ` Breno Leitao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b544029461059473cb7b8b6c66815a3ff31ec540.camel@neuling.org \
--to=mikey@neuling.org \
--cc=gromero@linux.vnet.ibm.com \
--cc=ldufour@linux.vnet.ibm.com \
--cc=leitao@debian.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).