[PATCH v2] riscv/fence: Consolidate fence definitions and define __{mb,rmb,wmb}

Andrea Parri parri.andrea at gmail.com
Tue Feb 13 02:38:57 PST 2024


Eric,

On Mon, Feb 12, 2024 at 10:59:46AM +0000, Eric Chan wrote:
> Disparate fence implementations are consolidated into fence.h.
> 
> Introduce __{mb,rmb,wmb}, and rely on the generic definitions
> for {mb,rmb,wmb}. A first consequence is that __{mb,rmb,wmb}
> map to a compiler barrier on !SMP (while their definition remains
> unchanged on SMP).
> 
> Introduce RISCV_FULL_BARRIER and use in arch_atomic* function.
> like RISCV_ACQUIRE_BARRIER and RISCV_RELEASE_BARRIER, The fence
> instruction can be eliminated When SMP is not enabled.
> 
> Also clean up the warning with scripts/checkpatch.pl.
> 
> Signed-off-by: Eric Chan <ericchancf at google.com>

I suggest to split this patch into multiple patches ("one problem per
patch" and all that), say:

  1/3 - riscv/barrier: Define __{mb,rmb,wmb}
  2/3 - riscv/barrier: Define RISCV_FULL_BARRIER
  3/3 - riscv/barrier: Resolve checkpath.pl warnings

Please also review the changelog(s), since the description above (in
particular the information about __{mb,rmb,wmb}) doesn't seem to match
the code changes.

  Andrea



More information about the linux-riscv mailing list