Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1297022pxk; Mon, 31 Aug 2020 15:36:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWauX9KQQMofSBK/wErtKfWkNjrZQ9lSOJIpf5CtfS3fNV87uY5AIkqHnKMPnsYsKQv858 X-Received: by 2002:aa7:ca4f:: with SMTP id j15mr3099093edt.378.1598913388473; Mon, 31 Aug 2020 15:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598913388; cv=none; d=google.com; s=arc-20160816; b=NUGkCu5c4Xp9guBBZHOVJTWcNx7A1VFg5ylf9ZXrQdoUz4T8db43GcVdAP8EZVQVi0 TqVcAF8vM8mzJJVwFQBXAU0Vdybnu16i+YdjWV/eqAKLuDjSwajgpEi/t7+buyBN43eh i7xzwOL6tyxF01iCYFMyQQ8UR+EKTY/uhB27eW0NpUqP7EqWjfrAS/WbxE0+QvPtE+db aNH4xd5Lw4i5XbIV/Amy1X79bViYS0o0Qr3XInSBIJIxn5eH2qatGCTf8lYqTvBxqEa2 xJTP2c3huxKuiljzxAgm14+S2OYDRRUNhyxqoNT+1xCALxSBJtZMsU/W0CjF/6eS/ELt JQTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1cLKbrfJy/ZGWttaSw8KlAZUFaKAWrS+yHm9C8wTwuc=; b=ThZrSnglFEO+/0EsqbrnXIqQjry6zG8uk5a10BIbuuXd6qtHXEiPbjPQSEAV3UGlNr HiTSuhozYzLugj2syNDSi7OA638vXmP//JikW+WtkqRetXlGKyRHyf3dicj1dOyxVZuN Mf6QLYozxSkthlU7kZzzDoLMO44YR73t8ss9iuvYk7HFXgczgEviVe31ey4dxB374NVB v8wJuLHHk0biw8qjMvKla9PC2idS1s12vM0nac80IyiHWYy2+ZUSv1ZccY16rlQ28vbx A1+/FdYIbGsLHMfOFy0my+IwwajrZKGnLPErnudrTwZcAcraXofGH7PDaOof68oNv0fv Otfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BzO7N1IJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si5653743edv.593.2020.08.31.15.36.05; Mon, 31 Aug 2020 15:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BzO7N1IJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727977AbgHaStW (ORCPT + 99 others); Mon, 31 Aug 2020 14:49:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbgHaStV (ORCPT ); Mon, 31 Aug 2020 14:49:21 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BB8C061573 for ; Mon, 31 Aug 2020 11:49:21 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id v54so4068783qtj.7 for ; Mon, 31 Aug 2020 11:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1cLKbrfJy/ZGWttaSw8KlAZUFaKAWrS+yHm9C8wTwuc=; b=BzO7N1IJW/105kqPoLoVuE1QamuzdOIPyBu8Oa2WvipHCs9Z5jp7KhYBcM9Iig/zPs OP1rWZL/QxUbGOf1lmYJ1ln8gZwftqbDc0JswX8TwvnfOoyZ/9YeH5LKXysxQJaPGrRX w16G9XhvTtIb7AqweRgYdhFXqj2RD1M7um6OWG8wVDHBdYhCFbPkWaZaL27hAxq9DNPC r8yO2HZbKJXKtZgT1G1FL1GXSalLRcUXZH4OSF//Q31hLIWN39bfNbZgT7y4gvnRgr2C lzWwpwbV4R2WP8hwpr/3tF0xkYVdvkFaP4FRobW4ekPuPliC6XALWAldtA1fE2ysqJEJ pvMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1cLKbrfJy/ZGWttaSw8KlAZUFaKAWrS+yHm9C8wTwuc=; b=Ovukd1tLBHg/cq/dJC6of2ngi/zjXwC0YQr/NErtmKbL/GxbEXYDUI+w+TjNZc7TPT 1W0fA5WHmZw73X8UT4dq4OViVMR++nu1v7TaR0HqKJgqdOLsM/1bcXtxkA/wHBkLkFyI Lnqj1Uea1h0b/e57sFnnOG3cDCKxOXngnYpHbbCnmUS873JG3Fh6h/bazlSNJqM2suKi 27g1K7NOjNFPG+rKk8ftXWYJAk6OhzScRXvN4rc/Ni/aWyLAXiMBlqeFpTZTa7QWE28N Sk/3PsGLP5Q7v5gmfptAoDvj4R/Uw8fToiHI195FOnfXWAENnE3YPr0eQ4+9rvVLl/3O kNbw== X-Gm-Message-State: AOAM531GzT2GzmllJCG4P8YAmaGVIRaOK7zDCKw1mrIjyD156tmmURdC uQh12gj3+IcsWEXrN3UOuIY= X-Received: by 2002:ac8:4248:: with SMTP id r8mr2635412qtm.218.1598899760454; Mon, 31 Aug 2020 11:49:20 -0700 (PDT) Received: from LeoBras.ibmuc.com ([2804:14d:8084:8e41:9b0d:571e:a65:b5d8]) by smtp.gmail.com with ESMTPSA id s17sm11779070qte.50.2020.08.31.11.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 11:49:19 -0700 (PDT) From: Leonardo Bras To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Leonardo Bras , Joel Stanley , Christophe Leroy , Nayna Jain , Eric Richter , Nicholas Piggin , Hari Bathini , Masahiro Yamada , Brian King , Murilo Fossa Vicentini , David Dai , Matthew Wilcox Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/2] DMA pagecache Date: Mon, 31 Aug 2020 15:48:57 -0300 Message-Id: <20200831184859.110660-1-leobras.c@gmail.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This RFC improves the performance of indirect mapping on all tested DMA usages, based on a mlx5 device, ranging from 64k packages to 1-byte packages, from 1 thread to 64 threads. In all workloads tested, the performance of indirect mapping gets very near to direct mapping case. The whole thing is designed to have as much perfomance as possible, so the impact of the pagecache is not too big. As I am not very experienced in XArrays usage, nor in lockless algorithms, I would specially appreaciate feedback on possible failures on it's usage, missing barriers, and so on. Also, this size for the FIFO is just for testing purposes. It's also very possible that it will not be a good idea in platforms other than pseries, (i have not tested them). I can plan I bypass for those cases without much work. Thank you! Leonardo Bras (2): dma-direction: Add DMA_DIR_COMPAT() macro to test direction compability powerpc/kernel/iommu: Introduce IOMMU DMA pagecache arch/powerpc/include/asm/iommu-cache.h | 31 ++++ arch/powerpc/include/asm/iommu.h | 4 + arch/powerpc/kernel/Makefile | 2 +- arch/powerpc/kernel/iommu-cache.c | 247 +++++++++++++++++++++++++ arch/powerpc/kernel/iommu.c | 15 +- include/linux/dma-direction.h | 3 + 6 files changed, 296 insertions(+), 6 deletions(-) create mode 100644 arch/powerpc/include/asm/iommu-cache.h create mode 100644 arch/powerpc/kernel/iommu-cache.c -- 2.25.4