lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVK=dUxhJh1pjLe4bGn3V=FHJ_90oga0USRBw-wSqd8Pw@mail.gmail.com>
Date:   Tue, 10 Dec 2019 15:55:08 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Christoph Hellwig <hch@....de>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCH] dma-debug: increase HASH_SIZE

On Wed, Oct 30, 2019 at 8:13 PM Eric Dumazet <edumazet@...gle.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@...gle.com>
> Cc: Christoph Hellwig <hch@....de>
> Cc: Marek Szyprowski <m.szyprowski@...sung.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...

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ