All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: Alan Huang <mmpgouride@gmail.com>, paulmck@kernel.org
Cc: perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH] CodeSamples/count: Remove unnecessary memory barriers
Date: Sun, 9 Apr 2023 09:11:58 +0900	[thread overview]
Message-ID: <e425c28d-c285-0fc6-b692-744df0bde3a8@gmail.com> (raw)
In-Reply-To: <81ADBFE2-3576-48EC-A892-B49A5C265487@gmail.com>

Hi,

On Sat, 8 Apr 2023 02:04:24 +0800, Alan Huang wrote:
> Hi Paul and Akira,
> 
> This is the patch v3, I forgot to add a version tag…
> 
> And I think it may be better to add a question in a subsequent path.

So I'm looking at Quick Quizzes on count_lim_sig.c.
It looks to me Quick Quiz 5.50 lost its context due to the
removal of smp_mb() and the use of smp_store_release().

A band-aide fix would be to change the quiz to:

    In Listing 5.18's function flush_local_count_sig(), why
    are there READ_ONCE(), WRITE_ONCE(), and smp_store_release()
    wrappers around the uses of the theft per-thread variable?

, and to adjust the line count in its Answer.

However, smp_store_release() is by no means a simple wrapper.
So I'm wondering if it is worthwhile to keep this quiz.

Paul, how about replacing the quiz with the new quiz asking:

     In Listing 5.18, doesn't flush_local_count_sig() need
     a stronger memory barrier or two?

, and picking Alan's reasoning in the answer?

        Thanks, Akira

> 
> Thanks,
> Alan


  reply	other threads:[~2023-04-09  0:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07 17:58 [PATCH] CodeSamples/count: Remove unnecessary memory barriers Alan Huang
2023-04-07 18:04 ` Alan Huang
2023-04-09  0:11   ` Akira Yokosawa [this message]
2023-04-10 19:06     ` Paul E. McKenney
2023-04-11 16:34       ` Alan Huang
2023-04-12 11:32         ` Elad Lahav
2023-04-12 18:50           ` Paul E. McKenney
2023-04-08  4:25 ` Akira Yokosawa
2023-04-08  6:02   ` Alan Huang
2023-04-08  6:04   ` Alan Huang

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=e425c28d-c285-0fc6-b692-744df0bde3a8@gmail.com \
    --to=akiyks@gmail.com \
    --cc=mmpgouride@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=perfbook@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.