[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG_fn=WP9+bVv9hedoaTzWK+xBzedxaGJGVOPnF0o115s-oWvg@mail.gmail.com>
Date: Thu, 18 Apr 2019 12:44:08 +0200
From: Alexander Potapenko <glider@...gle.com>
To: Thomas Gleixner <tglx@...utronix.de>
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>, dm-devel@...hat.com,
Mike Snitzer <snitzer@...hat.com>,
Alasdair Kergon <agk@...hat.com>,
Alexey Dobriyan <adobriyan@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Pekka Enberg <penberg@...nel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
David Rientjes <rientjes@...gle.com>,
Christoph Lameter <cl@...ux.com>,
Catalin Marinas <catalin.marinas@....com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
kasan-dev <kasan-dev@...glegroups.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, 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 14/29] dm bufio: Simplify stack trace retrieval
On Thu, Apr 18, 2019 at 11:06 AM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> Replace the indirection through struct stack_trace with an invocation of
> the storage array based interface.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Cc: dm-devel@...hat.com
> Cc: Mike Snitzer <snitzer@...hat.com>
> Cc: Alasdair Kergon <agk@...hat.com>
> ---
> drivers/md/dm-bufio.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> --- a/drivers/md/dm-bufio.c
> +++ b/drivers/md/dm-bufio.c
> @@ -150,7 +150,7 @@ struct dm_buffer {
> void (*end_io)(struct dm_buffer *, blk_status_t);
> #ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
> #define MAX_STACK 10
> - struct stack_trace stack_trace;
> + unsigned int stack_len;
> unsigned long stack_entries[MAX_STACK];
> #endif
> };
> @@ -232,11 +232,7 @@ static DEFINE_MUTEX(dm_bufio_clients_loc
> #ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
> static void buffer_record_stack(struct dm_buffer *b)
> {
> - b->stack_trace.nr_entries = 0;
> - b->stack_trace.max_entries = MAX_STACK;
> - b->stack_trace.entries = b->stack_entries;
> - b->stack_trace.skip = 2;
> - save_stack_trace(&b->stack_trace);
> + b->stack_len = stack_trace_save(b->stack_entries, MAX_STACK, 2);
As noted in one of similar patches before, can we have an inline
comment to indicate what does this "2" stand for?
> }
> #endif
>
> @@ -438,7 +434,7 @@ static struct dm_buffer *alloc_buffer(st
> adjust_total_allocated(b->data_mode, (long)c->block_size);
>
> #ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
> - memset(&b->stack_trace, 0, sizeof(b->stack_trace));
> + b->stack_len = 0;
> #endif
> return b;
> }
> @@ -1520,8 +1516,9 @@ static void drop_buffers(struct dm_bufio
> DMERR("leaked buffer %llx, hold count %u, list %d",
> (unsigned long long)b->block, b->hold_count, i);
> #ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
> - print_stack_trace(&b->stack_trace, 1);
> - b->hold_count = 0; /* mark unclaimed to avoid BUG_ON below */
> + stack_trace_print(b->stack_entries, b->stack_len, 1);
> + /* mark unclaimed to avoid BUG_ON below */
> + b->hold_count = 0;
> #endif
> }
>
>
>
--
Alexander Potapenko
Software Engineer
Google Germany GmbH
Erika-Mann-Straße, 33
80636 München
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Powered by blists - more mailing lists