Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp118625ybx; Wed, 30 Oct 2019 12:15:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWe124dKGtXvytOMzEAAlyDCWcByw7W9D3RJ4yXYXpjYlZElPqyFAb68NEFmrXNC7rwB3m X-Received: by 2002:a17:906:c444:: with SMTP id ck4mr1235820ejb.110.1572462904516; Wed, 30 Oct 2019 12:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572462904; cv=none; d=google.com; s=arc-20160816; b=N4fg+i2FFNlBsCHfJlJJ/CLqug8AGCxsPOIFF4tJRyGWXJ6ufYxA28mwGevGtX8AW8 QsJu2AVfILiz1//bCCcE541+9tpv4Uy0pDrxlMWpwkW67jX9+H50oxr+87KQ8/HDTDrm x44hnEXaG/T7vt4cxguAUsc8HoO1WTgq6FQ5LsP20ABvTHRe3dCZ8jfFXun8HrXHXMe8 58ryM35DK8qOOzoSW5DVuWM3IQ1vcXfGqn3V94IHHut0u0pFv8zgpuHHlrfna6yCx3yj Sl8ltnjoTIPzxq0dK/4azoXDD4vdKP9o5uDt9cotfAK3wCW4tmLnez4xW8bYK+fuJliK ibuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=RxCCtsUMffCpcw7QGLE4bk1qQR+dpNRsJ71EwxdG0Xk=; b=ShEXjnx2bK8ZcB9W90/pBiWpZcjnVCA5xcl/LNWAr4x6pWRgIq9hLUxpoACnxj7ElQ rWiBiRTRXOzQ18csIf9/1m0nY7VyZsFCADiiZTyFkHJtqlJgHqLiTRXNAtKBPtDdbb5p 6TLfUOgsNJzsukBatlLw44k46cPCm0QlgIo/26KAuRUxGN3Y65DlqoFzLNFat0BHRoyW R5OQt9cInapcwBhyqDQZrcfgV1Sdp3yzN5ga8MXpK4XLJv7UNwplHEWqjNFwZiwZe+Hp 7UeE+5bl/qhsuhVeEStYlnJSb/kC4+xPPESCb6G1jFNU86VZ429AA4AtU+xtHOqBYEVc D0LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OrTeov0M; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f36si2078888ede.159.2019.10.30.12.14.40; Wed, 30 Oct 2019 12:15:04 -0700 (PDT) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=OrTeov0M; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbfJ3Sst (ORCPT + 99 others); Wed, 30 Oct 2019 14:48:49 -0400 Received: from mail-pl1-f202.google.com ([209.85.214.202]:45977 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726509AbfJ3Sst (ORCPT ); Wed, 30 Oct 2019 14:48:49 -0400 Received: by mail-pl1-f202.google.com with SMTP id c8so2127882pll.12 for ; Wed, 30 Oct 2019 11:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=RxCCtsUMffCpcw7QGLE4bk1qQR+dpNRsJ71EwxdG0Xk=; b=OrTeov0MyfaAmSyyfPGPKLg0eXpE53ZgPavJXpQQS8qz/f0XZUwmrS2wwKKaB2XVNc DXZZ9vO41W/XihEybrbg3MGHikco/mfRz7ijImQGna9k0suLyvKl+OquRhFNdJTZ6Ddl U7/wo9xULrSL3vFbr+mfi2XlI1z081HHasdMygINPFdd3zFw0Q2D36PmcAZVesg9OgZn flYWUHl0Xqkoa5L/fXKxQRNABEIMyfEdcCm64me3SzYZpN2taFoxBIcD59LaHk10iTAx g3CWUGR6buA84/x7ICNTEUKHOKc35SQuvHkXLF4colim3CrzEqYB2fba4zqGxTLNKiEf oK0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=RxCCtsUMffCpcw7QGLE4bk1qQR+dpNRsJ71EwxdG0Xk=; b=Zw8csCFRsTGgQ1WoxrwtT8Bh1gua7KFFi0w8Bv9l2rGMZmaciagaKl9TfN8EuMDQv9 HH9rnKz2FC+irqoOX9k1EWCG+EwfCyiY7nZ6tSZdAY5ZIeODazxAeL6n4p8ojVNVHKOa b/Xcd7bmB10dpVBa2q3R2YLXDUkcgDD4DQRuESk0a8RbINb8o58f5Z2ZCSKlSZAhtvP8 W+5Hicx+F115hT8mVyhv8FsN6lXrGr21LS5d01zwB4fcr9A8PwYilhp8uZ5AIpVdEoDD feA7SHPDOR/A9O9/d+RG3SsdyHubepcSGMU5uOC/wVZh5ds6mwZ/P2HCTSLhOwALiYwF aBNA== X-Gm-Message-State: APjAAAVoxnOvroQ2J38Ktgystw7BNhKDVOnBaZFmvvvx4dnyEQ8rl3tu mzEwnLN+JsgCPVVBKzLB9g7VPG0ouEt4PA== X-Received: by 2002:a63:dd17:: with SMTP id t23mr1081237pgg.134.1572461328271; Wed, 30 Oct 2019 11:48:48 -0700 (PDT) Date: Wed, 30 Oct 2019 11:48:44 -0700 Message-Id: <20191030184844.84219-1-edumazet@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog Subject: [PATCH] dma-debug: increase HASH_SIZE From: Eric Dumazet To: Christoph Hellwig Cc: linux-kernel , Eric Dumazet , Eric Dumazet , Marek Szyprowski 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 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]; -- 2.24.0.rc0.303.g954a862665-goog