[RESEND PATCH v3] seccomp: Improve performance by optimizing rmb()

2021-03-08 Thread wanghongzhe
1: - replace rmb() with smp_rmb() - move the smp_rmb() logic to the middle between TIF_SECCOMP and mode Signed-off-by: wanghongzhe --- kernel/seccomp.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 1d60fc2c9987..64

RE: [PATCH v3] seccomp: Improve performace by optimizing rmb()

2021-02-25 Thread Wanghongzhe (Hongzhe, EulerOS)
> > On Feb 24, 2021, at 12:03 AM, wanghongzhe > wrote: > > > > As Kees haved accepted the v2 patch at a381b70a1 which just replaced > > rmb() with smp_rmb(), this patch will base on that and just adjust the > > smp_rmb() to the correct position. > > > &

[PATCH v3] seccomp: Improve performace by optimizing rmb()

2021-02-24 Thread wanghongzhe
_SECCOMP and mode Signed-off-by: wanghongzhe --- kernel/seccomp.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 1d60fc2c9987..64b236cb8a7f 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -1160,12 +116

[PATCH v3] seccomp: Improve performace by optimizing rmb()

2021-02-24 Thread wanghongzhe
_SECCOMP and mode Signed-off-by: wanghongzhe --- kernel/seccomp.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 1d60fc2c9987..64b236cb8a7f 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -1160,12 +116

RE: [PATCH] seccomp: Improve performance by optimizing memory barrier

2021-02-07 Thread Wanghongzhe (Hongzhe, EulerOS)
> From: Leon Romanovsky [mailto:l...@kernel.org] > Sent: Monday, February 8, 2021 2:44 PM > To: Wanghongzhe (Hongzhe, EulerOS) > Cc: keesc...@chromium.org; l...@amacapital.net; w...@chromium.org; > a...@kernel.org; dan...@iogearbox.net; and...@kernel.org; ka...@fb.com; > songli

[PATCH v2] seccomp: Improve performace by optimizing rmb()

2021-02-04 Thread wanghongzhe
or the next optimize patch, if you guys thinks this smp_rmb() refactor is appropriate. v1 -> v2: - only replace rmb() with smp_rmb() - provide the performance test number RFC -> v1: - replace rmb() with smp_rmb() - move the smp_rmb() logic to the middle between TIF_SECCOMP and mode Sign

RE: [PATCH v1 1/1] Firstly, as Andy mentioned, this should be smp_rmb() instead of rmb(). considering that TSYNC is a cross-thread situation, and rmb() is a mandatory barrier which should not be used

2021-02-04 Thread Wanghongzhe (Hongzhe, EulerOS)
e performance numbers. > BUG() should never be used[1]. This is a recoverable situation, I think, and > should be handled as such. I just follow the default case behind. Let's discuss this issue in next patches. -- wanghongzhe

[PATCH v1 1/1] Firstly, as Andy mentioned, this should be smp_rmb() instead of rmb(). considering that TSYNC is a cross-thread situation, and rmb() is a mandatory barrier which should not be used to c

2021-02-02 Thread wanghongzhe
first TSYNCed time, and if the new mode don't equals to SECCOMP_MODE_FILTER, do BUG(), go to FILTER path otherwise. RFC -> v1: - replace rmb() with smp_rmb() - move the smp_rmb() logic to the middle between SYSCALL_WORK_SECCOMP and mode Signed-off-by: wanghongzhe Reviewed-by: Andy Lu

RE: [PATCH] seccomp: Improve performance by optimizing memory barrier

2021-02-01 Thread Wanghongzhe (Hongzhe, EulerOS)
>> On Feb 1, 2021, at 4:06 AM, wanghongzhe wrote: >> >> If a thread(A)'s TSYNC flag is set from seccomp(), then it will >> synchronize its seccomp filter to other threads(B) in same thread >> group. To avoid race condition, seccomp puts rmb() between

[PATCH] seccomp: Improve performance by optimizing memory barrier

2021-02-01 Thread wanghongzhe
te memory barrier between writing the filter and mode in smp_mb__before_atomic(), to avoid the race condition in TSYNC case. Signed-off-by: wanghongzhe --- kernel/seccomp.c | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/kernel/seccomp.c

[PATCH] seccomp: Improve performance by optimizing memory barrier

2021-02-01 Thread wanghongzhe
te memory barrier between writing the filter and mode in smp_mb__before_atomic(), to avoid the race condition in TSYNC case. Signed-off-by: wanghongzhe --- kernel/seccomp.c | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/kernel/seccomp.c