From: Christoph Hellwig <hch@lst.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Eric Dumazet <edumazet@google.com>,
Christoph Hellwig <hch@lst.de>,
linux-kernel <linux-kernel@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH] dma-debug: increase HASH_SIZE
Date: Thu, 30 Jan 2020 17:27:40 +0100 [thread overview]
Message-ID: <20200130162740.GA6429@lst.de> (raw)
In-Reply-To: <CAMuHMdVK=dUxhJh1pjLe4bGn3V=FHJ_90oga0USRBw-wSqd8Pw@mail.gmail.com>
On Tue, Dec 10, 2019 at 03:55:08PM +0100, Geert Uytterhoeven wrote:
> On Wed, Oct 30, 2019 at 8:13 PM Eric Dumazet <edumazet@google.com> wrote:
> > With modern NIC, it is not unusual having about ~256,000 active dma
> > mappings. Hash size of 1024 buckets is too small.
> >
> > Forcing full cache line per bucket does not seem useful,
> > especially now that we have a contention on free_entries_lock
> > for allocations and freeing of entries. Better using space
> > to fit more buckets.
> >
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Cc: Christoph Hellwig <hch@lst.de>
> > Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> > ---
> > kernel/dma/debug.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
> > index 4ad74f5987ea9e95f9bb5e2d1592254e367d24fb..35e2a853bff9c482d789ab331d79aaee07753a97 100644
> > --- a/kernel/dma/debug.c
> > +++ b/kernel/dma/debug.c
> > @@ -27,7 +27,7 @@
> >
> > #include <asm/sections.h>
> >
> > -#define HASH_SIZE 1024ULL
> > +#define HASH_SIZE 16384ULL
> > #define HASH_FN_SHIFT 13
> > #define HASH_FN_MASK (HASH_SIZE - 1)
> >
> > @@ -87,7 +87,7 @@ typedef bool (*match_fn)(struct dma_debug_entry *, struct dma_debug_entry *);
> > struct hash_bucket {
> > struct list_head list;
> > spinlock_t lock;
> > -} ____cacheline_aligned_in_smp;
> > +};
> >
> > /* Hash list to save the allocated dma addresses */
> > static struct hash_bucket dma_entry_hash[HASH_SIZE];
>
> JFTR, this increases dma_entry_hash size by 327680 bytes, and pushes
> a few more boards beyond their bootloader-imposed kernel size limits.
>
> Disabling CONFIG_DMA_API_DEBUG fixes that.
> Of course the real fix is to fix the bootloaders...
Can someone just send a patch to switch this to a dynamic allocation?
next prev parent reply other threads:[~2020-01-30 16:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 18:48 Eric Dumazet
2019-11-07 17:44 ` Christoph Hellwig
2019-12-10 14:55 ` Geert Uytterhoeven
2019-12-10 15:04 ` Eric Dumazet
2019-12-10 15:07 ` Geert Uytterhoeven
2020-01-30 16:27 ` Christoph Hellwig [this message]
2020-01-30 16:43 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200130162740.GA6429@lst.de \
--to=hch@lst.de \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome