Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5489190ybl; Tue, 10 Dec 2019 06:56:16 -0800 (PST) X-Google-Smtp-Source: APXvYqywWMBuoxGdza+Y5SWlB+Xh/v+bl4b8u2aLXhNvrqYNJzBt38BAKUEBho40ucA9zsb+egQt X-Received: by 2002:aca:1106:: with SMTP id 6mr4280975oir.75.1575989776334; Tue, 10 Dec 2019 06:56:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575989776; cv=none; d=google.com; s=arc-20160816; b=u/+bHhVHjl45BZoPeGrY+6EjBTU7rnJvwbiILU72auqkTRUNxxpk9dbxJY1UF5Po7p 3OkIrIRXK8e3dEU+fKe/RPKA9umGvBlkAiPIohwKi8S3ZPDbvC66ick76ShlW9Zwxfls QFYYm79IWFTT73Pj/IhbRP5Z21HSx0KSKaoKD6s9cYF+YLNbmlfO3NMFyta4Wdaa6VBT 3HbNxIKeGQn2lhP5rp5WOz4hxW0uvzvXPDicey+l9bzL1MEPZnyMBnYJRCbk/hh+zEhr 9rGVYzag7J7FV7zxY52hDmsfnt5yUqB7mDqasoGYBs3ptMJhRpE5DZxB2vVGtmRWS3kA sg/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=sxfx8pYcfnvd3lqW1qImtgwu7XzTFQuwrY147FPzqGI=; b=eueH1NfxlnbqLZaLNjLdZPMB81hgWbSFicD9/Dyp6bK24XlEqy6RMUDz2dm8YlgALu mMXO+iz/XiSKMf1+DgPqhD7sepIicoByIG5CnusQGbgOmNM2gQKTr+hVPEFM+fypnfaP iS5+osxeMr6TGMDQrwrcIamVwGfmKG/7FNLKQJmg4/fzmcZz9ackIkalS36EQYF0bItf 17Xzjiv1zawuV9INkvkfRW4NlJ+vMibfgl/ogz23au5YhixU7Fmsd6T65kjcdBrFR/3C q727phn1nDMF8/WBVTZTDhxGlRIXKlC6txvGBOVJ32JDhctnAX6lKDIQrYTC0z3imopy lWDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14si2006221ota.71.2019.12.10.06.56.03; Tue, 10 Dec 2019 06:56:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727597AbfLJOzU (ORCPT + 99 others); Tue, 10 Dec 2019 09:55:20 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:41533 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727420AbfLJOzT (ORCPT ); Tue, 10 Dec 2019 09:55:19 -0500 Received: by mail-ot1-f65.google.com with SMTP id r27so15701560otc.8; Tue, 10 Dec 2019 06:55:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sxfx8pYcfnvd3lqW1qImtgwu7XzTFQuwrY147FPzqGI=; b=YRyoRk57De2c4zcSJKKnR566euN0kLevtMG85WIwzl6M5FpKJB8pwbGP7AXKM/AxNd Nld0WUKfOFGhYIP/P9/7IIHExb8cIuXnM2VW/xex87Lf5HVnpdP+yYZU174NpKDyQRqc 2lQt2tl7oYMNaEalKntzAUizrWIu8B49ampjbXzPOC4n2KaUwLcPzTLHIk2VqO4abL8n QjNJ1sFFblQfRywwVVOrgjukQnGbtxQ9ISQBA+XLye86Jh/jJc/lzK6TjDoOQ5pheEkr LmVFfg6HKM+rjMQ2DaOyJQ4QOd2/zeDn5oj/guSfnIwQvfgcJ55XIdh1eE8uDWCdC3U1 CXtg== X-Gm-Message-State: APjAAAWk81x3IigLOJ6XIdcsylnqR2yoJuBQKGsBAL23Rtm7sziZQ8S+ x6acJ/4ojIc5MjGLF5ICbGRdyGWB1Sgva0N0gRY= X-Received: by 2002:a9d:6c81:: with SMTP id c1mr24883423otr.39.1575989718977; Tue, 10 Dec 2019 06:55:18 -0800 (PST) MIME-Version: 1.0 References: <20191030184844.84219-1-edumazet@google.com> In-Reply-To: <20191030184844.84219-1-edumazet@google.com> From: Geert Uytterhoeven Date: Tue, 10 Dec 2019 15:55:08 +0100 Message-ID: Subject: Re: [PATCH] dma-debug: increase HASH_SIZE To: Eric Dumazet Cc: Christoph Hellwig , linux-kernel , Eric Dumazet , Marek Szyprowski , Linux-Renesas Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 30, 2019 at 8:13 PM Eric Dumazet 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 > Cc: Christoph Hellwig > Cc: Marek Szyprowski > --- > 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 > > -#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@linux-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