Re: [XEN PATCH 1/6] x86: rename variable 'e820' to address MISRA C:2012 Rule 5.3

2023-08-07 Thread Nicola Vetrini
On 04/08/2023 23:19, Stefano Stabellini wrote: On Fri, 4 Aug 2023, Nicola Vetrini wrote: The variable declared in the header file 'xen/arch/x86/include/asm/e820.h' is shadowed by many function parameters, so it is renamed to avoid these violations. No functional changes. Signed-off-by: Nicol

Re: [XEN PATCH 4/6] x86/include: address MISRA C:2012 Rule 5.3.

2023-08-07 Thread Nicola Vetrini
On 04/08/2023 23:24, Stefano Stabellini wrote: On Fri, 4 Aug 2023, Nicola Vetrini wrote: s/mpc_default_type/mpc_default in 'xen/arch/x86/include/asm/mpspec.h' to avoid clashing with function parameter names in 'mpparse.c'. No functional changes. Signed-off-by: Nicola Vetrini --- Even though t

Re: [XEN PATCH v2 3/4] x86/irq: rename variable to address MISRA C:2012 Rule 5.3

2023-08-07 Thread Nicola Vetrini
On 04/08/2023 22:47, Stefano Stabellini wrote: On Fri, 4 Aug 2023, Nicola Vetrini wrote: The extern variable 'irq_desc' defined in 'irq.h' is shadowed by local variables in the changed file. To avoid this, the variable is renamed to 'irq_description'. No functional change. Signed-off-by: Nicol

Re: [XEN PATCH 02/11] x86: move declarations to address MISRA C:2012 Rule 2.1

2023-08-07 Thread Jan Beulich
On 04.08.2023 22:26, Stefano Stabellini wrote: > On Fri, 4 Aug 2023, Jan Beulich wrote: >> On 03.08.2023 16:22, Nicola Vetrini wrote: >>> On 03/08/2023 11:01, Jan Beulich wrote: On 03.08.2023 04:13, Stefano Stabellini wrote: > On Wed, 2 Aug 2023, Nicola Vetrini wrote: >> @@ -1169,8 +11

Re: Address MISRA C:2012 Rule 8.4

2023-08-07 Thread Jan Beulich
On 04.08.2023 16:09, Nicola Vetrini wrote: >>> 3. One possible resolution pattern is including 'acglobal.h' twice >>> (either directly or indirectly trough acpi.h, if >>> the latter does not cause other issues) like so: >>> >>> (assuming DEFINE_ACPI_GLOBALS is undefined here) >>> #inclu

Re: Address MISRA C:2012 Rule 8.4

2023-08-07 Thread Jan Beulich
On 04.08.2023 16:00, Nicola Vetrini wrote: >> >> Upon further examination, I identified the following patterns: >> >> 1. Functions defined in .c called only from asm code (e.g., the >> already mentioned __start_xen) >> 2. Functions/variables declared in a .h, defined in a .c that does not >> includ

Re: [XEN PATCH 1/6] x86: rename variable 'e820' to address MISRA C:2012 Rule 5.3

2023-08-07 Thread Jan Beulich
On 04.08.2023 17:27, Nicola Vetrini wrote: > The variable declared in the header file 'xen/arch/x86/include/asm/e820.h' > is shadowed by many function parameters, so it is renamed to avoid these > violations. > > No functional changes. > > Signed-off-by: Nicola Vetrini > --- > This patch is simi

Re: [XEN PATCH 2/6] libelf: address MISRA C:2012 Rule 5.3

2023-08-07 Thread Jan Beulich
On 04.08.2023 17:27, Nicola Vetrini wrote: > The types u{8,16,32,64} defined in 'xen/arch/x86/include/asm/types.h' > shadow the variables in the modified function, hence violating Rule 5.3. > Therefore, the rename takes care of the shadowing. > > No functional changes. > > Signed-off-by: Nicola V

Re: [XEN PATCH 10/11] xen/sched: add ASSERT_UNREACHABLE() to address MISRA C:2012 Rule 2.1

2023-08-07 Thread Nicola Vetrini
On 03/08/2023 11:17, Jan Beulich wrote: On 02.08.2023 16:38, Nicola Vetrini wrote: --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -2233,6 +2233,7 @@ static bool sched_tasklet_check_cpu(unsigned int cpu) /* fallthrough */ case TASKLET_enqueued|TASKLET_scheduled:

Re: [XEN PATCH 3/6] xen/delay: address MISRA C:2012 Rule 5.3.

2023-08-07 Thread Jan Beulich
On 04.08.2023 17:27, Nicola Vetrini wrote: > --- a/xen/include/xen/delay.h > +++ b/xen/include/xen/delay.h > @@ -5,6 +5,6 @@ > > #include > #define mdelay(n) (\ > - {unsigned long msec=(n); while (msec--) udelay(1000);}) > + {unsigned long msec_=(n); while (msec_--) udelay(1000);}) As

Re: [Xen-devel] [PATCH v2 04/23] x86: Don't use potentially incorrect CPUID values for topology information

2023-08-07 Thread Simon Gaiser
Anthony Liguori: > From: Jan H. Schönherr > > Intel says for CPUID leaf 0Bh: > > "Software must not use EBX[15:0] to enumerate processor >topology of the system. This value in this field >(EBX[15:0]) is only intended for display/diagnostic >purposes. The actual number of logical pr

Re: [XEN PATCH 5/6] x86/xstate: address MISRA C:2012 Rule 5.3

2023-08-07 Thread Jan Beulich
On 04.08.2023 17:27, Nicola Vetrini wrote: > Rename the local variables to avoid clashing with function 'xstate' > defined below, but declared in the corresponding header file. Hmm, there are two functions with such a local variable, but you don't change those. You change "xsave" instead. The new

Re: [XEN PATCH 6/6] x86: refactor macros in 'xen-mca.h' to address MISRA C:2012 Rule 5.3

2023-08-07 Thread Jan Beulich
On 04.08.2023 17:27, Nicola Vetrini wrote: > The macros defined 'xen/include/public/arch-x86/xen-mca.h' have needless > underscore prefixes for parameter names and variable names that cause > shadowing with e.g. the variable 'i' in function 'mce_action'. > Therefore, the renaming aims to resolve pr

Re: [Xen-devel] [PATCH v2 04/23] x86: Don't use potentially incorrect CPUID values for topology information

2023-08-07 Thread Jan Beulich
On 07.08.2023 10:18, Simon Gaiser wrote: > Anthony Liguori: >> From: Jan H. Schönherr >> >> Intel says for CPUID leaf 0Bh: >> >> "Software must not use EBX[15:0] to enumerate processor >>topology of the system. This value in this field >>(EBX[15:0]) is only intended for display/diagnosti

Re: [XEN PATCH] x86: Address violations of MISRA C:2012 and drop bool_t

2023-08-07 Thread Jan Beulich
On 04.08.2023 16:11, Federico Serafini wrote: > Give a name to unnamed parameters to address violations of > MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with > named parameters"). > Keep consistency between object and function declarations thus > addressing violations of MISRA

Re: [XEN PATCH 10/11] xen/sched: add ASSERT_UNREACHABLE() to address MISRA C:2012 Rule 2.1

2023-08-07 Thread Jan Beulich
On 07.08.2023 10:13, Nicola Vetrini wrote: > On 03/08/2023 11:17, Jan Beulich wrote: >> On 02.08.2023 16:38, Nicola Vetrini wrote: >>> --- a/xen/common/sched/core.c >>> +++ b/xen/common/sched/core.c >>> @@ -2233,6 +2233,7 @@ static bool sched_tasklet_check_cpu(unsigned int >>> cpu) >>> /*

Re: [XEN PATCH 1/6] x86: rename variable 'e820' to address MISRA C:2012 Rule 5.3

2023-08-07 Thread Nicola Vetrini
On 07/08/2023 10:09, Jan Beulich wrote: On 04.08.2023 17:27, Nicola Vetrini wrote: The variable declared in the header file 'xen/arch/x86/include/asm/e820.h' is shadowed by many function parameters, so it is renamed to avoid these violations. No functional changes. Signed-off-by: Nicola Vetr

Re: [XEN PATCH 3/6] xen/delay: address MISRA C:2012 Rule 5.3.

2023-08-07 Thread Julien Grall
Hi Jan, On 07/08/2023 09:14, Jan Beulich wrote: On 04.08.2023 17:27, Nicola Vetrini wrote: --- a/xen/include/xen/delay.h +++ b/xen/include/xen/delay.h @@ -5,6 +5,6 @@ #include #define mdelay(n) (\ - {unsigned long msec=(n); while (msec--) udelay(1000);}) + {unsigned long ms

Re: [PATCH v7 2/6] xen/riscv: introduce dummy

2023-08-07 Thread Jan Beulich
On 03.08.2023 14:05, Oleksii Kurochko wrote: > will be used in the patch "xen/riscv: introduce > decode_cause() stuff" and requires While as it stands the description is accurate, I don't think that later patch has a need to include xen/lib.h anymore. xen/macros.h will do, I think. Also please

Re: [XEN PATCH] x86: Address violations of MISRA C:2012 and drop bool_t

2023-08-07 Thread Federico Serafini
On 07/08/23 10:44, Jan Beulich wrote: On 04.08.2023 16:11, Federico Serafini wrote: Give a name to unnamed parameters to address violations of MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with named parameters"). Keep consistency between object and function declarations thus

Re: [XEN PATCH 2/6] libelf: address MISRA C:2012 Rule 5.3

2023-08-07 Thread Nicola Vetrini
On 07/08/2023 10:11, Jan Beulich wrote: On 04.08.2023 17:27, Nicola Vetrini wrote: The types u{8,16,32,64} defined in 'xen/arch/x86/include/asm/types.h' shadow the variables in the modified function, hence violating Rule 5.3. Therefore, the rename takes care of the shadowing. No functional ch

Re: [XEN PATCH 1/6] x86: rename variable 'e820' to address MISRA C:2012 Rule 5.3

2023-08-07 Thread Jan Beulich
On 07.08.2023 10:59, Nicola Vetrini wrote: > On 07/08/2023 10:09, Jan Beulich wrote: >> On 04.08.2023 17:27, Nicola Vetrini wrote: >>> The variable declared in the header file >>> 'xen/arch/x86/include/asm/e820.h' >>> is shadowed by many function parameters, so it is renamed to avoid >>> these >>

Re: [XEN PATCH 3/6] xen/delay: address MISRA C:2012 Rule 5.3.

2023-08-07 Thread Jan Beulich
On 07.08.2023 11:01, Julien Grall wrote: > On 07/08/2023 09:14, Jan Beulich wrote: >> On 04.08.2023 17:27, Nicola Vetrini wrote: >>> --- a/xen/include/xen/delay.h >>> +++ b/xen/include/xen/delay.h >>> @@ -5,6 +5,6 @@ >>> >>> #include >>> #define mdelay(n) (\ >>> - {unsigned long msec=(n);

[BUG] XEN/PV dom0 time management

2023-08-07 Thread Thomas Gleixner
Hi! Something in XEN/PV time management seems to be seriously broken: timekeeping watchdog on CPU9: Marking clocksource 'tsc' as unstable because the skew is too large: [ 152.557154] clocksource: 'xen' wd_nsec: 511979417 wd_now: 24e4d7625e wd_last: 24c65332c5 mask: ff

Re: [XEN PATCH 5/6] x86/xstate: address MISRA C:2012 Rule 5.3

2023-08-07 Thread Nicola Vetrini
On 07/08/2023 10:23, Jan Beulich wrote: On 04.08.2023 17:27, Nicola Vetrini wrote: Rename the local variables to avoid clashing with function 'xstate' defined below, but declared in the corresponding header file. Hmm, there are two functions with such a local variable, but you don't change tho

[XEN PATCH] x86/mce: Address violations of MISRA C:2012 Rules 8.2 and 8.3

2023-08-07 Thread Federico Serafini
Give a name to unnamed parameters to address violations of MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with named parameters"). Keep consistency between parameter types used in function declarations and the ones used in the corresponding function definitions, thus addressing v

Re: [XEN PATCH 3/6] xen/delay: address MISRA C:2012 Rule 5.3.

2023-08-07 Thread Nicola Vetrini
On 07/08/2023 11:15, Jan Beulich wrote: On 07.08.2023 11:01, Julien Grall wrote: On 07/08/2023 09:14, Jan Beulich wrote: On 04.08.2023 17:27, Nicola Vetrini wrote: --- a/xen/include/xen/delay.h +++ b/xen/include/xen/delay.h @@ -5,6 +5,6 @@ #include #define mdelay(n) (\ - {unsigned

Re: [XEN PATCH 3/6] xen/delay: address MISRA C:2012 Rule 5.3.

2023-08-07 Thread Jan Beulich
On 07.08.2023 11:23, Nicola Vetrini wrote: > On 07/08/2023 11:15, Jan Beulich wrote: >> On 07.08.2023 11:01, Julien Grall wrote: >>> On 07/08/2023 09:14, Jan Beulich wrote: On 04.08.2023 17:27, Nicola Vetrini wrote: > --- a/xen/include/xen/delay.h > +++ b/xen/include/xen/delay.h >

Re: [XEN PATCH 3/6] xen/delay: address MISRA C:2012 Rule 5.3.

2023-08-07 Thread Julien Grall
On 07/08/2023 10:32, Jan Beulich wrote: On 07.08.2023 11:23, Nicola Vetrini wrote: On 07/08/2023 11:15, Jan Beulich wrote: On 07.08.2023 11:01, Julien Grall wrote: On 07/08/2023 09:14, Jan Beulich wrote: On 04.08.2023 17:27, Nicola Vetrini wrote: --- a/xen/include/xen/delay.h +++ b/xen/in

Re: [XEN PATCH] x86/mce: Address violations of MISRA C:2012 Rules 8.2 and 8.3

2023-08-07 Thread Jan Beulich
On 07.08.2023 11:23, Federico Serafini wrote: > Give a name to unnamed parameters to address violations of > MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with > named parameters"). > Keep consistency between parameter types used in function > declarations and the ones used in t

[XEN PATCH] x86/ACPI: Ignore entries with invalid APIC IDs when parsing MADT

2023-08-07 Thread Simon Gaiser
It seems some firmwares put dummy entries in the ACPI MADT table for non existing processors. On my NUC11TNHi5 those have the invalid APIC ID 0xff. Linux already has code to handle those cases both in acpi_parse_lapic [1] as well as in acpi_parse_x2apic [2]. So add the same check to Xen. Note that

Re: [XEN PATCH v2] x86/hpet: Disable legacy replacement mode after IRQ test

2023-08-07 Thread Simon Gaiser
Jan Beulich: > On 31.07.2023 12:32, Simon Gaiser wrote: >> --- a/xen/arch/x86/io_apic.c >> +++ b/xen/arch/x86/io_apic.c >> @@ -1967,6 +1967,8 @@ static void __init check_timer(void) >> >> if ( timer_irq_works() ) >> { >> +printk(XENLOG_INFO "IRQ test with

Re: [XEN PATCH v2] x86/hpet: Disable legacy replacement mode after IRQ test

2023-08-07 Thread Jan Beulich
On 07.08.2023 11:47, Simon Gaiser wrote: > Jan Beulich: >> On 31.07.2023 12:32, Simon Gaiser wrote: >>> --- a/xen/arch/x86/io_apic.c >>> +++ b/xen/arch/x86/io_apic.c >>> @@ -1967,6 +1967,8 @@ static void __init check_timer(void) >>> >>> if ( timer_irq_works() ) >>> { >>>

Re: [Xen-devel] [PATCH v2 04/23] x86: Don't use potentially incorrect CPUID values for topology information

2023-08-07 Thread Simon Gaiser
Jan Beulich: > On 07.08.2023 10:18, Simon Gaiser wrote: >> Anthony Liguori: >>> From: Jan H. Schönherr >>> >>> Intel says for CPUID leaf 0Bh: >>> >>> "Software must not use EBX[15:0] to enumerate processor >>>topology of the system. This value in this field >>>(EBX[15:0]) is only intende

Re: [XEN PATCH 6/6] x86: refactor macros in 'xen-mca.h' to address MISRA C:2012 Rule 5.3

2023-08-07 Thread Nicola Vetrini
On 07/08/2023 10:31, Jan Beulich wrote: On 04.08.2023 17:27, Nicola Vetrini wrote: The macros defined 'xen/include/public/arch-x86/xen-mca.h' have needless underscore prefixes for parameter names and variable names that cause shadowing with e.g. the variable 'i' in function 'mce_action'. Theref

Re: [XEN PATCH] x86/ACPI: Ignore entries with invalid APIC IDs when parsing MADT

2023-08-07 Thread Andrew Cooper
On 07/08/2023 10:38 am, Simon Gaiser wrote: > It seems some firmwares put dummy entries in the ACPI MADT table for non > existing processors. On my NUC11TNHi5 those have the invalid APIC ID > 0xff. Linux already has code to handle those cases both in > acpi_parse_lapic [1] as well as in acpi_parse_

Re: [Xen-devel] [PATCH v2 04/23] x86: Don't use potentially incorrect CPUID values for topology information

2023-08-07 Thread Jan Beulich
On 07.08.2023 11:58, Simon Gaiser wrote: > Jan Beulich: >> On 07.08.2023 10:18, Simon Gaiser wrote: >>> Anthony Liguori: From: Jan H. Schönherr Intel says for CPUID leaf 0Bh: "Software must not use EBX[15:0] to enumerate processor topology of the system. This val

Re: [XEN PATCH] x86/ACPI: Ignore entries with invalid APIC IDs when parsing MADT

2023-08-07 Thread Andrew Cooper
On 07/08/2023 11:01 am, Andrew Cooper wrote: > On 07/08/2023 10:38 am, Simon Gaiser wrote: >> It seems some firmwares put dummy entries in the ACPI MADT table for non >> existing processors. On my NUC11TNHi5 those have the invalid APIC ID >> 0xff. Linux already has code to handle those cases both i

Re: [Xen-devel] [PATCH v2 04/23] x86: Don't use potentially incorrect CPUID values for topology information

2023-08-07 Thread Andrew Cooper
On 07/08/2023 9:18 am, Simon Gaiser wrote: > Anthony Liguori: >> From: Jan H. Schönherr >> >> Intel says for CPUID leaf 0Bh: >> >> "Software must not use EBX[15:0] to enumerate processor >>topology of the system. This value in this field >>(EBX[15:0]) is only intended for display/diagnos

Re: [XEN PATCH] x86/ACPI: Ignore entries with invalid APIC IDs when parsing MADT

2023-08-07 Thread Jan Beulich
On 07.08.2023 11:38, Simon Gaiser wrote: > It seems some firmwares put dummy entries in the ACPI MADT table for non > existing processors. On my NUC11TNHi5 those have the invalid APIC ID > 0xff. Linux already has code to handle those cases both in > acpi_parse_lapic [1] as well as in acpi_parse_x2a

[qemu-mainline test] 182208: tolerable FAIL - PUSHED

2023-08-07 Thread osstest service owner
flight 182208 qemu-mainline real [real] flight 182211 qemu-mainline real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/182208/ http://logs.test-lab.xenproject.org/osstest/logs/182211/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-am

Re: [XEN PATCH] x86/ACPI: Ignore entries with invalid APIC IDs when parsing MADT

2023-08-07 Thread Simon Gaiser
Andrew Cooper: > On 07/08/2023 11:01 am, Andrew Cooper wrote: >> On 07/08/2023 10:38 am, Simon Gaiser wrote: >>> It seems some firmwares put dummy entries in the ACPI MADT table for non >>> existing processors. On my NUC11TNHi5 those have the invalid APIC ID >>> 0xff. Linux already has code to hand

Re: Address MISRA C:2012 Rule 8.4

2023-08-07 Thread Nicola Vetrini
One further question is whether functions under 'xen/common/coverage/gcov_base.c' should gain a declaration in 'gcov.h' or not, as they exist just for the purpose of being referenced by autogenerated profiling code. I see no reason why they shouldn't, but they can also be safely deviated, sinc

[PATCH v4 00/48] use refcount+RCU method to implement lockless slab shrink

2023-08-07 Thread Qi Zheng
fs (9) failed: 0 skipped: 0 successful run completed in 60.01s (1 min, 0.01 secs) We can see that the ops/s has hardly changed. This series is based on next-20230807. Comments and suggestions are welcome. Thanks, Qi Changelog in v3 -> v4: - [PATCH v3 01/49] has been merged, so discard it. - fix

[PATCH v4 01/48] mm: move some shrinker-related function declarations to mm/internal.h

2023-08-07 Thread Qi Zheng
The following functions are only used inside the mm subsystem, so it's better to move their declarations to the mm/internal.h file. 1. shrinker_debugfs_add() 2. shrinker_debugfs_detach() 3. shrinker_debugfs_remove() Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 19 ---

[PATCH v4 02/48] mm: vmscan: move shrinker-related code into a separate file

2023-08-07 Thread Qi Zheng
The mm/vmscan.c file is too large, so separate the shrinker-related code from it into a separate file. No functional changes. Signed-off-by: Qi Zheng --- mm/Makefile | 4 +- mm/internal.h | 2 + mm/shrinker.c | 709 ++ mm/vmscan.c | 701 ---

[PATCH v4 03/48] mm: shrinker: remove redundant shrinker_rwsem in debugfs operations

2023-08-07 Thread Qi Zheng
The debugfs_remove_recursive() will wait for debugfs_file_put() to return, so the shrinker will not be freed when doing debugfs operations (such as shrinker_debugfs_count_show() and shrinker_debugfs_scan_write()), so there is no need to hold shrinker_rwsem during debugfs operations. Signed-off-by:

[PATCH v4 04/48] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-08-07 Thread Qi Zheng
Currently, the shrinker instances can be divided into the following three types: a) global shrinker instance statically defined in the kernel, such as workingset_shadow_shrinker. b) global shrinker instance statically defined in the kernel modules, such as mmu_shrinker in x86. c) shrinker

[PATCH v4 05/48] kvm: mmu: dynamically allocate the x86-mmu shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the x86-mmu shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- arch/x86/kvm/mmu/mmu.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 9e4cd8b4a202..0386

[PATCH v4 06/48] binder: dynamically allocate the android-binder shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the android-binder shrinker. Signed-off-by: Qi Zheng --- drivers/android/binder_alloc.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index

[PATCH v4 20/48] mm: thp: dynamically allocate the thp-related shrinkers

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the thp-zero and thp-deferred_split shrinkers. Signed-off-by: Qi Zheng --- mm/huge_memory.c | 69 +++- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 947001

[PATCH v4 21/48] sunrpc: dynamically allocate the sunrpc_cred shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the sunrpc_cred shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- net/sunrpc/auth.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 2f16f9d17966..0cc52e39f859

[PATCH v4 22/48] mm: workingset: dynamically allocate the mm-shadow shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the mm-shadow shrinker. Signed-off-by: Qi Zheng --- mm/workingset.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mm/workingset.c b/mm/workingset.c index da58a26d0d4d..3c53138903a7 100644 --- a/mm/workingset

[PATCH v4 23/48] drm/i915: dynamically allocate the i915_gem_mm shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the i915_gem_mm shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct drm_i915_private. Signed-off-by:

[PATCH v4 24/48] drm/msm: dynamically allocate the drm-msm_gem shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the drm-msm_gem shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct msm_drm_private. Signed-off-by: Q

[PATCH v4 25/48] drm/panfrost: dynamically allocate the drm-panfrost shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the drm-panfrost shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct panfrost_device. Signed-off-by:

[PATCH v4 26/48] dm: dynamically allocate the dm-bufio shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the dm-bufio shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dm_bufio_client. Signed-off-by: Qi Z

[PATCH v4 27/48] dm zoned: dynamically allocate the dm-zoned-meta shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the dm-zoned-meta shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct dmz_metadata. Signed-off-by: Qi

[PATCH v4 32/48] mbcache: dynamically allocate the mbcache shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the mbcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct mb_cache. Signed-off-by: Qi Zheng Re

[PATCH v4 29/48] bcache: dynamically allocate the md-bcache shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the md-bcache shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct cache_set. Signed-off-by: Qi Zheng

[PATCH v4 34/48] jbd2,ext4: dynamically allocate the jbd2-journal shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the jbd2-journal shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct journal_s. Signed-off-by: Qi Zhe

[PATCH v4 13/48] NFSv4.2: dynamically allocate the nfs-xattr shrinkers

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the nfs-xattr shrinkers. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/nfs/nfs42xattr.c | 87 +++-- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c in

[PATCH v4 18/48] rcu: dynamically allocate the rcu-lazy shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the rcu-lazy shrinker. Signed-off-by: Qi Zheng --- kernel/rcu/tree_nocb.h | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h index 5598212d1f27..e1c59c33738a 100644 --- a/k

[PATCH v4 08/48] xenbus/backend: dynamically allocate the xen-backend shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the xen-backend shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- drivers/xen/xenbus/xenbus_probe_backend.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/driv

[PATCH v4 19/48] rcu: dynamically allocate the rcu-kfree shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the rcu-kfree shrinker. Signed-off-by: Qi Zheng --- kernel/rcu/tree.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 7c79480bfaa0..3b20fc46c514 100644 --- a/kernel/rcu/tr

[PATCH v4 14/48] nfs: dynamically allocate the nfs-acl shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the nfs-acl shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/nfs/super.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 2284f749d892..1b5cd0444dda 100644 ---

[PATCH v4 17/48] ubifs: dynamically allocate the ubifs-slab shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the ubifs-slab shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/ubifs/super.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index b08fb28d16b5..c690782388a8 1

[PATCH v4 30/48] vmw_balloon: dynamically allocate the vmw-balloon shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the vmw-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct vmballoon. And we can simply exit

[PATCH v4 28/48] md/raid5: dynamically allocate the md-raid5 shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the md-raid5 shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct r5conf. Signed-off-by: Qi Zheng Rev

[PATCH v4 33/48] ext4: dynamically allocate the ext4-es shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the ext4-es shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct ext4_sb_info. Signed-off-by: Qi Zheng

Re: [XEN PATCH 1/6] x86: rename variable 'e820' to address MISRA C:2012 Rule 5.3

2023-08-07 Thread Nicola Vetrini
Besides the one you listed, there are these other occurrences: - xen/arch/x86/mm.c:4678 in 'arch_memory_op' as local variable 'struct e820entry' This probably wants renaming; my suggestion would be just "e" here. Ok - xen/arch/x86/include/asm/guest/hypervisor.h:55 in 'hypervisor_e820_fi

[PATCH v4 31/48] virtio_balloon: dynamically allocate the virtio-balloon shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the virtio-balloon shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct virtio_balloon. Signed-off-by:

[PATCH v4 10/48] f2fs: dynamically allocate the f2fs-shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the f2fs-shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/f2fs/super.c | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index aa1f9a3a8037..9092310582aa 1

[PATCH v4 07/48] drm/ttm: dynamically allocate the drm-ttm_pool shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the drm-ttm_pool shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- drivers/gpu/drm/ttm/ttm_pool.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/t

[PATCH v4 09/48] erofs: dynamically allocate the erofs-shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the erofs-shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/erofs/utils.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/fs/erofs/utils.c b/fs/erofs/utils.c index cc6fb9e98899..6e1a828e6ca3 100644 --

[PATCH v4 12/48] gfs2: dynamically allocate the gfs2-qd shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the gfs2-qd shrinker. Signed-off-by: Qi Zheng --- fs/gfs2/main.c | 6 +++--- fs/gfs2/quota.c | 26 -- fs/gfs2/quota.h | 3 ++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index af

[PATCH v4 15/48] nfsd: dynamically allocate the nfsd-filecache shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the nfsd-filecache shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/nfsd/filecache.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index ee9c923192e0..

[PATCH v4 16/48] quota: dynamically allocate the dquota-cache shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the dquota-cache shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/quota/dquot.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 9e72bfe8bbad..c303cffdf433 1006

[PATCH v4 11/48] gfs2: dynamically allocate the gfs2-glock shrinker

2023-08-07 Thread Qi Zheng
Use new APIs to dynamically allocate the gfs2-glock shrinker. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- fs/gfs2/glock.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 1438e7465e30..8d582ba7514f 100644

[PATCH v4 38/48] xfs: dynamically allocate the xfs-inodegc shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the xfs-inodegc shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_mount. Signed-off-by: Qi Zhen

[PATCH v4 48/48] mm: shrinker: convert shrinker_rwsem to mutex

2023-08-07 Thread Qi Zheng
Now there are no readers of shrinker_rwsem, so we can simply replace it with mutex lock. Signed-off-by: Qi Zheng --- drivers/md/dm-cache-metadata.c | 2 +- fs/super.c | 2 +- mm/shrinker.c | 28 ++-- mm/shrinker_debug.c|

Re: [PATCH v4 01/13] xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm

2023-08-07 Thread Ayan Kumar Halder
Hi Henry, On 01/08/2023 04:44, Henry Wang wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. From: Wei Chen At the moment, on MMU system, enable_mmu() will return

[PATCH v4 37/48] xfs: dynamically allocate the xfs-buf shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the xfs-buf shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_buftarg. Signed-off-by: Qi Zheng

[PATCH v4 45/48] mm: shrinker: make global slab shrink lockless

2023-08-07 Thread Qi Zheng
The shrinker_rwsem is a global read-write lock in shrinkers subsystem, which protects most operations such as slab shrink, registration and unregistration of shrinkers, etc. This can easily cause problems in the following cases. 1) When the memory pressure is high and there are many filesystems

[PATCH v4 43/48] drm/ttm: introduce pool_shrink_rwsem

2023-08-07 Thread Qi Zheng
Currently, the synchronize_shrinkers() is only used by TTM pool. It only requires that no shrinkers run in parallel. After we use RCU+refcount method to implement the lockless slab shrink, we can not use shrinker_rwsem or synchronize_rcu() to guarantee that all shrinker invocations have seen an up

[PATCH v4 39/48] xfs: dynamically allocate the xfs-qm shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the xfs-qm shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_quotainfo. Signed-off-by: Qi Zheng

[PATCH v4 42/48] mm: shrinker: remove old APIs

2023-08-07 Thread Qi Zheng
Now no users are using the old APIs, just remove them. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- include/linux/shrinker.h | 7 -- mm/shrinker.c| 143 --- 2 files changed, 150 deletions(-) diff --git a/include/linux/shrinker.h b/inclu

[PATCH v4 46/48] mm: shrinker: make memcg slab shrink lockless

2023-08-07 Thread Qi Zheng
Like global slab shrink, this commit also uses refcount+RCU method to make memcg slab shrink lockless. Use the following script to do slab shrink stress test: ``` DIR="/root/shrinker/memcg/mnt" do_create() { mkdir -p /sys/fs/cgroup/memory/test echo 4G > /sys/fs/cgroup/memory/test/memory

[PATCH v4 35/48] nfsd: dynamically allocate the nfsd-client shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the nfsd-client shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct nfsd_net. Signed-off-by: Qi Zheng

[PATCH v4 47/48] mm: shrinker: hold write lock to reparent shrinker nr_deferred

2023-08-07 Thread Qi Zheng
For now, reparent_shrinker_deferred() is the only holder of read lock of shrinker_rwsem. And it already holds the global cgroup_mutex, so it will not be called in parallel. Therefore, in order to convert shrinker_rwsem to shrinker_mutex later, here we change to hold the write lock of shrinker_rwse

[PATCH v4 41/48] fs: super: dynamically allocate the s_shrink

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the s_shrink, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct super_block. Signed-off-by: Qi Zheng Reviewe

[PATCH v4 44/48] mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}

2023-08-07 Thread Qi Zheng
Currently, we maintain two linear arrays per node per memcg, which are shrinker_info::map and shrinker_info::nr_deferred. And we need to resize them when the shrinker_nr_max is exceeded, that is, allocate a new array, and then copy the old array to the new array, and finally free the old array by R

[PATCH v4 36/48] nfsd: dynamically allocate the nfsd-reply shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the nfsd-reply shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct nfsd_net. Signed-off-by: Qi Zheng

[PATCH v4 40/48] zsmalloc: dynamically allocate the mm-zspool shrinker

2023-08-07 Thread Qi Zheng
In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the mm-zspool shrinker, so that it can be freed asynchronously using kfree_rcu(). Then it doesn't need to wait for RCU read-side critical section when releasing the struct zs_pool. Signed-off-by: Qi Zheng R

[XEN PATCH v3] x86/hpet: Disable legacy replacement mode after IRQ test

2023-08-07 Thread Simon Gaiser
As far as I understand the HPET legacy mode is not required after the timer IRQ test. For previous discussion see [1] and [2]. Keeping it enabled prevents reaching deeper C-states on some systems and thereby also S0ix residency. So disable it after the timer IRQ test worked. Note that this code pat

RE: [PATCH v4 01/13] xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm

2023-08-07 Thread Henry Wang
Hi Ayan, > -Original Message- > Hi Henry, > > > At the moment, on MMU system, enable_mmu() will return to an > > address in the 1:1 mapping, then each path is responsible to > > switch to virtual runtime mapping. Then remove_identity_mapping() > > is called on the boot CPU to remove all

Re: [PATCH v4 01/13] xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm

2023-08-07 Thread Ayan Kumar Halder
On 07/08/2023 12:35, Henry Wang wrote: Hi Ayan, -Original Message- Hi Henry, At the moment, on MMU system, enable_mmu() will return to an address in the 1:1 mapping, then each path is responsible to switch to virtual runtime mapping. Then remove_identity_mapping() is called on the b

Re: [PATCH v4 01/13] xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm

2023-08-07 Thread Julien Grall
On 07/08/2023 12:35, Henry Wang wrote: Hi Ayan, Hi Henry, -Original Message- Hi Henry, At the moment, on MMU system, enable_mmu() will return to an address in the 1:1 mapping, then each path is responsible to switch to virtual runtime mapping. Then remove_identity_mapping() is ca

Re: [PATCH v4 01/13] xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm

2023-08-07 Thread Julien Grall
On 07/08/2023 12:43, Ayan Kumar Halder wrote: On 07/08/2023 12:35, Henry Wang wrote: Hi Ayan, -Original Message- Hi Henry, At the moment, on MMU system, enable_mmu() will return to an address in the 1:1 mapping, then each path is responsible to switch to virtual runtime mapping.

RE: [PATCH v4 01/13] xen/arm64: head.S: Introduce enable_{boot,secondary}_cpu_mm

2023-08-07 Thread Henry Wang
Hi Julien, > -Original Message- > Subject: Re: [PATCH v4 01/13] xen/arm64: head.S: Introduce > enable_{boot,secondary}_cpu_mm > >> prefer "enable_boot_cpu_mmu" as it is MMU specific as well. > > > > ...this, are the name suggested by Julien in [1], so probably I will stick > > to these nam

  1   2   3   >