Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Michal Clapinski <mclapinski@google.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	"Paul E. McKenney" <paulmck@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrei Vagin <avagin@gmail.com>, Shuah Khan <shuah@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Michal Clapinski <mclapinski@google.com>
Subject: [PATCH 0/2] sched/membarrier, selftests: Introduce MEMBARRIER_CMD_GET_REGISTRATIONS
Date: Wed,  7 Dec 2022 17:43:36 +0100	[thread overview]
Message-ID: <20221207164338.1535591-1-mclapinski@google.com> (raw)

This change provides a method to query previously issued registrations.
It's needed for CRIU (checkpoint/restore in userspace). Before this
change we had to issue private membarrier commands during checkpoint -
if they succeeded, they must have been registered. Unfortunately global
membarrier succeeds even on unregistered processes, so there was no way to
tell if MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED had been issued or not.

CRIU is run after the process has been frozen with ptrace, so we don't
have to worry too much about the result of running this command in parallel
with registration commands.

Michal Clapinski (2):
  sched/membarrier: Introduce MEMBARRIER_CMD_GET_REGISTRATIONS
  selftests/membarrier: Test MEMBARRIER_CMD_GET_REGISTRATIONS

 include/uapi/linux/membarrier.h               |  4 ++
 kernel/sched/membarrier.c                     | 39 ++++++++++++++++++-
 .../membarrier/membarrier_test_impl.h         | 33 ++++++++++++++++
 .../membarrier/membarrier_test_multi_thread.c |  2 +-
 .../membarrier_test_single_thread.c           |  6 ++-
 5 files changed, 81 insertions(+), 3 deletions(-)

-- 
2.39.0.rc0.267.gcb52ba06e7-goog


             reply	other threads:[~2022-12-07 16:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 16:43 Michal Clapinski [this message]
2022-12-07 16:43 ` [PATCH 1/2] sched/membarrier: Introduce MEMBARRIER_CMD_GET_REGISTRATIONS Michal Clapinski
2022-12-07 17:07   ` Mathieu Desnoyers
2022-12-07 18:04     ` Michał Cłapiński
2022-12-20 17:51       ` Michał Cłapiński
2022-12-22 15:23         ` Mathieu Desnoyers
2022-12-07 16:43 ` [PATCH 2/2] selftests/membarrier: Test MEMBARRIER_CMD_GET_REGISTRATIONS Michal Clapinski
2022-12-22 15:28 ` [PATCH 0/2] sched/membarrier, selftests: Introduce MEMBARRIER_CMD_GET_REGISTRATIONS Mathieu Desnoyers
2022-12-23  1:05   ` Paul E. McKenney

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=20221207164338.1535591-1-mclapinski@google.com \
    --to=mclapinski@google.com \
    --cc=avagin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=shuah@kernel.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