Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2600103ybm; Thu, 23 May 2019 21:09:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgL4wXeJ2Wk4yOlv+TGiNEIgE01bKC6XDCHHhZ61UsfmS0KLi4zedqhyXPaTQh2Jjz54L3 X-Received: by 2002:aa7:8219:: with SMTP id k25mr17058762pfi.38.1558670997154; Thu, 23 May 2019 21:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558670997; cv=none; d=google.com; s=arc-20160816; b=E9b+tv7+dkxK2Qk+92TdWzaczcr9fuqluAzHbmCJpvB+0OQK56qnigt7w5SFMypT4g IrhZxM28lQHq8ryXXpnt7PocoeD0QMBWWE6Z/5ii1nR2vMMUGnJo32TH6QP4t0BFXgx+ it8ZmNuNu/j337jmo9sneEum+K+ZWoyMFt6cade8SxyH/rgXVoyunBAhtyy1PCEKirqC +YLkfEpPUzF4dMsXDfD6m5LQ0y55phpvx1A3zRlxkgPiPH36iPzdkfBskmb/ocnCt5MN c0F8CmNVBzwR97GIpfhiT79blcYKLYiLIbaLQg34VPhEL/Bjofa1RGKeqGiUxJmo8Nmc mw4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=s74YDk11h63m3BV7XOfnkCuG6v9uaJVVe9rNVON22hw=; b=u5s90MvWb+L1MyFpjDl4Rcsz8UD5IS9BcZQvBHWNnb8tEb4vyhPBEVvY0hhRPixB5E gs2Lf31kFP+pZ1S/N/SFdrXGoefOM/jBd7Yasq2ldei6sbGllpjsWtxXuVfKaFiusQtT h9kYEZ3ZmCgNobw4aIWRd8jmJBjDKeSCFgW0al7h+NUQ3/Dl7kkfU3BPk8VcAsDby1+k EVe/1F7gF0Cm1Wdn+WLjSX/B9n2G5/uwOjuRuGgerA5T6RnNWMEAGjCqsjwrNOIAjVu/ KmRG0RN8vD260qP24Eew52paeFiOaEdhhHohyoYBxHRHnI0/eRtd4Sx8LETN1gN/o45O Y/tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d4pWEaoD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q40si2312812pjb.17.2019.05.23.21.09.36; Thu, 23 May 2019 21:09:57 -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=@gmail.com header.s=20161025 header.b=d4pWEaoD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726988AbfEXEIE (ORCPT + 99 others); Fri, 24 May 2019 00:08:04 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38741 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbfEXEID (ORCPT ); Fri, 24 May 2019 00:08:03 -0400 Received: by mail-pg1-f194.google.com with SMTP id v11so4278683pgl.5 for ; Thu, 23 May 2019 21:08:03 -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; bh=s74YDk11h63m3BV7XOfnkCuG6v9uaJVVe9rNVON22hw=; b=d4pWEaoDp8VDALdkCMCsdpaApDEtbf5qlmNVmtFaBu1dLqdJeDQAeAOVmLHxFoOH2T 0KPvaAWTEKyeMBhm+4UC/dQvOjY/nwyM/qO/nbiRmBo9pAvmEWRw/GbN6v2yEXKE6Uif 1IVZz6BJJxpjuO+gvH0PYvuK5AFQh4McrEeM76gok5/33Q0ciesPflsroAVXZ5CsyzON H9/F8sXGiqPEYQIxTFKTAnibA8qNWGGUiMepgWhsAhmj72HmkGQ6ip5T7JMixrDb59Q5 1AG8HJWjKIuoZaWZHwFRH4weX2//KEgT50ICzsbyxb+ZFJk+oWktK+KDA2/H+LGKg1UJ zN0A== 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; bh=s74YDk11h63m3BV7XOfnkCuG6v9uaJVVe9rNVON22hw=; b=b6OJbwa+VfYQ32XpSjJ+X3+rGT9bAF1wpff1IK0hN+65A3Wr6hqpF9LlAXJ3q96U54 1uFcubNdcNcW6g/QqVwBPzbEEdGu9B/uYGkYvNTzuB2Vk8XNGPRuuI+ytxAsaZcLTVvX XAJ86Qu0eXuHOqEgMbClYbJ5xg5pM53Ie+gbYyFNJ429PokWBltjHDuWChC6kKNpW25v zcyaTPO8V+d3xrbzGB00FpbW8DMDBm/VWaQ5N1EZ9PoBxE/oxYpG6ZFaOoaNU97G50a5 qDuPUWOSzJ/NTR6A01AEI6fOSeUbATrbl19KRGXucR/AvTa7kSHk0mZ75SwELjDSl1+1 /1ug== X-Gm-Message-State: APjAAAXGCDCN7mQ+Lq/vjMoM7YzrWFFZk56MVkXtUEf5SjVibxB6Eakv frUZiky+1kUhabX/+mA/nWI= X-Received: by 2002:aa7:9aa5:: with SMTP id x5mr18456270pfi.135.1558670882701; Thu, 23 May 2019 21:08:02 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id e123sm786412pgc.29.2019.05.23.21.08.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 21:08:02 -0700 (PDT) From: Nicolin Chen To: hch@lst.de, robin.murphy@arm.com, m.szyprowski@samsung.com Cc: vdumpa@nvidia.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, chris@zankel.net, jcmvbkbc@gmail.com, joro@8bytes.org, dwmw2@infradead.org, tony@atomide.com, akpm@linux-foundation.org, sfr@canb.auug.org.au, treding@nvidia.com, keescook@chromium.org, iamjoonsoo.kim@lge.com, wsa+renesas@sang-engineering.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-xtensa@linux-xtensa.org, iommu@lists.linux-foundation.org, dann.frazier@canonical.com Subject: [PATCH v3 0/2] Optimize dma_*_from_contiguous calls Date: Thu, 23 May 2019 21:06:31 -0700 Message-Id: <20190524040633.16854-1-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Per discussion at v1, we decide to add two new functions and start replacing callers one by one. For this series, it only touches the dma-direct part. And instead of merging two PATCHes, I still keep them separate so that we may easily revert PATCH-2 if anything bad happens as last time -- PATCH-1 is supposed to be a safe cleanup. ] This series of patches try to optimize dma_*_from_contiguous calls: PATCH-1 abstracts two new functions and applies to dma-direct.c file. PATCH-2 saves single pages and reduce fragmentations from CMA area. Please check their commit messages for detail changelog. Nicolin Chen (2): dma-contiguous: Abstract dma_{alloc,free}_contiguous() dma-contiguous: Use fallback alloc_pages for single pages include/linux/dma-contiguous.h | 11 +++++++ kernel/dma/contiguous.c | 57 ++++++++++++++++++++++++++++++++++ kernel/dma/direct.c | 24 +++----------- 3 files changed, 72 insertions(+), 20 deletions(-) -- 2.17.1