[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1904181350080.3174@nanos.tec.linutronix.de>
Date: Thu, 18 Apr 2019 13:53:26 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Andrey Ryabinin <aryabinin@...tuozzo.com>
cc: LKML <linux-kernel@...r.kernel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>, x86@...nel.org,
Andy Lutomirski <luto@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com,
linux-mm@...ck.org, Alexey Dobriyan <adobriyan@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Christoph Lameter <cl@...ux.com>,
Catalin Marinas <catalin.marinas@....com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Akinobu Mita <akinobu.mita@...il.com>,
iommu@...ts.linux-foundation.org,
Robin Murphy <robin.murphy@....com>,
Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Johannes Thumshirn <jthumshirn@...e.de>,
David Sterba <dsterba@...e.com>, Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>,
linux-btrfs@...r.kernel.org, dm-devel@...hat.com,
Mike Snitzer <snitzer@...hat.com>,
Alasdair Kergon <agk@...hat.com>,
intel-gfx@...ts.freedesktop.org,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
dri-devel@...ts.freedesktop.org, David Airlie <airlied@...ux.ie>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Daniel Vetter <daniel@...ll.ch>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
linux-arch@...r.kernel.org
Subject: Re: [patch V2 09/29] mm/kasan: Simplify stacktrace handling
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 <tglx@...utronix.de>
> > Acked-by: Dmitry Vyukov <dvyukov@...gle.com>
> > Cc: Andrey Ryabinin <aryabinin@...tuozzo.com>
> > Cc: Alexander Potapenko <glider@...gle.com>
> > Cc: kasan-dev@...glegroups.com
> > Cc: linux-mm@...ck.org
>
> Acked-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
>
> >
> > static inline depot_stack_handle_t save_stack(gfp_t flags)
> > {
> > unsigned long entries[KASAN_STACK_DEPTH];
> > - struct stack_trace trace = {
> > - .nr_entries = 0,
> > - .entries = entries,
> > - .max_entries = KASAN_STACK_DEPTH,
> > - .skip = 0
> > - };
> > + unsigned int nr_entries;
> >
> > - save_stack_trace(&trace);
> > - filter_irq_stacks(&trace);
> > -
> > - return depot_save_stack(&trace, flags);
> > + nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 0);
> > + nr_entries = filter_irq_stacks(entries, nr_entries);
> > + return stack_depot_save(entries, nr_entries, flags);
>
> Suggestion for further improvement:
>
> stack_trace_save() shouldn't unwind beyond irq entry point so we wouldn't
> need filter_irq_stacks(). Probably all call sites doesn't care about
> random stack above irq entry point, so it doesn't make sense to spend
> resources on unwinding non-irq stack from interrupt first an filtering
> out it later.
There are users which care about the full trace.
Once we have cleaned up the whole architeture side, we can add core side
filtering which allows to
1) replace the 'skip number of entries at the beginning
2) stop the trace when it reaches a certain point
Right now, I don't want to change any of this until the whole mess is
consolidated.
Thanks,
tglx
Powered by blists - more mailing lists