Whamcloud - gitweb
LU-14073 ofd: remove use of smp_read_barrier_depends() 94/40394/2
authorMr NeilBrown <neilb@suse.de>
Mon, 26 Oct 2020 02:30:22 +0000 (13:30 +1100)
committerOleg Drokin <green@whamcloud.com>
Fri, 26 Feb 2021 21:06:06 +0000 (21:06 +0000)
commit9d2776f02b67354b58e9ff93bd7fe5b5495ee288
treea5a4f61ef7f78ef255c009098d759c35445190a7
parenta7f48e6c15e28617793d89958c79e9ed8cb73e65
LU-14073 ofd: remove use of smp_read_barrier_depends()

Linux 5.9 removes smp_read_barrier_depends(), so lustre must stop
using it.

There is only one use: in ofd_access_log.c.
This use is unnecessary and can simply be removed.

The code is based on "Documentation/core-api/circular-buffers.rst"
which gives no indication that this barrier is needed.

The comment say its purpose is to ensure the index is read before the
data is read. This is unnecessary.
The data is written in osl_write_entry(), then a barrier is issued
(smp_store_release) before the ->head is written.
oal_read_entry() issues a barrier (smp_load_acquire()) before reading
that head.
'tail' is read without a barrer, but it then compared against ->head
in CIRC_CNT().  Even if reading ->tail was racey, the fact that
comparing it wilth ->head succeeded means that the data written at
->tail must have been safely written, and we can now read it without
any further barrier.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I9d0f0aeb67e1188d2012f4ae2e14b3656211c3e2
Reviewed-on: https://review.whamcloud.com/40394
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ofd/ofd_access_log.c