[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b7102c74-18b0-150e-c103-85afa26a8b6a@kernel.org>
Date: Thu, 17 Jun 2021 16:45:44 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>,
Nicholas Piggin <npiggin@...il.com>
Cc: x86@...nel.org, Andrew Morton <akpm@...ux-foundation.org>,
Dave Hansen <dave.hansen@...el.com>,
LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH 1/8] membarrier: Document why membarrier() works
On 6/16/21 12:30 AM, Peter Zijlstra wrote:
> On Wed, Jun 16, 2021 at 02:00:37PM +1000, Nicholas Piggin wrote:
>> Excerpts from Andy Lutomirski's message of June 16, 2021 1:21 pm:
>>> 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@...icios.com>
>>> Cc: Nicholas Piggin <npiggin@...il.com>
>>> Cc: Peter Zijlstra <peterz@...radead.org>
>>> Signed-off-by: Andy Lutomirski <luto@...nel.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.
Powered by blists - more mailing lists