Re: [PATCH 1/8] membarrier: Document why membarrier() works
flat view
From: Andy Lutomirski <luto@kernel.org>
Date: 2021-06-17 23:45:47
Also in:
lkml
On 6/16/21 12:30 AM, Peter Zijlstra wrote:
On Wed, Jun 16, 2021 at 02:00:37PM +1000, Nicholas Piggin wrote:quoted
Excerpts from Andy Lutomirski's message of June 16, 2021 1:21 pm:quoted
We had a nice comment at the top of membarrier.c explaining why membarrier worked in a handful of scenarios, but that consisted more of a list of things not to forget than an actual description of the algorithm and why it should be expected to work. Add a comment explaining my understanding of the algorithm. This exposes a couple of implementation issues that I will hopefully fix up in subsequent patches. Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Andy Lutomirski <luto@kernel.org> --- kernel/sched/membarrier.c | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)diff --git a/kernel/sched/membarrier.c b/kernel/sched/membarrier.c index b5add64d9698..3173b063d358 100644 --- a/kernel/sched/membarrier.c +++ b/kernel/sched/membarrier.c@@ -7,6 +7,61 @@ #include "sched.h"Precisely describing the orderings is great, not a fan of the style of the comment though.I'm with Nick on that; I can't read it :/ It only makes things more confusing. If you want precision, English (or any natural language) is your enemy. To describe ordering use the diagrams and/or litmus tests.
I made some changes. Maybe it's better now.