Re: [PATCH 1/1] genirq/cpuhotplug: retry with online CPUs on irq_do_set_affinity failure

2024-04-22 Thread Thomas Gleixner
On Mon, Apr 22 2024 at 16:09, Dongli Zhang wrote: > On 4/22/24 13:58, Thomas Gleixner wrote: >> On Thu, Apr 18 2024 at 18:33, Dongli Zhang wrote: > Would you mind suggesting if the below commit message is fine to you? > > > genirq/cpuhotplug: retry with cpu_online_mask whe

Re: [PATCH 1/1] genirq/cpuhotplug: retry with online CPUs on irq_do_set_affinity failure

2024-04-22 Thread Thomas Gleixner
On Thu, Apr 18 2024 at 18:33, Dongli Zhang wrote: > When a CPU is offline, its IRQs may migrate to other CPUs. For managed > IRQs, they are migrated, or shutdown (if all CPUs of the managed IRQ > affinity are offline). For regular IRQs, there will only be a > migration. Please write out

Re: [PATCH V7 03/18] x86/pks: Add additional PKEY helper macros

2021-12-08 Thread Thomas Gleixner
Ira, On Tue, Dec 07 2021 at 16:51, Ira Weiny wrote: > On Thu, Nov 25, 2021 at 03:25:09PM +0100, Thomas Gleixner wrote: > > u32 pkey_update_pkval(u32 pkval, int pkey, u32 accessbits) > { > - int shift = pkey * PKR_BITS_PER_PKEY; > + int shift = P

Re: [PATCH V7 08/18] x86/entry: Preserve PKRS MSR across exceptions

2021-12-07 Thread Thomas Gleixner
Ira, On Mon, Dec 06 2021 at 17:54, Ira Weiny wrote: > On Thu, Nov 25, 2021 at 03:12:47PM +0100, Thomas Gleixner wrote: >> > +.macro __call_ext_ptregs cfunc annotate_retpoline_safe:req >> > +#ifdef CONFIG_ARCH_ENABLE_SUPERVISOR_PKEYS >> > + /* add space for ex

Re: [PATCH V7 05/18] x86/pks: Add PKS setup code

2021-11-26 Thread Thomas Gleixner
On Thu, Nov 25 2021 at 16:15, Thomas Gleixner wrote: > On Tue, Aug 03 2021 at 21:32, ira weiny wrote: > Aside of that, the function which set's up the init value is really > bogus. As you explained in the cover letter a kernel user has to: > >1) Claim an index in the enum >

Re: [PATCH V7 05/18] x86/pks: Add PKS setup code

2021-11-26 Thread Thomas Gleixner
On Fri, Nov 26 2021 at 11:11, taoyi ty wrote: > On 11/25/21 11:15 PM, Thomas Gleixner wrote: >>> +void setup_pks(void) >>> +{ >>> + if (!cpu_feature_enabled(X86_FEATURE_PKS)) >>> + return; >>> + >>> + write_pkrs(pkrs_init_value

Re: [PATCH V7 03/18] x86/pks: Add additional PKEY helper macros

2021-11-25 Thread Thomas Gleixner
On Thu, Nov 25 2021 at 15:25, Thomas Gleixner wrote: > On Tue, Aug 03 2021 at 21:32, ira weiny wrote: >> @@ -200,16 +200,14 @@ __setup("init_pkru=", setup_init_pkru); >> */ >> u32 update_pkey_val(u32 pk_reg, int pkey, unsigned int flags) >> { >> -

Re: [PATCH V7 07/18] x86/pks: Preserve the PKRS MSR on context switch

2021-11-25 Thread Thomas Gleixner
On Tue, Aug 03 2021 at 21:32, ira weiny wrote: > @@ -658,6 +659,8 @@ __switch_to(struct task_struct *prev_p, struct > task_struct *next_p) > /* Load the Intel cache allocation PQR MSR. */ > resctrl_sched_in(); > > + pkrs_write_current(); This is invoked from switch_to() and

Re: [PATCH V7 05/18] x86/pks: Add PKS setup code

2021-11-25 Thread Thomas Gleixner
On Tue, Aug 03 2021 at 21:32, ira weiny wrote: > +#ifdef CONFIG_ARCH_ENABLE_SUPERVISOR_PKEYS > + > +void setup_pks(void); pks_setup() > +#ifdef CONFIG_ARCH_ENABLE_SUPERVISOR_PKEYS > + > +static DEFINE_PER_CPU(u32, pkrs_cache); > +u32 __read_mostly pkrs_init_value; > + > +/* > + * write_pkrs()

Re: [PATCH V7 03/18] x86/pks: Add additional PKEY helper macros

2021-11-25 Thread Thomas Gleixner
On Tue, Aug 03 2021 at 21:32, ira weiny wrote: > @@ -200,16 +200,14 @@ __setup("init_pkru=", setup_init_pkru); > */ > u32 update_pkey_val(u32 pk_reg, int pkey, unsigned int flags) > { > - int pkey_shift = pkey * PKR_BITS_PER_PKEY; > - > /* Mask out old bit values */ > - pk_reg

Re: [PATCH V7 02/18] x86/fpu: Refactor arch_set_user_pkey_access()

2021-11-25 Thread Thomas Gleixner
On Tue, Aug 03 2021 at 21:32, ira weiny wrote: > +/* > + * Replace disable bits for @pkey with values from @flags > + * > + * Kernel users use the same flags as user space: > + * PKEY_DISABLE_ACCESS > + * PKEY_DISABLE_WRITE > + */ > +u32 update_pkey_val(u32 pk_reg, int pkey, unsigned int

Re: [PATCH V7 08/18] x86/entry: Preserve PKRS MSR across exceptions

2021-11-25 Thread Thomas Gleixner
Ira, On Tue, Aug 03 2021 at 21:32, ira weiny wrote: > +/* > + * __call_ext_ptregs - Helper macro to call into C with extended pt_regs > + * @cfunc: C function to be called > + * > + * This will ensure that extended_ptregs is added and removed as needed > during > + * a call into C

Re: [PATCH V7 08/18] x86/entry: Preserve PKRS MSR across exceptions

2021-11-25 Thread Thomas Gleixner
On Fri, Nov 12 2021 at 16:50, Ira Weiny wrote: > On Tue, Aug 03, 2021 at 09:32:21PM -0700, 'Ira Weiny' wrote: >> From: Ira Weiny >> >> The PKRS MSR is not managed by XSAVE. It is preserved through a context >> switch but this support leaves exception handling code open to memory >> accesses

Re: [signal] 4bad58ebc8: will-it-scale.per_thread_ops -3.3% regression

2021-04-20 Thread Thomas Gleixner
On Tue, Apr 20 2021 at 11:08, kernel test robot wrote: > FYI, we noticed a -3.3% regression of will-it-scale.per_thread_ops due to > commit: > > commit: 4bad58ebc8bc4f20d89cff95417c9b4674769709 ("signal: Allow tasks to > cache one sigqueue struct") >

Re: [PATCH] hrtimer: Update softirq_expires_next correctly after __hrtimer_get_next_event()

2021-04-20 Thread Thomas Gleixner
On Tue, Apr 20 2021 at 17:15, Lorenzo Colitti wrote: > On Fri, Apr 16, 2021 at 1:47 AM Thomas Gleixner wrote: >> Enable tracing and enable the following tracepoints: >> [...] > > Sorry for the delay. I had to learn a bit about how to use the tracing > infrastructure. I

Re: [PATCH] hrtimer: Update softirq_expires_next correctly after __hrtimer_get_next_event()

2021-04-20 Thread Thomas Gleixner
On Mon, Apr 19 2021 at 20:12, Maciej Żenczykowski wrote: > On Thu, Apr 15, 2021 at 9:47 AM Thomas Gleixner wrote: >> Run the test on a kernels with and without that commit and collect trace >> data for both. >> >> That should give me a pretty clear picture what's goin

Re: [PATCH v6] hrtimer: avoid retrigger_next_event IPI

2021-04-19 Thread Thomas Gleixner
On Mon, Apr 19 2021 at 16:39, Marcelo Tosatti wrote: > > +static void clock_was_set_force_reprogram_work(struct work_struct *work) > +{ > + clock_was_set(true); > +} > + > +static DECLARE_WORK(hrtimer_force_reprogram_work, > clock_was_set_force_reprogram_work); > + > + > static void

Re: [syzbot] WARNING in kthread_is_per_cpu

2021-04-19 Thread Thomas Gleixner
On Mon, Apr 19 2021 at 03:36, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:1216f02e Add linux-next specific files for 20210415 > git tree: linux-next > console output: https://syzkaller.appspot.com/x/log.txt?x=1032ba29d0 > kernel config:

Re: [PATCH] genirq/irqaction: Move dev_id and percpu_dev_id in a union

2021-04-18 Thread Thomas Gleixner
On Sat, Apr 10 2021 at 13:00, Marc Zyngier wrote: > dev_id and percpu_dev_id are mutually exclusive in struct irqaction, > as they conceptually represent the same thing, only in a per-cpu > fashion. > > Move them into an anonymous union, saving a few bytes on the way. The reason why they are not

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-18 Thread Thomas Gleixner
On Sat, Apr 17 2021 at 17:11, Andy Lutomirski wrote: > On Sat, Apr 17, 2021 at 4:53 PM Thomas Gleixner wrote: >> which works for >> >> foo = function_nocfi(bar); > > I agree in general. But right now, we have, in asm/proto.h: > > void entry_SYSCALL_64(vo

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-17 Thread Thomas Gleixner
On Sat, Apr 17 2021 at 16:19, Andy Lutomirski wrote: > On Fri, Apr 16, 2021 at 4:40 PM Kees Cook wrote: >> Okay, you're saying you want __builtin_gimme_body_p() to be a constant >> expression for the compiler, not inline asm? > > Yes. > > I admit that, in the trivial case where the asm code is

Re: [PATCH v8 clocksource 2/5] clocksource: Retry clock read if long delays detected

2021-04-17 Thread Thomas Gleixner
On Sat, Apr 17 2021 at 15:54, Paul E. McKenney wrote: > On Sat, Apr 17, 2021 at 02:24:23PM +0200, Thomas Gleixner wrote: >> I so wish we could just delete all of this horror instead of making it >> more horrible. > > Revisit deleting it in five years if there are no issu

Re: [PATCH] Fix set apic mode from x2apic enabled bit patch

2021-04-17 Thread Thomas Gleixner
Mike! On Sun, Apr 18 2021 at 00:39, Thomas Gleixner wrote: > If you can't come up with something sensible anytime soon before the > merge window opens then I'm simply going to revert 41e2da9b5e67 and you > can try again for the next cycle. so I just figured out that Boris wasted his

Re: [PATCH] Fix set apic mode from x2apic enabled bit patch

2021-04-17 Thread Thomas Gleixner
Mike! On Thu, Apr 15 2021 at 17:06, Mike Travis wrote: I'm slowly getting tired of the fact that every patch coming from you fails to comply with the minimal requirements of the documented procedures. $subject: [PATCH] Fix set apic mode from x2apic enabled bit patch Documentation clearly

Re: [PATCH v5] hrtimer: avoid retrigger_next_event IPI

2021-04-17 Thread Thomas Gleixner
On Sat, Apr 17 2021 at 18:24, Thomas Gleixner wrote: > On Fri, Apr 16 2021 at 13:13, Peter Xu wrote: >> On Fri, Apr 16, 2021 at 01:00:23PM -0300, Marcelo Tosatti wrote: >>> >>> +#define CLOCK_SET_BASES ((1U << HRTIMER_BASE_REALTIME) |

Re: [PATCH v5] hrtimer: avoid retrigger_next_event IPI

2021-04-17 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 13:13, Peter Xu wrote: > On Fri, Apr 16, 2021 at 01:00:23PM -0300, Marcelo Tosatti wrote: >> >> +#define CLOCK_SET_BASES ((1U << HRTIMER_BASE_REALTIME) |\ >> + (1U << HRTIMER_BASE_REALTIME_SOFT) | \ >> + (1U <<

Re: [PATCH v8 clocksource 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-04-17 Thread Thomas Gleixner
On Tue, Apr 13 2021 at 21:36, Paul E. McKenney wrote: Bah, hit send too quick. > + cpumask_clear(_ahead); > + cpumask_clear(_behind); > + preempt_disable(); Daft. > + testcpu = smp_processor_id(); > + pr_warn("Checking clocksource %s synchronization from CPU %d.\n", >

Re: [PATCH v8 clocksource 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-04-17 Thread Thomas Gleixner
On Tue, Apr 13 2021 at 21:36, Paul E. McKenney wrote: > diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c > index 1fc0962c89c0..97eeaf164296 100644 > --- a/arch/x86/kernel/kvmclock.c > +++ b/arch/x86/kernel/kvmclock.c > @@ -169,7 +169,7 @@ struct clocksource kvm_clock = { >

Re: [PATCH v8 clocksource 2/5] clocksource: Retry clock read if long delays detected

2021-04-17 Thread Thomas Gleixner
On Tue, Apr 13 2021 at 21:35, Paul E. McKenney wrote: > #define WATCHDOG_INTERVAL (HZ >> 1) > #define WATCHDOG_THRESHOLD (NSEC_PER_SEC >> 4) > +#define WATCHDOG_MAX_SKEW (NSEC_PER_SEC >> 6) That's ~15ms which is a tad large I'd say... > static void clocksource_watchdog_work(struct

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-17 Thread Thomas Gleixner
On Sat, Apr 17 2021 at 01:02, Thomas Gleixner wrote: > On Fri, Apr 16 2021 at 15:37, Kees Cook wrote: > >> On Fri, Apr 16, 2021 at 03:20:17PM -0700, Andy Lutomirski wrote: >>> But obviously there is code that needs real function pointers. How >>> about mak

Re: [PATCH 04/15] static_call: Use global functions for the self-test

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 23:37, Thomas Gleixner wrote: > On Fri, Apr 16 2021 at 13:38, Sami Tolvanen wrote: >> #ifdef CONFIG_STATIC_CALL_SELFTEST >> >> -static int func_a(int x) >> +int func_a(int x) >> { >> return x+1; >> } >>

Re: [PATCH 06/15] x86: Avoid CFI jump tables in IDT and entry points

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 16:56, Kees Cook wrote: > On Sat, Apr 17, 2021 at 12:26:56AM +0200, Thomas Gleixner wrote: >> Where is the analysis why excluding >> >> > +CFLAGS_REMOVE_idt.o := $(CC_FLAGS_CFI) >> > +CFLAGS_REMOVE_paravirt.o := $(

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 15:37, Kees Cook wrote: > On Fri, Apr 16, 2021 at 03:20:17PM -0700, Andy Lutomirski wrote: >> But obviously there is code that needs real function pointers. How >> about making this a first-class feature, or at least hacking around it >> more cleanly. For example, what

Re: [PATCH 06/15] x86: Avoid CFI jump tables in IDT and entry points

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 13:38, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG, the compiler replaces function addresses in C > code with jump table addresses. Fine. > To avoid referring to jump tables in entry code with PTI, What has this to do with PTI? > disable CFI for IDT and paravirt code,

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 14:49, Sami Tolvanen wrote: > On Fri, Apr 16, 2021 at 2:18 PM Borislav Petkov wrote: >> In file included from ./include/linux/ftrace.h:22:0, >> from ./include/linux/init_task.h:9, >> from init/init_task.c:2: >> ./include/linux/ftrace.h: In

Re: [PATCH v2] X86: Makefile: Replace -pg with CC_FLAGS_FTRACE

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 13:39, zhaoxiao wrote: > In preparation for x86 supporting ftrace built on other compiler > options, let's have the x86 Makefiles remove the $(CC_FLAGS_FTRACE) > flags, whatever these may be, rather than assuming '-pg'. s/let's have the/make the/ > There should be no

Re: [patch] x86/crash: fix crash_setup_memmap_entries() out-of-bounds access

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 17:13, Mike Galbraith wrote: > On Fri, 2021-04-16 at 16:44 +0200, Borislav Petkov wrote: >> On Fri, Apr 16, 2021 at 03:16:07PM +0200, Mike Galbraith wrote: >> > On Fri, 2021-04-16 at 14:16 +0200, Borislav Petkov wrote: >> > > >> > > Please be more verbose and structure your

Re: [PATCH 04/15] static_call: Use global functions for the self-test

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 13:38, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG, the compiler renames static functions. This > breaks static_call users using static functions, because the current > implementation assumes functions have stable names by hardcoding them > in inline assembly. Make the

Re: [PATCH v8 clocksource 2/5] clocksource: Retry clock read if long delays detected

2021-04-16 Thread Thomas Gleixner
On Tue, Apr 13 2021 at 21:35, Paul E. McKenney wrote: > #define WATCHDOG_INTERVAL (HZ >> 1) > #define WATCHDOG_THRESHOLD (NSEC_PER_SEC >> 4) Didn't we discuss that the threshold is too big ?

Re: [PATCH v8 clocksource 1/5] clocksource: Provide module parameters to inject delays in watchdog

2021-04-16 Thread Thomas Gleixner
On Tue, Apr 13 2021 at 21:35, Paul E. McKenney wrote: > > +static int inject_delay_freq; > +module_param(inject_delay_freq, int, 0644); > +static int inject_delay_run = 1; > +module_param(inject_delay_run, int, 0644); int? Can't we just make them 'unsigned int'? Negative values are not that

Re: [PATCH] kernel:irq:manage: request threaded irq with a specified priority

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 12:57, chensong wrote: > On 2021/4/13 下午4:39, Thomas Gleixner wrote: >> It breaks because the system designer failed to assign proper priorities >> to the irq threads int_a, int_b and to the user space process task_a. > > yes, it's designers' responsibi

Re: [PATCH v3] hrtimer: avoid retrigger_next_event IPI

2021-04-15 Thread Thomas Gleixner
On Thu, Apr 15 2021 at 12:39, Marcelo Tosatti wrote: > +static bool need_reprogram_timer(struct hrtimer_cpu_base *cpu_base) > +{ > + unsigned int active = 0; > + > + if (cpu_base->softirq_activated) > + return true; > + > + active = cpu_base->active_bases &

Re: [PATCH] hrtimer: Update softirq_expires_next correctly after __hrtimer_get_next_event()

2021-04-15 Thread Thomas Gleixner
On Wed, Apr 14 2021 at 11:49, Lorenzo Colitti wrote: > On Wed, Apr 14, 2021 at 2:14 AM Greg KH wrote: >> To give context, the commit is now 46eb1701c046 ("hrtimer: Update >> softirq_expires_next correctly after __hrtimer_get_next_event()") and is >> attached below. >> >> The f_ncm.c driver is

[tip: sched/core] signal: Hand SIGQUEUE_PREALLOC flag to __sigqueue_alloc()

2021-04-15 Thread tip-bot2 for Thomas Gleixner
The following commit has been merged into the sched/core branch of tip: Commit-ID: 69995ebbb9d3717306a165db88a1292b63f77a37 Gitweb: https://git.kernel.org/tip/69995ebbb9d3717306a165db88a1292b63f77a37 Author:Thomas Gleixner AuthorDate:Mon, 22 Mar 2021 10:19:42 +01:00

[tip: sched/core] signal: Allow tasks to cache one sigqueue struct

2021-04-15 Thread tip-bot2 for Thomas Gleixner
The following commit has been merged into the sched/core branch of tip: Commit-ID: 4bad58ebc8bc4f20d89cff95417c9b4674769709 Gitweb: https://git.kernel.org/tip/4bad58ebc8bc4f20d89cff95417c9b4674769709 Author:Thomas Gleixner AuthorDate:Tue, 23 Mar 2021 22:05:39 +01:00

Re: [tip: core/rcu] softirq: Don't try waking ksoftirqd before it has been spawned

2021-04-14 Thread Thomas Gleixner
Paul, On Wed, Apr 14 2021 at 11:11, Paul E. McKenney wrote: > On Wed, Apr 14, 2021 at 10:57:57AM +0200, Uladzislau Rezki wrote: >> On Wed, Apr 14, 2021 at 09:13:22AM +0200, Sebastian Andrzej Siewior wrote: >> At the same time Paul made another patch: >> >> softirq: Don't try waking ksoftirqd

Re: [RFC PATCH 0/7] KVM: Fix tick-based vtime accounting on x86

2021-04-14 Thread Thomas Gleixner
On Tue, Apr 13 2021 at 11:29, Sean Christopherson wrote: > This is an alternative to Wanpeng's series[*] to fix tick-based accounting > on x86. The approach for fixing the bug is identical: defer accounting > until after tick IRQs are handled. The difference is purely in how the > context

Re: [PATCH v2] hrtimer: avoid retrigger_next_event IPI

2021-04-14 Thread Thomas Gleixner
Marcelo, On Tue, Apr 13 2021 at 14:04, Marcelo Tosatti wrote: > Setting the realtime clock triggers an IPI to all CPUs to reprogram > hrtimers. s/hrtimers/clock event device/ > However, only realtime and TAI clocks have their offsets updated > (and therefore potentially require a reprogram). >

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-14 Thread Thomas Gleixner
Fenghua, On Tue, Apr 13 2021 at 23:40, Fenghua Yu wrote: > On Mon, Apr 12, 2021 at 09:15:08AM +0200, Thomas Gleixner wrote: >> Aside of that why are you trying to make this throttling in any way >> accurate? It does not matter at all, really. Limit reached, put it to >>

Re: bl_list and lockdep

2021-04-13 Thread Thomas Gleixner
Dave, On Tue, Apr 13 2021 at 19:58, Dave Chinner wrote: > On Tue, Apr 13, 2021 at 01:18:35AM +0200, Thomas Gleixner wrote: > So for solving the inode cache scalability issue with RT in mind, > we're left with these choices: > > a) increase memory consumption and cacheline miss

Re: [PATCH v7 clocksource 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-04-13 Thread Thomas Gleixner
Paul, On Mon, Apr 12 2021 at 16:18, Paul E. McKenney wrote: > On Mon, Apr 12, 2021 at 10:37:10PM +0200, Thomas Gleixner wrote: >> On Mon, Apr 12 2021 at 12:57, Paul E. McKenney wrote: >> > On Mon, Apr 12, 2021 at 08:54:03PM +0200, Thomas Gleixner wrote: >> >> > I

Re: [PATCH] genirq: reduce irqdebug bouncing cachelines

2021-04-13 Thread Thomas Gleixner
On Tue, Apr 13 2021 at 14:16, Cédric Le Goater wrote: >>> We could test irq_settings_no_debug() directly under handle_nested_irq() >>> and handle_irq_event_percpu() to avoid calling note_interrupt(), just >>> like we do for noirqdebug. >> >> We can do that, but then we should not just make it:

Re: [PATCH] kernel:irq:manage: request threaded irq with a specified priority

2021-04-13 Thread Thomas Gleixner
On Tue, Apr 13 2021 at 14:19, Song Chen wrote: > In general, irq handler thread will be assigned a default priority which > is MAX_RT_PRIO/2, as a result, no one can preempt others. > > Here is the case I found in a real project, an interrupt int_a is > coming, wakes up its handler handler_a and

Re: Candidate Linux ABI for Intel AMX and hypothetical new related features

2021-04-12 Thread Thomas Gleixner
On Mon, Apr 12 2021 at 19:46, Len Brown wrote: > On Mon, Apr 12, 2021 at 11:21 AM Andy Lutomirski wrote: >> Even putting aside all kernel and ABI issues, is it actually a good >> idea for user libraries to transparently use these new features? I'm >> not really convinced. I think that serious

Re: bl_list and lockdep

2021-04-12 Thread Thomas Gleixner
Dave, On Tue, Apr 13 2021 at 08:15, Dave Chinner wrote: > On Mon, Apr 12, 2021 at 05:20:53PM +0200, Thomas Gleixner wrote: >> On Wed, Apr 07 2021 at 07:22, Dave Chinner wrote: >> > And, FWIW, I'm also aware of the problems that RT kernels have with >> > the use of bit

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-12 Thread Thomas Gleixner
On Mon, Apr 12 2021 at 12:56, Mel Gorman wrote: > On Fri, Apr 09, 2021 at 08:55:39PM +0200, Peter Zijlstra wrote: > I'll update the changelog and comment accordingly. I'll decide later > whether to leave it or move the location of the lock at the end of the > series. If the patch is added, it'll

Re: [PATCH v7 clocksource 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-04-12 Thread Thomas Gleixner
On Mon, Apr 12 2021 at 12:57, Paul E. McKenney wrote: > On Mon, Apr 12, 2021 at 08:54:03PM +0200, Thomas Gleixner wrote: >> > I will send a new series out later today, Pacific Time. >> >> Can you do me a favour and send it standalone and not as yet another >> repl

Re: [PATCH v7 clocksource 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-04-12 Thread Thomas Gleixner
Paul, On Mon, Apr 12 2021 at 11:20, Paul E. McKenney wrote: > On Mon, Apr 12, 2021 at 03:08:16PM +0200, Thomas Gleixner wrote: >> The reason for irqsave is again historical AFAICT and nobody bothered to >> clean it up. spin_lock_bh() should be sufficient to serialize against >&g

Re: bl_list and lockdep

2021-04-12 Thread Thomas Gleixner
Dave, On Wed, Apr 07 2021 at 07:22, Dave Chinner wrote: > On Tue, Apr 06, 2021 at 02:28:34PM +0100, Matthew Wilcox wrote: >> On Tue, Apr 06, 2021 at 10:33:43PM +1000, Dave Chinner wrote: >> > +++ b/fs/inode.c >> > @@ -57,8 +57,7 @@ >> > >> > static unsigned int i_hash_mask __read_mostly; >> >

Re: [PATCH 02/17] locking: Add split_lock

2021-04-12 Thread Thomas Gleixner
On Mon, Apr 12 2021 at 15:45, Matthew Wilcox wrote: > On Mon, Apr 12, 2021 at 04:29:28PM +0200, Thomas Gleixner wrote: >> On Fri, Apr 09 2021 at 03:51, Matthew Wilcox wrote: >> > Bitlocks do not currently participate in lockdep. Conceptually, a >> > bit_spinlock is a

Re: [PATCH 02/17] locking: Add split_lock

2021-04-12 Thread Thomas Gleixner
On Fri, Apr 09 2021 at 03:51, Matthew Wilcox wrote: > Bitlocks do not currently participate in lockdep. Conceptually, a > bit_spinlock is a split lock, eg across each bucket in a hash table. > The struct split_lock gives us somewhere to record the lockdep_map. I like the concept, but the name is

Re: [tip: core/rcu] softirq: Don't try waking ksoftirqd before it has been spawned

2021-04-12 Thread Thomas Gleixner
On Sun, Apr 11 2021 at 13:43, tip-bot wrote: > The following commit has been merged into the core/rcu branch of tip: > > Commit-ID: 1c0c4bc1ceb580851b2d76fdef9712b3bdae134b > Gitweb: > https://git.kernel.org/tip/1c0c4bc1ceb580851b2d76fdef9712b3bdae134b > Author:Paul E. McKenney

Re: [PATCH v7 clocksource 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-04-12 Thread Thomas Gleixner
On Sun, Apr 11 2021 at 21:21, Paul E. McKenney wrote: > On Sun, Apr 11, 2021 at 09:46:12AM -0700, Paul E. McKenney wrote: >> So I need to is inline clocksource_verify_percpu_wq() >> into clocksource_verify_percpu() and then move the call to >> clocksource_verify_percpu() to

Re: [PATCH RESEND v1 2/4] lib/vdso: Add vdso_data pointer as input to __arch_get_timens_vdso_data()

2021-04-12 Thread Thomas Gleixner
age to vdso_data, provide > vdso_data pointer to __arch_get_timens_vdso_data() in order > to ease the calculation on powerpc in following patches. > > Signed-off-by: Christophe Leroy Reviewed-by: Thomas Gleixner

Re: [PATCH RESEND v1 0/4] powerpc/vdso: Add support for time namespaces

2021-04-12 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 16:48, Christophe Leroy wrote: > [Sorry, resending with complete destination list, I used the wrong script on > the first delivery] > > This series adds support for time namespaces on powerpc. > > All timens selftests are successfull. If PPC people want to pick up the

Re: [PATCH RESEND v1 1/4] lib/vdso: Mark do_hres_timens() and do_coarse_timens() __always_inline()

2021-04-12 Thread Thomas Gleixner
-gettime-monotonic-raw:vdso: 1100 nsec/call > clock-gettime-monotonic-coarse:vdso: 667 nsec/call > clock-gettime-monotonic:vdso: 1025 nsec/call > > Signed-off-by: Christophe Leroy Reviewed-by: Thomas Gleixner

Re: [PATCH] genirq: reduce irqdebug bouncing cachelines

2021-04-12 Thread Thomas Gleixner
Cédric, On Mon, Apr 12 2021 at 11:06, Cédric Le Goater wrote: > On 4/10/21 1:58 PM, Thomas Gleixner wrote: >> --- a/kernel/irq/spurious.c >> +++ b/kernel/irq/spurious.c >> @@ -274,7 +274,7 @@ void note_interrupt(struct irq_desc *des >> unsigned int irq; &g

Re: [PATCH v5 2/3] x86/bus_lock: Handle #DB for bus lock

2021-04-12 Thread Thomas Gleixner
On Sat, Apr 03 2021 at 01:04, Fenghua Yu wrote: > On Sat, Mar 20, 2021 at 01:42:52PM +0100, Thomas Gleixner wrote: >> On Fri, Mar 19 2021 at 22:19, Fenghua Yu wrote: >> And even with throttling the injection rate further down to 25k per >> second the impact on the workload

Re: [PATCH v7 clocksource] Do not mark clocks unstable due to delays for v5.13

2021-04-11 Thread Thomas Gleixner
On Sat, Apr 10 2021 at 16:26, Paul E. McKenney wrote: > On Sat, Apr 10, 2021 at 10:01:58AM +0200, Thomas Gleixner wrote: >> On Fri, Apr 02 2021 at 15:48, Paul E. McKenney wrote: >> I buy the vCPU preemption part and TBH guests should not have that >> watchdog thing acti

Re: [PATCH v7 clocksource 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-04-11 Thread Thomas Gleixner
On Sat, Apr 10 2021 at 17:20, Paul E. McKenney wrote: > On Sat, Apr 10, 2021 at 11:00:25AM +0200, Thomas Gleixner wrote: >> > + if (WARN_ON_ONCE(!cs)) >> > + return; >> > + pr_warn("Checking clocksource %s synchronization from CPU %d.\n", &g

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Thomas Gleixner
Feng, On Sat, Apr 10 2021 at 22:38, Feng Tang wrote: > On Sat, Apr 10, 2021 at 11:27:11AM +0200, Thomas Gleixner wrote: >> > +static int __init start_sync_check_timer(void) >> > +{ >> > + if (!boot_cpu_has(X86_FEATURE_TSC_ADJUST)) >> > +

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Thomas Gleixner
On Sat, Apr 10 2021 at 11:47, Borislav Petkov wrote: > On Sat, Apr 10, 2021 at 11:27:11AM +0200, Thomas Gleixner wrote: >> On Tue, Mar 30 2021 at 16:25, Feng Tang wrote: >> > Normally the tsc_sync will be checked every time system enters idle state, >> > but there is

Re: [PATCH] genirq: reduce irqdebug bouncing cachelines

2021-04-10 Thread Thomas Gleixner
Nicholas, On Fri, Apr 02 2021 at 23:20, Nicholas Piggin wrote: > note_interrupt increments desc->irq_count for each interrupt even for > percpu interrupt handlers, even when they are handled successfully. This > causes cacheline bouncing and limits scalability. > > Instead of incrementing

Re: [PATCH] arch/x86: Encourage rather than discourage x2apic support

2021-04-10 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 05:16, Luke Dashjr wrote: > Multi-core SMP doesn't work on modern Intel CPUs (at least Comet Lake) without > x2apic. Unsure users should say Y. I'd rather make it explicit by also adding default y Thanks, tglx

Re: [RFC 1/2] x86/tsc: add a timer to make sure tsc_adjust is always checked

2021-04-10 Thread Thomas Gleixner
On Tue, Mar 30 2021 at 16:25, Feng Tang wrote: > Normally the tsc_sync will be checked every time system enters idle state, > but there is still caveat that a system won't enter idle, either because > it's too busy or configured purposely to not enter idle. Setup a periodic > timer to make sure

Re: [PATCH v7 clocksource 5/5] clocksource: Do pairwise clock-desynchronization checking

2021-04-10 Thread Thomas Gleixner
On Fri, Apr 02 2021 at 15:49, paulmck wrote: > From: "Paul E. McKenney" > > Although smp_call_function() has the advantage of simplicity, using > it to check for cross-CPU clock desynchronization means that any CPU > being slow reduces the sensitivity of the checking across all CPUs. > And it is

Re: [PATCH v7 clocksource 3/5] clocksource: Check per-CPU clock synchronization when marked unstable

2021-04-10 Thread Thomas Gleixner
On Fri, Apr 02 2021 at 15:49, paulmck wrote: > > +static void clocksource_verify_percpu_wq(struct work_struct *unused) > +{ > + int cpu; > + struct clocksource *cs; > + int64_t cs_nsec; > + u64 csnow_begin; > + u64 csnow_end; > + u64 delta; Please use reverse fir tree

Re: [PATCH v7 clocksource 2/5] clocksource: Retry clock read if long delays detected

2021-04-10 Thread Thomas Gleixner
On Fri, Apr 02 2021 at 15:49, paulmck wrote: > This commit therefore re-reads the watchdog clock on either side of 'This commit' is not any better than 'This patch' and this sentence makes no sense. I might be missing something, but how exactly does "the commit" re-read the watchdog clock? git

Re: [PATCH v7 clocksource] Do not mark clocks unstable due to delays for v5.13

2021-04-10 Thread Thomas Gleixner
On Fri, Apr 02 2021 at 15:48, Paul E. McKenney wrote: > Hello! > > If there is a sufficient delay between reading the watchdog clock and the > clock under test, the clock under test will be marked unstable through no > fault of its own. This series checks for this, doing limited retries > to get

Re: [PATCH] hrtimer: avoid retrigger_next_event IPI

2021-04-10 Thread Thomas Gleixner
On Fri, Apr 09 2021 at 13:51, Marcelo Tosatti wrote: > On Fri, Apr 09, 2021 at 04:15:13PM +0200, Thomas Gleixner wrote: >> On Wed, Apr 07 2021 at 10:53, Marcelo Tosatti wrote: >> ---> fail because that newly started timer is on the ol

Re: [PATCH] hrtimer: avoid retrigger_next_event IPI

2021-04-09 Thread Thomas Gleixner
On Wed, Apr 07 2021 at 10:53, Marcelo Tosatti wrote: > Setting the realtime clock triggers an IPI to all CPUs to reprogram > hrtimers. > > However, only base, boottime and tai clocks have their offsets updated base clock? And why boottime? Boottime is not affected by a clock realtime set. It's

Re: [RFC PATCH 06/10] genirq: Don't mask IRQ within flow handler if IRQ is flow-masked

2021-04-09 Thread Thomas Gleixner
On Thu, Apr 08 2021 at 16:43, Valentin Schneider wrote: > + /* > + * Masking is required if IRQ is ONESHOT and we can't rely on the > + * flow-masking persisting down to irq_finalize_oneshot() > + * (in the IRQ thread). > + */ > + if ((desc->istate & IRQS_ONESHOT) && >

Re: [RFC PATCH 05/10] genirq: Let purely flow-masked ONESHOT irqs through unmask_threaded_irq()

2021-04-09 Thread Thomas Gleixner
On Thu, Apr 08 2021 at 16:43, Valentin Schneider wrote: > A subsequent patch will let IRQs end up in irq_finalize_oneshot() without > IRQD_IRQ_MASKED, but with IRQD_IRQ_FLOW_MASKED set instead. Let such IRQs > receive their final ->irq_eoi(). > > Signed-off-by: Valentin Schneider > --- >

Re: [RFC PATCH] Add split_lock

2021-04-09 Thread Thomas Gleixner
On Thu, Apr 08 2021 at 12:18, Peter Zijlstra wrote: > On Thu, Apr 08, 2021 at 06:23:38AM +0100, Matthew Wilcox (Oracle) wrote: >> bit_spinlocks are horrible on RT because there's absolutely nowhere >> to put the mutex to sleep on. They also do not participate in lockdep >> because there's nowhere

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-04-07 Thread Thomas Gleixner
Greg, On Fri, Apr 02 2021 at 09:54, Greg KH wrote: > On Thu, Apr 01, 2021 at 11:59:25PM +, Luis Chamberlain wrote: >> As for the syfs deadlock possible with drivers, this fixes it in a generic >> way: >> >> commit fac43d8025727a74f80a183cc5eb74ed902a5d14 >> Author: Luis Chamberlain >>

Re: [PATCH] kernel/time: Feedback reply for hr_sleep syscall, a fine-grained sleep service

2021-04-07 Thread Thomas Gleixner
Marco! On Wed, Apr 07 2021 at 11:32, Marco Faltelli wrote: > Current sleep services (nanosleep) provide sleep periods very far from > the expectations when scheuling microsecond-scale timers. On our > testbed, using rdtscp() before and after a nanosleep() syscall to > measure the effective

Re: [syzbot] WARNING: suspicious RCU usage in get_timespec64

2021-04-04 Thread Thomas Gleixner
On Sun, Apr 04 2021 at 12:05, syzbot wrote: Cc + ... > Hello, > > syzbot found the following issue on: > > HEAD commit:5e46d1b7 reiserfs: update reiserfs_xattrs_initialized() co.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=1125f831d0 > kernel

Re: [PATCH v6 clocksource] Do not mark clocks unstable dueclocksource: Provide module parameters to inject delays in watchdog

2021-04-02 Thread Thomas Gleixner
On Fri, Apr 02 2021 at 13:31, paulmck wrote: The subsystem prefix does not parse: [PATCH v6 clocksource] Do not mark clocks unstable dueclocksource: Provide module parameters to inject delays in watchdog I look at the actual code changes after the easter break. Thanks, tglx

Re: [PATCH v9 0/6] Optionally randomize kernel stack offset each syscall

2021-04-01 Thread Thomas Gleixner
On Thu, Apr 01 2021 at 09:37, Will Deacon wrote: > On Wed, Mar 31, 2021 at 01:54:52PM -0700, Kees Cook wrote: >> Hi Will (and Mark and Catalin), >> >> Can you take this via the arm64 tree for v5.13 please? Thomas has added >> his Reviewed-by, so it only leaves arm64's. :) > > Sorry, these got

Re: [PATCH v8 3/6] stack: Optionally randomize kernel stack offset each syscall

2021-03-31 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 14:54, Kees Cook wrote: > On Wed, Mar 31, 2021 at 09:53:26AM +0200, Thomas Gleixner wrote: >> On Tue, Mar 30 2021 at 13:57, Kees Cook wrote: >> > +/* >> > + * Do not use this anywhere else in the kernel. This is used here because >> >

Re: [PATCH 2/6] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-03-31 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 19:42, Thomas Gleixner wrote: > On Wed, Mar 31 2021 at 12:01, Mel Gorman wrote: >> On Wed, Mar 31, 2021 at 11:55:56AM +0200, Thomas Gleixner wrote: >> @@ -887,13 +887,11 @@ void cpu_vm_stats_fold(int cpu) >> >> pzstats = per_cpu_

Re: [PATCH 2/6] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-03-31 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 12:01, Mel Gorman wrote: > On Wed, Mar 31, 2021 at 11:55:56AM +0200, Thomas Gleixner wrote: > @@ -887,13 +887,11 @@ void cpu_vm_stats_fold(int cpu) > > pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu); > > -

Re: [PATCH 2/6] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-03-31 Thread Thomas Gleixner
On Mon, Mar 29 2021 at 13:06, Mel Gorman wrote: > There is a lack of clarity of what exactly local_irq_save/local_irq_restore > protects in page_alloc.c . It conflates the protection of per-cpu page > allocation structures with per-cpu vmstat deltas. > > This patch protects the PCP structure using

Re: [RFC PATCH 0/6] Use local_lock for pcp protection and reduce stat overhead

2021-03-31 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 09:52, Mel Gorman wrote: > Ingo, Thomas or Peter, is there any chance one of you could take a look > at patch "[PATCH 2/6] mm/page_alloc: Convert per-cpu list protection to > local_lock" from this series? It's partially motivated by PREEMPT_RT. More > details below. Sure.

Re: [PATCH v2] tick/broadcast: Allow later registered device enter oneshot mode

2021-03-31 Thread Thomas Gleixner
On Wed, Mar 31 2021 at 09:10, Jindong Yue wrote: > --- a/kernel/time/tick-broadcast.c > +++ b/kernel/time/tick-broadcast.c > @@ -47,6 +47,7 @@ static inline void tick_resume_broadcast_oneshot(struct > clock_event_device *bc) > static inline void tick_broadcast_oneshot_offline(unsigned int cpu) {

Re: [PATCH v8 3/6] stack: Optionally randomize kernel stack offset each syscall

2021-03-31 Thread Thomas Gleixner
\ > + u8 *ptr = __builtin_alloca(KSTACK_OFFSET_MAX(offset)); \ > + asm volatile("" : "=m"(*ptr) :: "memory"); \ > + } \ > +} while (0) Other than that. Reviewed-by: Thomas Gleixner

Re: [PATCH v8 4/6] x86/entry: Enable random_kstack_offset support

2021-03-31 Thread Thomas Gleixner
offset needs to be retained for the life of the syscall, > which means it needs to happen at the actual entry point). > > Signed-off-by: Kees Cook Reviewed-by: Thomas Gleixner

Re: [PATCH v4 14/22] x86/fpu/xstate: Expand the xstate buffer on the first use of dynamic user state

2021-03-30 Thread Thomas Gleixner
Len, On Mon, Mar 29 2021 at 18:16, Len Brown wrote: > On Mon, Mar 29, 2021 at 2:49 PM Thomas Gleixner wrote: > Let me know if this problem description is fair: > > Many-core Xeon servers will support AMX, and when I run an AMX application > on one, when I take an interrupt with AM

[tip: x86/apic] x86/vector: Add a sanity check to prevent IRQ2 allocations

2021-03-29 Thread tip-bot2 for Thomas Gleixner
The following commit has been merged into the x86/apic branch of tip: Commit-ID: 9a98bc2cf08a095367449b3548c3d9ad4ad2cd20 Gitweb: https://git.kernel.org/tip/9a98bc2cf08a095367449b3548c3d9ad4ad2cd20 Author:Thomas Gleixner AuthorDate:Thu, 18 Mar 2021 20:26:48 +01:00

Re: [PATCH] tick/broadcast: Allow later probed device enter oneshot mode

2021-03-29 Thread Thomas Gleixner
On Mon, Mar 29 2021 at 13:25, Jindong Yue wrote: > /* > * Debugging: see timer_list.c > @@ -115,8 +116,20 @@ void tick_install_broadcast_device(struct > clock_event_device *dev) >* notification the systems stays stuck in periodic mode >* forever. >*/ > - if

  1   2   3   4   5   6   7   8   9   10   >