2022-03-31 02:36:39

by Damien Le Moal

[permalink] [raw]
Subject: Re: [PATCH 2/3] RISC-V: K210 defconfigs: Drop redundant MEMBARRIER=n

On 3/31/22 08:47, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <[email protected]>
>
> As of 93917ad50972 ("RISC-V: Add support for restartable sequence") we
> have support for restartable sequences, which default to enabled. These
> select MEMBARRIER, so disabling it is now redundant.
>
> Signed-off-by: Palmer Dabbelt <[email protected]>
>
> ---
>
> I'm not actually sure this is the right way to go: presumably the K210
> defconfigs had MEMBARRIER=n for a reason (maybe just size?), so we might
> actually want to move to RSEQ=n instead? As usual: I don't test on the
> K210, so I'm not exactly sure what the constraints are.

Not sure either. It is like this now because I think this was the default
at the time the config was created.

Niklas,

Can you test this please ?

> ---
> arch/riscv/configs/nommu_k210_defconfig | 1 -
> arch/riscv/configs/nommu_k210_sdcard_defconfig | 1 -
> arch/riscv/configs/nommu_virt_defconfig | 1 -
> 3 files changed, 3 deletions(-)
>
> diff --git a/arch/riscv/configs/nommu_k210_defconfig b/arch/riscv/configs/nommu_k210_defconfig
> index 3f42ed87dde8..2438fa39f8ae 100644
> --- a/arch/riscv/configs/nommu_k210_defconfig
> +++ b/arch/riscv/configs/nommu_k210_defconfig
> @@ -21,7 +21,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
> # CONFIG_AIO is not set
> # CONFIG_IO_URING is not set
> # CONFIG_ADVISE_SYSCALLS is not set
> -# CONFIG_MEMBARRIER is not set
> # CONFIG_KALLSYMS is not set
> CONFIG_EMBEDDED=y
> # CONFIG_VM_EVENT_COUNTERS is not set
> diff --git a/arch/riscv/configs/nommu_k210_sdcard_defconfig b/arch/riscv/configs/nommu_k210_sdcard_defconfig
> index af64b95e88cc..9a133e63ae5b 100644
> --- a/arch/riscv/configs/nommu_k210_sdcard_defconfig
> +++ b/arch/riscv/configs/nommu_k210_sdcard_defconfig
> @@ -13,7 +13,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
> # CONFIG_AIO is not set
> # CONFIG_IO_URING is not set
> # CONFIG_ADVISE_SYSCALLS is not set
> -# CONFIG_MEMBARRIER is not set
> # CONFIG_KALLSYMS is not set
> CONFIG_EMBEDDED=y
> # CONFIG_VM_EVENT_COUNTERS is not set
> diff --git a/arch/riscv/configs/nommu_virt_defconfig b/arch/riscv/configs/nommu_virt_defconfig
> index e1c9864b6237..5269fbb6b4fc 100644
> --- a/arch/riscv/configs/nommu_virt_defconfig
> +++ b/arch/riscv/configs/nommu_virt_defconfig
> @@ -19,7 +19,6 @@ CONFIG_EXPERT=y
> # CONFIG_AIO is not set
> # CONFIG_IO_URING is not set
> # CONFIG_ADVISE_SYSCALLS is not set
> -# CONFIG_MEMBARRIER is not set
> # CONFIG_KALLSYMS is not set
> # CONFIG_VM_EVENT_COUNTERS is not set
> # CONFIG_COMPAT_BRK is not set


--
Damien Le Moal
Western Digital Research


2022-03-31 04:01:26

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH 2/3] RISC-V: K210 defconfigs: Drop redundant MEMBARRIER=n

On Wed, 30 Mar 2022 17:26:45 PDT (-0700), [email protected] wrote:
> On 3/31/22 08:47, Palmer Dabbelt wrote:
>> From: Palmer Dabbelt <[email protected]>
>>
>> As of 93917ad50972 ("RISC-V: Add support for restartable sequence") we
>> have support for restartable sequences, which default to enabled. These
>> select MEMBARRIER, so disabling it is now redundant.
>>
>> Signed-off-by: Palmer Dabbelt <[email protected]>
>>
>> ---
>>
>> I'm not actually sure this is the right way to go: presumably the K210
>> defconfigs had MEMBARRIER=n for a reason (maybe just size?), so we might
>> actually want to move to RSEQ=n instead? As usual: I don't test on the
>> K210, so I'm not exactly sure what the constraints are.
>
> Not sure either. It is like this now because I think this was the default
> at the time the config was created.
>
> Niklas,
>
> Can you test this please ?

Thanks. I'm OK either way, I guess I'd learn towards turning on the
features if they work/fit. I'll hold off on merging this one for a bit,
I don't see any rush (it's just a defconfig) and if what was there is
broken then we can take it as a fix. Otherwise it'll just get rolled up
into the next round of these, which I'll hopefully remember to do
earlier next time.

>
>> ---
>> arch/riscv/configs/nommu_k210_defconfig | 1 -
>> arch/riscv/configs/nommu_k210_sdcard_defconfig | 1 -
>> arch/riscv/configs/nommu_virt_defconfig | 1 -
>> 3 files changed, 3 deletions(-)
>>
>> diff --git a/arch/riscv/configs/nommu_k210_defconfig b/arch/riscv/configs/nommu_k210_defconfig
>> index 3f42ed87dde8..2438fa39f8ae 100644
>> --- a/arch/riscv/configs/nommu_k210_defconfig
>> +++ b/arch/riscv/configs/nommu_k210_defconfig
>> @@ -21,7 +21,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
>> # CONFIG_AIO is not set
>> # CONFIG_IO_URING is not set
>> # CONFIG_ADVISE_SYSCALLS is not set
>> -# CONFIG_MEMBARRIER is not set
>> # CONFIG_KALLSYMS is not set
>> CONFIG_EMBEDDED=y
>> # CONFIG_VM_EVENT_COUNTERS is not set
>> diff --git a/arch/riscv/configs/nommu_k210_sdcard_defconfig b/arch/riscv/configs/nommu_k210_sdcard_defconfig
>> index af64b95e88cc..9a133e63ae5b 100644
>> --- a/arch/riscv/configs/nommu_k210_sdcard_defconfig
>> +++ b/arch/riscv/configs/nommu_k210_sdcard_defconfig
>> @@ -13,7 +13,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
>> # CONFIG_AIO is not set
>> # CONFIG_IO_URING is not set
>> # CONFIG_ADVISE_SYSCALLS is not set
>> -# CONFIG_MEMBARRIER is not set
>> # CONFIG_KALLSYMS is not set
>> CONFIG_EMBEDDED=y
>> # CONFIG_VM_EVENT_COUNTERS is not set
>> diff --git a/arch/riscv/configs/nommu_virt_defconfig b/arch/riscv/configs/nommu_virt_defconfig
>> index e1c9864b6237..5269fbb6b4fc 100644
>> --- a/arch/riscv/configs/nommu_virt_defconfig
>> +++ b/arch/riscv/configs/nommu_virt_defconfig
>> @@ -19,7 +19,6 @@ CONFIG_EXPERT=y
>> # CONFIG_AIO is not set
>> # CONFIG_IO_URING is not set
>> # CONFIG_ADVISE_SYSCALLS is not set
>> -# CONFIG_MEMBARRIER is not set
>> # CONFIG_KALLSYMS is not set
>> # CONFIG_VM_EVENT_COUNTERS is not set
>> # CONFIG_COMPAT_BRK is not set

2022-04-05 01:05:42

by Niklas Cassel

[permalink] [raw]
Subject: Re: [PATCH 2/3] RISC-V: K210 defconfigs: Drop redundant MEMBARRIER=n

On Thu, Mar 31, 2022 at 09:26:45AM +0900, Damien Le Moal wrote:
> On 3/31/22 08:47, Palmer Dabbelt wrote:
> > From: Palmer Dabbelt <[email protected]>
> >
> > As of 93917ad50972 ("RISC-V: Add support for restartable sequence") we
> > have support for restartable sequences, which default to enabled. These
> > select MEMBARRIER, so disabling it is now redundant.
> >
> > Signed-off-by: Palmer Dabbelt <[email protected]>
> >
> > ---
> >
> > I'm not actually sure this is the right way to go: presumably the K210
> > defconfigs had MEMBARRIER=n for a reason (maybe just size?), so we might
> > actually want to move to RSEQ=n instead? As usual: I don't test on the
> > K210, so I'm not exactly sure what the constraints are.
>
> Not sure either. It is like this now because I think this was the default
> at the time the config was created.
>
> Niklas,
>
> Can you test this please ?

Apologies for not being able to get back sooner.

I can see that this has already landed in Linus's tree:
a3dfc532b873 ("Merge tag 'riscv-for-linus-5.18-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux")

I smoke tested the above SHA1 on a k210 board, and on QEMU no-MMU
(since that defconfig was updated as well), and saw no issues.


Kind regards,
Niklas


>
> > ---
> > arch/riscv/configs/nommu_k210_defconfig | 1 -
> > arch/riscv/configs/nommu_k210_sdcard_defconfig | 1 -
> > arch/riscv/configs/nommu_virt_defconfig | 1 -
> > 3 files changed, 3 deletions(-)
> >
> > diff --git a/arch/riscv/configs/nommu_k210_defconfig b/arch/riscv/configs/nommu_k210_defconfig
> > index 3f42ed87dde8..2438fa39f8ae 100644
> > --- a/arch/riscv/configs/nommu_k210_defconfig
> > +++ b/arch/riscv/configs/nommu_k210_defconfig
> > @@ -21,7 +21,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
> > # CONFIG_AIO is not set
> > # CONFIG_IO_URING is not set
> > # CONFIG_ADVISE_SYSCALLS is not set
> > -# CONFIG_MEMBARRIER is not set
> > # CONFIG_KALLSYMS is not set
> > CONFIG_EMBEDDED=y
> > # CONFIG_VM_EVENT_COUNTERS is not set
> > diff --git a/arch/riscv/configs/nommu_k210_sdcard_defconfig b/arch/riscv/configs/nommu_k210_sdcard_defconfig
> > index af64b95e88cc..9a133e63ae5b 100644
> > --- a/arch/riscv/configs/nommu_k210_sdcard_defconfig
> > +++ b/arch/riscv/configs/nommu_k210_sdcard_defconfig
> > @@ -13,7 +13,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
> > # CONFIG_AIO is not set
> > # CONFIG_IO_URING is not set
> > # CONFIG_ADVISE_SYSCALLS is not set
> > -# CONFIG_MEMBARRIER is not set
> > # CONFIG_KALLSYMS is not set
> > CONFIG_EMBEDDED=y
> > # CONFIG_VM_EVENT_COUNTERS is not set
> > diff --git a/arch/riscv/configs/nommu_virt_defconfig b/arch/riscv/configs/nommu_virt_defconfig
> > index e1c9864b6237..5269fbb6b4fc 100644
> > --- a/arch/riscv/configs/nommu_virt_defconfig
> > +++ b/arch/riscv/configs/nommu_virt_defconfig
> > @@ -19,7 +19,6 @@ CONFIG_EXPERT=y
> > # CONFIG_AIO is not set
> > # CONFIG_IO_URING is not set
> > # CONFIG_ADVISE_SYSCALLS is not set
> > -# CONFIG_MEMBARRIER is not set
> > # CONFIG_KALLSYMS is not set
> > # CONFIG_VM_EVENT_COUNTERS is not set
> > # CONFIG_COMPAT_BRK is not set
>
>
> --
> Damien Le Moal
> Western Digital Research