Re: [PATCH] CodeSamples/count: Remove unnecessary memory barriers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux