Re: [Intel-gfx] [PATCH v3 2/4] drm/i915/pmu: Use kstat_irqs to get interrupt count

2020-12-10 Thread Thomas Gleixner
On Thu, Dec 10 2020 at 10:45, Tvrtko Ursulin wrote: > On 10/12/2020 07:53, Joonas Lahtinen wrote: >> I think later in the thread there was a suggestion to replace this with >> simple counter increment in IRQ handler. > > It was indeed unsafe until recent b00bccb3f0bb ("drm/i915/pmu: Handle > PCI u

Re: [Intel-gfx] [PATCH v3 2/4] drm/i915/pmu: Use kstat_irqs to get interrupt count

2020-12-10 Thread Thomas Gleixner
On Thu, Dec 10 2020 at 17:09, Tvrtko Ursulin wrote: > On 10/12/2020 16:35, Thomas Gleixner wrote: >> I'll send out a series addressing irq_to_desc() (ab)use all over the >> place shortly. i915 is in there... > > Yep we don't need atomic, my bad. And we would care abo

[Intel-gfx] [patch 00/30] genirq: Treewide hunt for irq descriptor abuse and assorted fixes

2020-12-10 Thread Thomas Gleixner
A recent request to export kstat_irqs() pointed to a copy of the same in the i915 code, which made me look for further usage of irq descriptors in drivers. The usage in drivers ranges from creative to broken in all colours. irqdesc.h clearly says that this is core functionality and the fact C doe

[Intel-gfx] [patch 01/30] genirq: Move irq_has_action() into core code

2020-12-10 Thread Thomas Gleixner
. Signed-off-by: Thomas Gleixner --- arch/alpha/kernel/sys_jensen.c |2 +- arch/x86/kernel/topology.c |1 + include/linux/interrupt.h |1 + include/linux/irqdesc.h|7 +-- kernel/irq/manage.c| 17 + 5 files changed, 21 insertions

[Intel-gfx] [patch 03/30] genirq: Move irq_set_lockdep_class() to core

2020-12-10 Thread Thomas Gleixner
irq_set_lockdep_class() is used from modules and requires irq_to_desc() to be exported. Move it into the core code which lifts another requirement for the export. Signed-off-by: Thomas Gleixner --- include/linux/irqdesc.h | 10 -- kernel/irq/irqdesc.c| 14 ++ 2 files

[Intel-gfx] [patch 06/30] parisc/irq: Simplify irq count output for /proc/interrupts

2020-12-10 Thread Thomas Gleixner
The SMP variant works perfectly fine on UP as well. Signed-off-by: Thomas Gleixner Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: afzal mohammed Cc: linux-par...@vger.kernel.org --- arch/parisc/kernel/irq.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) --- a/a

[Intel-gfx] [patch 09/30] ARM: smp: Use irq_desc_kstat_cpu() in show_ipi_list()

2020-12-10 Thread Thomas Gleixner
The irq descriptor is already there, no need to look it up again. Signed-off-by: Thomas Gleixner Cc: Marc Zyngier Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org --- arch/arm/kernel/smp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm/kernel/smp.c +++ b

[Intel-gfx] [patch 08/30] genirq: Provide kstat_irqdesc_cpu()

2020-12-10 Thread Thomas Gleixner
Most users of kstat_irqs_cpu() have the irq descriptor already. No point in calling into the core code and looking it up once more. Use it in per_cpu_count_show() to start with. Signed-off-by: Thomas Gleixner --- include/linux/irqdesc.h |6 ++ kernel/irq/irqdesc.c|4 ++-- 2

[Intel-gfx] [patch 13/30] drm/i915/lpe_audio: Remove pointless irq_to_desc() usage

2020-12-10 Thread Thomas Gleixner
Nothing uses the result and nothing should ever use it in driver code. Signed-off-by: Thomas Gleixner Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: David Airlie Cc: Daniel Vetter Cc: Pankaj Bharadiya Cc: Chris Wilson Cc: Wambui Karuga Cc: intel-gfx@lists.freedesktop.org Cc

[Intel-gfx] [patch 05/30] genirq: Annotate irq stats data races

2020-12-10 Thread Thomas Gleixner
Both the per cpu stats and the accumulated count are accessed lockless and can be concurrently modified. That's intentional and the stats are a rough estimate anyway. Annotate them with data_race(). Signed-off-by: Thomas Gleixner --- kernel/irq/irqdesc.c |4 ++-- kernel/irq/proc.c|

[Intel-gfx] [patch 07/30] genirq: Make kstat_irqs() static

2020-12-10 Thread Thomas Gleixner
No more users outside the core code. Signed-off-by: Thomas Gleixner --- include/linux/kernel_stat.h |1 - kernel/irq/irqdesc.c| 19 ++- 2 files changed, 6 insertions(+), 14 deletions(-) --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -67,7

[Intel-gfx] [patch 14/30] drm/i915/pmu: Replace open coded kstat_irqs() copy

2020-12-10 Thread Thomas Gleixner
only counts interrupts which originate from the graphics card. To avoid atomics or heuristics of some sort make the counter field 'unsigned long'. That limits the count to 4e9 on 32bit which is a lot and postprocessing can easily deal with the occasional wraparound. Signed-off-by: Thoma

[Intel-gfx] [patch 11/30] parisc/irq: Use irq_desc_kstat_cpu() in show_interrupts()

2020-12-10 Thread Thomas Gleixner
The irq descriptor is already there, no need to look it up again. Signed-off-by: Thomas Gleixner Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: afzal mohammed Cc: linux-par...@vger.kernel.org --- arch/parisc/kernel/irq.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Intel-gfx] [patch 02/30] genirq: Move status flag checks to core

2020-12-10 Thread Thomas Gleixner
These checks are used by modules and prevent the removal of the export of irq_to_desc(). Move the accessor into the core. Signed-off-by: Thomas Gleixner --- include/linux/irqdesc.h | 17 + kernel/irq/manage.c | 17 + 2 files changed, 22 insertions(+), 12

[Intel-gfx] [patch 10/30] arm64/smp: Use irq_desc_kstat_cpu() in arch_show_interrupts()

2020-12-10 Thread Thomas Gleixner
The irq descriptor is already there, no need to look it up again. Signed-off-by: Thomas Gleixner Cc: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: linux-arm-ker...@lists.infradead.org --- arch/arm64/kernel/smp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion

[Intel-gfx] [patch 19/30] PCI: mobiveil: Use irq_data_get_irq_chip_data()

2020-12-10 Thread Thomas Gleixner
chip data of the top level chip of a hierarchy. It does not matter in this case because the chip is the top level chip, but that doesn't make it more correct. Signed-off-by: Thomas Gleixner Cc: Karthikeyan Mitran Cc: Hou Zhiqiang Cc: Lorenzo Pieralisi Cc: Rob Herring Cc: Bjorn Helgaa

[Intel-gfx] [patch 15/30] pinctrl: nomadik: Use irq_has_action()

2020-12-10 Thread Thomas Gleixner
Let the core code do the fiddling with irq_desc. Signed-off-by: Thomas Gleixner Cc: Linus Walleij Cc: linux-arm-ker...@lists.infradead.org Cc: linux-g...@vger.kernel.org --- drivers/pinctrl/nomadik/pinctrl-nomadik.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers

[Intel-gfx] [patch 12/30] s390/irq: Use irq_desc_kstat_cpu() in show_msi_interrupt()

2020-12-10 Thread Thomas Gleixner
The irq descriptor is already there, no need to look it up again. Signed-off-by: Thomas Gleixner Cc: Christian Borntraeger Cc: Heiko Carstens Cc: linux-s...@vger.kernel.org --- arch/s390/kernel/irq.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/s390/kernel/irq.c +++ b

[Intel-gfx] [patch 04/30] genirq: Provide irq_get_effective_affinity()

2020-12-10 Thread Thomas Gleixner
Provide an accessor to the effective interrupt affinity mask. Going to be used to replace open coded fiddling with the irq descriptor. Signed-off-by: Thomas Gleixner --- include/linux/irq.h |7 +++ 1 file changed, 7 insertions(+) --- a/include/linux/irq.h +++ b/include/linux/irq.h

[Intel-gfx] [patch 18/30] PCI: xilinx-nwl: Use irq_data_get_irq_chip_data()

2020-12-10 Thread Thomas Gleixner
chip data of the top level chip of a hierarchy. It does not matter in this case because the chip is the top level chip, but that doesn't make it more correct. Signed-off-by: Thomas Gleixner Cc: Lorenzo Pieralisi Cc: Rob Herring Cc: Bjorn Helgaas Cc: Michal Simek Cc: linux-...@vger.kerne

[Intel-gfx] [patch 28/30] xen/events: Reduce irq_info::spurious_cnt storage size

2020-12-10 Thread Thomas Gleixner
To prepare for interrupt spreading reduce the storage size of irq_info::spurious_cnt to u8 so the required flag for the spreading logic will not increase the storage size. Protect the usage site against overruns. Signed-off-by: Thomas Gleixner Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano

[Intel-gfx] [patch 25/30] xen/events: Remove disfunct affinity spreading

2020-12-10 Thread Thomas Gleixner
contain cpumask_of(0). As the CPU0 enforcement was in place _before_ this was implemented it's entirely unclear how that can ever have worked at all. Remove it as preparation for doing it proper. Signed-off-by: Thomas Gleixner Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: x

[Intel-gfx] [patch 26/30] xen/events: Use immediate affinity setting

2020-12-10 Thread Thomas Gleixner
makes XEN on x86 use the same mechanics as on e.g. ARM64 where deferred affinity setting is not required and not implemented and the code path in the ack functions is compiled out. Signed-off-by: Thomas Gleixner Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: xen-de

[Intel-gfx] [patch 29/30] xen/events: Implement irq distribution

2020-12-10 Thread Thomas Gleixner
Keep track of the assignments of event channels to CPUs and select the online CPU with the least assigned channels in the affinity mask which is handed to irq_chip::irq_set_affinity() from the core code. Signed-off-by: Thomas Gleixner Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano

[Intel-gfx] [patch 30/30] genirq: Remove export of irq_to_desc()

2020-12-10 Thread Thomas Gleixner
No more (ab)use in modules finally. Remove the export so there won't come new ones. Signed-off-by: Thomas Gleixner --- kernel/irq/irqdesc.c |1 - 1 file changed, 1 deletion(-) --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -352,7 +352,6 @@ struct irq_desc *irq_to_desc(unsign

[Intel-gfx] [patch 17/30] NTB/msi: Use irq_has_action()

2020-12-10 Thread Thomas Gleixner
Use the proper core function. Signed-off-by: Thomas Gleixner Cc: Jon Mason Cc: Dave Jiang Cc: Allen Hubbe Cc: linux-...@googlegroups.com --- drivers/ntb/msi.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/ntb/msi.c +++ b/drivers/ntb/msi.c @@ -282,15 +282,13

[Intel-gfx] [patch 16/30] mfd: ab8500-debugfs: Remove the racy fiddling with irq_desc

2020-12-10 Thread Thomas Gleixner
on of subsystem boundaries and racy against concurrent modifications of the interrupt descriptor. Print the irq line instead so the information can be looked up in a sane way in /proc/interrupts. Signed-off-by: Thomas Gleixner Cc: Linus Walleij Cc: Lee Jones Cc: linux-arm-ker...@lists.infradea

[Intel-gfx] [patch 22/30] net/mlx5: Replace irq_to_desc() abuse

2020-12-10 Thread Thomas Gleixner
. Retrieve a pointer to the affinity mask itself and use that. It's still using an interface which is usually not for random drivers, but definitely less hideous than the previous hack. Signed-off-by: Thomas Gleixner --- drivers/net/ethernet/mellanox/mlx5/core/en.h |2 +- drivers/net/eth

[Intel-gfx] [patch 21/30] net/mlx4: Use effective interrupt affinity

2020-12-10 Thread Thomas Gleixner
means that checking the affinity mask itself does not really tell about the actual target CPUs. Signed-off-by: Thomas Gleixner Cc: Tariq Toukan Cc: "David S. Miller" Cc: Jakub Kicinski Cc: net...@vger.kernel.org Cc: linux-r...@vger.kernel.org --- drivers/net/ethernet/mellanox/ml

[Intel-gfx] [patch 24/30] xen/events: Remove unused bind_evtchn_to_irq_lateeoi()

2020-12-10 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: xen-de...@lists.xenproject.org --- drivers/xen/events/events_base.c |6 -- 1 file changed, 6 deletions(-) --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c

[Intel-gfx] [patch 23/30] net/mlx5: Use effective interrupt affinity

2020-12-10 Thread Thomas Gleixner
means that checking the affinity mask itself does not really tell about the actual target CPUs. Signed-off-by: Thomas Gleixner Cc: Saeed Mahameed Cc: Leon Romanovsky Cc: "David S. Miller" Cc: Jakub Kicinski Cc: net...@vger.kernel.org Cc: linux-r...@vger.kernel.org --- drivers/ne

[Intel-gfx] [patch 20/30] net/mlx4: Replace irq_to_desc() abuse

2020-12-10 Thread Thomas Gleixner
. Retrieve a pointer to the affinity mask itself and use that. It's still using an interface which is usually not for random drivers, but definitely less hideous than the previous hack. Signed-off-by: Thomas Gleixner Cc: Tariq Toukan Cc: "David S. Miller" Cc: Jakub Ki

[Intel-gfx] [patch 27/30] xen/events: Only force affinity mask for percpu interrupts

2020-12-10 Thread Thomas Gleixner
irq(). This also prepares for proper interrupt spreading. Signed-off-by: Thomas Gleixner Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: xen-de...@lists.xenproject.org --- drivers/xen/events/events_base.c | 42 ++- 1 file changed, 28 inserti

Re: [Intel-gfx] [patch 24/30] xen/events: Remove unused bind_evtchn_to_irq_lateeoi()

2020-12-10 Thread Thomas Gleixner
On Thu, Dec 10 2020 at 18:19, boris ostrovsky wrote: > On 12/10/20 2:26 PM, Thomas Gleixner wrote: >> -EXPORT_SYMBOL_GPL(bind_evtchn_to_irq_lateeoi); > > include/xen/events.h also needs to be updated (and in the next patch for > xen_set_affinity_evtchn() as well).

Re: [Intel-gfx] [patch 27/30] xen/events: Only force affinity mask for percpu interrupts

2020-12-10 Thread Thomas Gleixner
On Thu, Dec 10 2020 at 18:20, boris ostrovsky wrote: > On 12/10/20 2:26 PM, Thomas Gleixner wrote: >> All event channel setups bind the interrupt on CPU0 or the target CPU for >> percpu interrupts and overwrite the affinity mask with the corresponding >> cpumask. Tha

Re: [Intel-gfx] [patch 27/30] xen/events: Only force affinity mask for percpu interrupts

2020-12-11 Thread Thomas Gleixner
On Fri, Dec 11 2020 at 07:17, Jürgen Groß wrote: > On 11.12.20 00:20, boris.ostrov...@oracle.com wrote: >> >> On 12/10/20 2:26 PM, Thomas Gleixner wrote: >>> All event channel setups bind the interrupt on CPU0 or the target CPU for >>> percpu interrupts and ove

Re: [Intel-gfx] [patch 27/30] xen/events: Only force affinity mask for percpu interrupts

2020-12-11 Thread Thomas Gleixner
On Fri, Dec 11 2020 at 13:10, Jürgen Groß wrote: > On 11.12.20 00:20, boris.ostrov...@oracle.com wrote: >> >> On 12/10/20 2:26 PM, Thomas Gleixner wrote: >>> All event channel setups bind the interrupt on CPU0 or the target CPU for >>> percpu interrupts and ove

Re: [Intel-gfx] [patch 14/30] drm/i915/pmu: Replace open coded kstat_irqs() copy

2020-12-11 Thread Thomas Gleixner
On Fri, Dec 11 2020 at 10:13, Tvrtko Ursulin wrote: > On 10/12/2020 19:25, Thomas Gleixner wrote: >> >> Aside of that the count is per interrupt line and therefore takes >> interrupts from other devices into account which share the interrupt line >> and are not han

Re: [Intel-gfx] [patch 03/30] genirq: Move irq_set_lockdep_class() to core

2020-12-11 Thread Thomas Gleixner
On Fri, Dec 11 2020 at 19:53, Andy Shevchenko wrote: > On Thu, Dec 10, 2020 at 10:14 PM Thomas Gleixner wrote: >> >> irq_set_lockdep_class() is used from modules and requires irq_to_desc() to >> be exported. Move it into the core code which lifts another requirem

Re: [Intel-gfx] [patch 14/30] drm/i915/pmu: Replace open coded kstat_irqs() copy

2020-12-11 Thread Thomas Gleixner
On Fri, Dec 11 2020 at 14:19, David Laight wrote: > From: Thomas Gleixner >> You can't catch that. If this really becomes an issue you need a >> sequence counter around it. > > Or just two copies of the high word. > Provided the accesses are sequenced: > writer: &

Re: [Intel-gfx] [patch 27/30] xen/events: Only force affinity mask for percpu interrupts

2020-12-11 Thread Thomas Gleixner
On Fri, Dec 11 2020 at 09:29, boris ostrovsky wrote: > On 12/11/20 7:37 AM, Thomas Gleixner wrote: >> On Fri, Dec 11 2020 at 13:10, Jürgen Groß wrote: >>> On 11.12.20 00:20, boris.ostrov...@oracle.com wrote: >>>> On 12/10/20 2:26 PM, Thomas Gleixner wrote: >>&

Re: [Intel-gfx] [patch 03/30] genirq: Move irq_set_lockdep_class() to core

2020-12-11 Thread Thomas Gleixner
On Fri, Dec 11 2020 at 22:08, Thomas Gleixner wrote: > On Fri, Dec 11 2020 at 19:53, Andy Shevchenko wrote: > >> On Thu, Dec 10, 2020 at 10:14 PM Thomas Gleixner wrote: >>> >>> irq_set_lockdep_class() is used from modules and requires irq_to_desc() to >>>

Re: [Intel-gfx] [patch 27/30] xen/events: Only force affinity mask for percpu interrupts

2020-12-11 Thread Thomas Gleixner
Andrew, On Fri, Dec 11 2020 at 22:21, Andrew Cooper wrote: > On 11/12/2020 21:27, Thomas Gleixner wrote: >> It's not any different from the hardware example at least not as far as >> I understood the code. > > Xen's event channels do have a couple of quirks. Why am

Re: [Intel-gfx] [patch 02/30] genirq: Move status flag checks to core

2021-01-11 Thread Thomas Gleixner
On Sun, Dec 27 2020 at 11:20, Guenter Roeck wrote: > On Thu, Dec 10, 2020 at 08:25:38PM +0100, Thomas Gleixner wrote: > Yes, but that means that irq_check_status_bit() may be called from modules, > but it is not exported, resulting in build errors such as the following. > > arm

[Intel-gfx] [patch 07/11] drm/i915/pmu: Use hrtimer_forward_now()

2021-09-23 Thread Thomas Gleixner
hrtimer_forward() is about to be removed from the public interfaces. Replace it with hrtimer_forward_now() which provides the same functionality. Signed-off-by: Thomas Gleixner Cc: David Airlie Cc: intel-gfx@lists.freedesktop.org Cc: Joonas Lahtinen Cc: Jani Nikula Cc: dri-de

[Intel-gfx] [patch 00/11] hrtimers: Cleanup hrtimer_forward() [ab]use

2021-09-23 Thread Thomas Gleixner
A recent syzbot report unearthed abuse of hrtimer_forward() which can cause runaway timers hogging the CPU in timer expiry context by rearming the timer in the past over and over. This happens when the caller uses timer->expiry for the 'now' argument of hrtimer_forward(). That works as long as the

[Intel-gfx] [RFC patch 15/41] drm: Remove the ULONG_MAX stack trace hackery

2019-04-10 Thread Thomas Gleixner
No architecture terminates the stack trace with ULONG_MAX anymore. Remove the cruft. Signed-off-by: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: Joonas Lahtinen Cc: Maarten Lankhorst Cc: dri-de...@lists.freedesktop.org Cc: David Airlie Cc: Jani Nikula Cc: Daniel Vetter Cc

[Intel-gfx] [RFC patch 32/41] drm: Simplify stacktrace handling

2019-04-10 Thread Thomas Gleixner
pointer in the stack_trace struct so it points to the depot storage. Signed-off-by: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: Joonas Lahtinen Cc: Maarten Lankhorst Cc: dri-de...@lists.freedesktop.org Cc: David Airlie Cc: Jani Nikula Cc: Daniel Vetter Cc: Rodrigo Vivi

[Intel-gfx] [patch V2 02/29] stacktrace: Provide helpers for common stack trace operations

2019-04-18 Thread Thomas Gleixner
r all use cases a storage array and the number of valid stack trace entries in the array is sufficient. Provide helper functions which avoid the struct stack_trace indirection so the usage sites can be cleaned up. Signed-off-by: Thomas Gleixner --- include/linux/stacktrace.h | 27 +++ k

[Intel-gfx] [patch V2 03/29] lib/stackdepot: Provide functions which operate on plain storage arrays

2019-04-18 Thread Thomas Gleixner
The struct stack_trace indirection in the stack depot functions is a truly pointless excercise which requires horrible code at the callsites. Provide interfaces based on plain storage arrays. Signed-off-by: Thomas Gleixner Acked-by: Alexander Potapenko --- include/linux/stackdepot.h |4

[Intel-gfx] [patch V2 21/29] tracing: Use percpu stack trace buffer more intelligently

2019-04-18 Thread Thomas Gleixner
execution pathes. Signed-off-by: Thomas Gleixner Cc: Steven Rostedt --- kernel/trace/trace.c | 77 +-- 1 file changed, 39 insertions(+), 38 deletions(-) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2749,12 +2749,21 @@ trace_function

[Intel-gfx] [patch V2 26/29] stacktrace: Remove obsolete functions

2019-04-18 Thread Thomas Gleixner
No more users of the struct stack_trace based interfaces. Remove them. Remove the macro stubs for !CONFIG_STACKTRACE as well as they are pointless because the storage on the call sites is conditional on CONFIG_STACKTRACE already. No point to be 'smart'. Signed-off-by: Thoma

[Intel-gfx] [patch V2 01/29] tracing: Cleanup stack trace code

2019-04-18 Thread Thomas Gleixner
print() as it's using the stack_trace_ namespace. Free the name up for stack trace related functions. Signed-off-by: Thomas Gleixner Cc: Steven Rostedt --- V2: Add more cleanups and use print_max_stack() as requested by Steven. --- include/linux/ftrace.h | 18 -- ke

[Intel-gfx] [patch V2 00/29] stacktrace: Consolidate stack trace usage

2019-04-18 Thread Thomas Gleixner
This is an update to V1: https://lkml.kernel.org/r/20190410102754.387743...@linutronix.de Struct stack_trace is a sinkhole for input and output parameters which is largely pointless for most usage sites. In fact if embedded into other data structures it creates indirections and extra storage ove

[Intel-gfx] [patch V2 16/29] drm: Simplify stacktrace handling

2019-04-18 Thread Thomas Gleixner
pointer in the stack_trace struct so it points to the depot storage. Signed-off-by: Thomas Gleixner Cc: intel-gfx@lists.freedesktop.org Cc: Joonas Lahtinen Cc: Maarten Lankhorst Cc: dri-de...@lists.freedesktop.org Cc: David Airlie Cc: Jani Nikula Cc: Daniel Vetter Cc: Rodrigo Vivi

[Intel-gfx] [patch V2 05/29] proc: Simplify task stack retrieval

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Reviewed-by: Alexey Dobriyan Cc: Andrew Morton --- fs/proc/base.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) --- a/fs/proc

[Intel-gfx] [patch V2 27/29] lib/stackdepot: Remove obsolete functions

2019-04-18 Thread Thomas Gleixner
No more users of the struct stack_trace based interfaces. Signed-off-by: Thomas Gleixner Acked-by: Alexander Potapenko --- include/linux/stackdepot.h |4 lib/stackdepot.c | 20 2 files changed, 24 deletions(-) --- a/include/linux/stackdepot.h +++ b

[Intel-gfx] [patch V2 13/29] btrfs: ref-verify: Simplify stack trace retrieval

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Reviewed-by: Johannes Thumshirn Acked-by: David Sterba Cc: Chris Mason Cc: Josef Bacik Cc: linux-bt...@vger.kernel.org --- fs/btrfs/ref-verify.c | 15

[Intel-gfx] [patch V2 06/29] latency_top: Simplify stack trace handling

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner --- kernel/latencytop.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) --- a/kernel/latencytop.c +++ b/kernel/latencytop.c

[Intel-gfx] [patch V2 11/29] fault-inject: Simplify stacktrace retrieval

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Cc: Akinobu Mita --- lib/fault-inject.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) --- a/lib/fault-inject.c +++ b/lib/fault

[Intel-gfx] [patch V2 24/29] tracing: Remove the last struct stack_trace usage

2019-04-18 Thread Thomas Gleixner
Simplify the stack retrieval code by using the storage array based interface. Signed-off-by: Thomas Gleixner --- kernel/trace/trace_stack.c | 42 -- 1 file changed, 16 insertions(+), 26 deletions(-) --- a/kernel/trace/trace_stack.c +++ b/kernel/trace

[Intel-gfx] [patch V2 09/29] mm/kasan: Simplify stacktrace handling

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace by using the storage array based interfaces. Signed-off-by: Thomas Gleixner Acked-by: Dmitry Vyukov Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: kasan-...@googlegroups.com Cc: linux...@kvack.org --- mm/kasan/common.c | 30

[Intel-gfx] [patch V2 08/29] mm/kmemleak: Simplify stacktrace handling

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace by using the storage array based interfaces. Signed-off-by: Thomas Gleixner Cc: Catalin Marinas Cc: linux...@kvack.org --- mm/kmemleak.c | 24 +++- 1 file changed, 3 insertions(+), 21 deletions(-) --- a/mm/kmemleak.c

[Intel-gfx] [patch V2 20/29] tracing: Simplify stacktrace retrieval in histograms

2019-04-18 Thread Thomas Gleixner
The indirection through struct stack_trace is not necessary at all. Use the storage array based interface. Signed-off-by: Thomas Gleixner Cc: Steven Rostedt --- kernel/trace/trace_events_hist.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) --- a/kernel/trace

[Intel-gfx] [patch V2 14/29] dm bufio: Simplify stack trace retrieval

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Cc: dm-de...@redhat.com Cc: Mike Snitzer Cc: Alasdair Kergon --- drivers/md/dm-bufio.c | 15 ++- 1 file changed, 6 insertions(+), 9

[Intel-gfx] [patch V2 17/29] lockdep: Remove unused trace argument from print_circular_bug()

2019-04-18 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner --- kernel/locking/lockdep.c |9 - 1 file changed, 4 insertions(+), 5 deletions(-) --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -1522,10 +1522,9 @@ static inline int class_equal(struct loc } static noinline int

[Intel-gfx] [patch V2 25/29] livepatch: Simplify stack trace retrieval

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace by using the storage array based interfaces. Signed-off-by: Thomas Gleixner --- kernel/livepatch/transition.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) --- a/kernel/livepatch/transition.c +++ b/kernel

[Intel-gfx] [patch V2 10/29] mm/page_owner: Simplify stack trace handling

2019-04-18 Thread Thomas Gleixner
pointer in the stack_trace struct so it points to the depot storage. Signed-off-by: Thomas Gleixner Cc: linux...@kvack.org Cc: Mike Rapoport Cc: David Rientjes Cc: Andrew Morton --- mm/page_owner.c | 79 +++- 1 file changed, 28 insertions

[Intel-gfx] [patch V2 07/29] mm/slub: Simplify stack trace retrieval

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Cc: Andrew Morton Cc: Pekka Enberg Cc: linux...@kvack.org Cc: David Rientjes Cc: Christoph Lameter --- mm/slub.c | 12 1 file changed, 4

[Intel-gfx] [patch V2 04/29] backtrace-test: Simplify stack trace handling

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace by using the storage array based interfaces. Signed-off-by: Thomas Gleixner --- kernel/backtracetest.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) --- a/kernel/backtracetest.c +++ b/kernel/backtracetest.c @@ -48,19

[Intel-gfx] [patch V2 15/29] dm persistent data: Simplify stack trace handling

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. This results in less storage space and indirection. Signed-off-by: Thomas Gleixner Cc: dm-de...@redhat.com Cc: Mike Snitzer Cc: Alasdair Kergon --- drivers/md/persistent-data/dm-block

[Intel-gfx] [patch V2 18/29] lockdep: Move stack trace logic into check_prev_add()

2019-04-18 Thread Thomas Gleixner
comment there does not make sense either. It's all leftovers from historical lockdep code (cross release). Move the variable into check_prev_add() itself and cleanup the nonsensical checks and the pointless stack trace recording. Signed-off-by: Thomas Gleixner --- kernel/locking/lockdep.c |

[Intel-gfx] [patch V2 29/29] x86/stacktrace: Use common infrastructure

2019-04-18 Thread Thomas Gleixner
Replace the stack_trace_save*() functions with the new arch_stack_walk() interfaces. Signed-off-by: Thomas Gleixner Cc: linux-a...@vger.kernel.org --- arch/x86/Kconfig |1 arch/x86/kernel/stacktrace.c | 116 +++ 2 files changed, 20

[Intel-gfx] [patch V2 22/29] tracing: Make ftrace_trace_userstack() static and conditional

2019-04-18 Thread Thomas Gleixner
It's only used in trace.c and there is absolutely no point in compiling it in when user space stack traces are not supported. Signed-off-by: Thomas Gleixner Cc: Steven Rostedt --- kernel/trace/trace.c | 14 -- kernel/trace/trace.h |8 2 files changed, 8 inser

[Intel-gfx] [patch V2 28/29] stacktrace: Provide common infrastructure

2019-04-18 Thread Thomas Gleixner
duplicated code and allows to implement better filtering than 'skip number of entries' in the future without touching any architecture specific code. Signed-off-by: Thomas Gleixner Cc: linux-a...@vger.kernel.org --- include/linux/stacktrace.h | 38 + kernel/stacktrace.c

[Intel-gfx] [patch V2 19/29] lockdep: Simplify stack trace handling

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace by using the storage array based interfaces and storing the information is a small lockdep specific data structure. Signed-off-by: Thomas Gleixner --- include/linux/lockdep.h |9 +++-- kernel/locking/lockdep.c | 44

[Intel-gfx] [patch V2 23/29] tracing: Simplify stack trace retrieval

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace by using the storage array based interfaces. Signed-off-by: Thomas Gleixner Cc: Steven Rostedt --- kernel/trace/trace.c | 40 +--- 1 file changed, 13 insertions(+), 27 deletions(-) --- a/kernel/trace

[Intel-gfx] [patch V2 12/29] dma/debug: Simplify stracktrace retrieval

2019-04-18 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Cc: io...@lists.linux-foundation.org Cc: Robin Murphy Cc: Christoph Hellwig Cc: Marek Szyprowski --- kernel/dma/debug.c | 13 + 1 file

Re: [Intel-gfx] [patch V2 09/29] mm/kasan: Simplify stacktrace handling

2019-04-18 Thread Thomas Gleixner
On Thu, 18 Apr 2019, Andrey Ryabinin wrote: > On 4/18/19 11:41 AM, Thomas Gleixner wrote: > > Replace the indirection through struct stack_trace by using the storage > > array based interfaces. > > > > Signed-off-by: Thomas Gleixner > > Acked-by: Dmitry Vyukov

Re: [Intel-gfx] [patch V2 14/29] dm bufio: Simplify stack trace retrieval

2019-04-18 Thread Thomas Gleixner
On Thu, 18 Apr 2019, Alexander Potapenko wrote: > On Thu, Apr 18, 2019 at 11:06 AM Thomas Gleixner wrote: > > - save_stack_trace(&b->stack_trace); > > + b->stack_len = stack_trace_save(b->stack_entries, MAX_STACK, 2); > As noted in one of similar patche

Re: [Intel-gfx] [patch V2 28/29] stacktrace: Provide common infrastructure

2019-04-18 Thread Thomas Gleixner
On Thu, 18 Apr 2019, Mike Rapoport wrote: > On Thu, Apr 18, 2019 at 10:41:47AM +0200, Thomas Gleixner wrote: > > +/** > > + * arch_stack_walk - Architecture specific function to walk the stack > > + > > Nit: no '*' at line beginning makes kernel-doc u

Re: [Intel-gfx] [patch V2 03/29] lib/stackdepot: Provide functions which operate on plain storage arrays

2019-04-18 Thread Thomas Gleixner
On Thu, 18 Apr 2019, Mike Rapoport wrote: > On Thu, Apr 18, 2019 at 10:41:22AM +0200, Thomas Gleixner wrote: > > > > -void depot_fetch_stack(depot_stack_handle_t handle, struct stack_trace > > *trace) > > +/** > > + * stack_depot_fetch - Fetch stack entries from

Re: [Intel-gfx] [patch V2 28/29] stacktrace: Provide common infrastructure

2019-04-18 Thread Thomas Gleixner
On Thu, 18 Apr 2019, Josh Poimboeuf wrote: > On Thu, Apr 18, 2019 at 10:41:47AM +0200, Thomas Gleixner wrote: > > All architectures which support stacktrace carry duplicated code and > > do the stack storage and filtering at the architecture side. > > > > Provide a co

Re: [Intel-gfx] [patch V2 21/29] tracing: Use percpu stack trace buffer more intelligently

2019-04-18 Thread Thomas Gleixner
On Thu, 18 Apr 2019, Steven Rostedt wrote: > On Thu, 18 Apr 2019 10:41:40 +0200 > Thomas Gleixner wrote: > > -static DEFINE_PER_CPU(struct ftrace_stack, ftrace_stack); > > +/* This allows 8 level nesting which is plenty */ > > Can we make this 4 level nesting and increase

Re: [Intel-gfx] [patch V2 01/29] tracing: Cleanup stack trace code

2019-04-18 Thread Thomas Gleixner
On Thu, 18 Apr 2019, Josh Poimboeuf wrote: > On Thu, Apr 18, 2019 at 10:41:20AM +0200, Thomas Gleixner wrote: > > - Remove the extra array member of stack_dump_trace[]. It's not required as > > the stack tracer stores at max array size - 1 entries so there is still

Re: [Intel-gfx] [patch V2 01/29] tracing: Cleanup stack trace code

2019-04-18 Thread Thomas Gleixner
On Thu, 18 Apr 2019, Steven Rostedt wrote: > On Thu, 18 Apr 2019 10:41:20 +0200 > Thomas Gleixner wrote: > > > @@ -412,23 +404,20 @@ stack_trace_sysctl(struct ctl_table *tab > >void __user *buffer, size_t *lenp, > >loff_t *ppos) > >

Re: [Intel-gfx] [patch V2 28/29] stacktrace: Provide common infrastructure

2019-04-19 Thread Thomas Gleixner
On Fri, 19 Apr 2019, Peter Zijlstra wrote: > On Thu, Apr 18, 2019 at 10:41:47AM +0200, Thomas Gleixner wrote: > > > +typedef bool (*stack_trace_consume_fn)(void *cookie, unsigned long addr, > > + bool reliable); > >

Re: [Intel-gfx] [patch V2 18/29] lockdep: Move stack trace logic into check_prev_add()

2019-04-24 Thread Thomas Gleixner
On Wed, 24 Apr 2019, Peter Zijlstra wrote: > On Thu, Apr 18, 2019 at 10:41:37AM +0200, Thomas Gleixner wrote: > > There is only one caller of check_prev_add() which hands in a zeroed struct > > stack trace and a function pointer to save_stack(). Inside check_prev_add() > > t

[Intel-gfx] [patch V3 01/29] tracing: Cleanup stack trace code

2019-04-25 Thread Thomas Gleixner
which are only used in trace_stack.c static. - Simplify the enable/disable logic. - Rename stack_trace_print() as it's using the stack_trace_ namespace. Free the name up for stack trace related functions. Signed-off-by: Thomas Gleixner Reviewed-by: Steven Rostedt --- V3: Remove the -1 ini

[Intel-gfx] [patch V3 10/29] mm/page_owner: Simplify stack trace handling

2019-04-25 Thread Thomas Gleixner
pointer in the stack_trace struct so it points to the depot storage. Signed-off-by: Thomas Gleixner Cc: linux...@kvack.org Cc: Mike Rapoport Cc: David Rientjes Cc: Andrew Morton --- mm/page_owner.c | 79 +++- 1 file changed, 28 insertions

[Intel-gfx] [patch V3 06/29] latency_top: Simplify stack trace handling

2019-04-25 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner --- kernel/latencytop.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) --- a/kernel/latencytop.c +++ b/kernel/latencytop.c

[Intel-gfx] [patch V3 16/29] drm: Simplify stacktrace handling

2019-04-25 Thread Thomas Gleixner
pointer in the stack_trace struct so it points to the depot storage. Signed-off-by: Thomas Gleixner Acked-by: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org Cc: Joonas Lahtinen Cc: Maarten Lankhorst Cc: dri-de...@lists.freedesktop.org Cc: David Airlie Cc: Jani Nikula Cc: Rodrigo Vivi

[Intel-gfx] [patch V3 08/29] mm/kmemleak: Simplify stacktrace handling

2019-04-25 Thread Thomas Gleixner
Replace the indirection through struct stack_trace by using the storage array based interfaces. Signed-off-by: Thomas Gleixner Acked-by: Catalin Marinas Cc: linux...@kvack.org --- mm/kmemleak.c | 24 +++- 1 file changed, 3 insertions(+), 21 deletions(-) --- a/mm

[Intel-gfx] [patch V3 12/29] dma/debug: Simplify stracktrace retrieval

2019-04-25 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Reviewed-by: Christoph Hellwig Cc: io...@lists.linux-foundation.org Cc: Robin Murphy Cc: Marek Szyprowski --- kernel/dma/debug.c | 14 ++ 1

[Intel-gfx] [patch V3 07/29] mm/slub: Simplify stack trace retrieval

2019-04-25 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Acked-by: Christoph Lameter Cc: Andrew Morton Cc: Pekka Enberg Cc: linux...@kvack.org Cc: David Rientjes --- mm/slub.c | 12 1 file

[Intel-gfx] [patch V3 18/29] lockdep: Remove save argument from check_prev_add()

2019-04-25 Thread Thomas Gleixner
There is only one caller which hands in save_trace as function pointer. Signed-off-by: Thomas Gleixner --- kernel/locking/lockdep.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2158,8 +2158,7

[Intel-gfx] [patch V3 15/29] dm persistent data: Simplify stack trace handling

2019-04-25 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. This results in less storage space and indirection. Signed-off-by: Thomas Gleixner Cc: dm-de...@redhat.com Cc: Mike Snitzer Cc: Alasdair Kergon --- drivers/md/persistent-data/dm-block

[Intel-gfx] [patch V3 26/29] stacktrace: Remove obsolete functions

2019-04-25 Thread Thomas Gleixner
No more users of the struct stack_trace based interfaces. Remove them. Remove the macro stubs for !CONFIG_STACKTRACE as well as they are pointless because the storage on the call sites is conditional on CONFIG_STACKTRACE already. No point to be 'smart'. Signed-off-by: Thoma

[Intel-gfx] [patch V3 19/29] lockdep: Simplify stack trace handling

2019-04-25 Thread Thomas Gleixner
Replace the indirection through struct stack_trace by using the storage array based interfaces and storing the information is a small lockdep specific data structure. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) --- include/linux/lockdep.h |9 +-- kernel/locking

[Intel-gfx] [patch V3 13/29] btrfs: ref-verify: Simplify stack trace retrieval

2019-04-25 Thread Thomas Gleixner
Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Reviewed-by: Johannes Thumshirn Acked-by: David Sterba Cc: Chris Mason Cc: Josef Bacik Cc: linux-bt...@vger.kernel.org --- fs/btrfs/ref-verify.c | 15

  1   2   3   >