Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp885786ybi; Fri, 24 May 2019 13:07:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqn8rVGf+IMkkgRyayUCG9rYhqrgTjVV8iMqXMeOZufY1M4/PmqL1ULkUMuuyN7DdgJlOh X-Received: by 2002:a17:90a:7184:: with SMTP id i4mr11943369pjk.49.1558728443345; Fri, 24 May 2019 13:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558728443; cv=none; d=google.com; s=arc-20160816; b=eTrT6+qmNpCeI4hEp2ciXVSkQQ8S2y5X6yOJrvpmLzUQWoohQKNZMnBtWKBhMlxizL QF01YKKrn0UBuMtn+0b0KZ4/WuRtLdk4qrFFAzfmMdqP0xRv7eE3UPgCrPrJUgkOY/ZW lETJpWex/6gpgQmqyiQE/MWDIF255VfnMF59jBmJmA4FliEXKor4JtWFA9Y7LXhPfoWf qH6w3Um0SXUjAlr+4Xn4JEoKuL28HnEgdyCoUjCElsDeYdkF3qw+Kky7BTCoAP3hKSyn V0vTLfi76mcfr1kYQbuN4REIv6VGYf0PumxRxP/Gg+RV/3bEimb7uwjmVKeVB9Ead+Pa YuRQ== 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=MdZgSrzvQrNvArhhMwV6uq98L6kGwXydzTCUTc3ed/4=; b=xE8O+DIv2w33djnPNxzVJrI8l6PD0UuB6PYaJhD3Jxyn/VFp19IUUXGU3AMdlQVZdi CI3PHe4+YCNOeXUqDQkTGU6C0cFS9+CSG1/Pzl8e+ZeNEX32B6xL72zWoq8NC+yOBzGi RzG1crgXuHssVR8yFlBvR9kE4sugVaoCQryCWVIvPVchlyWcVVKL+o0lnr4NeGgeXF4r 8YPHVtnjFJ8/Ye88D5DaXlYSSlHLN90zqZ+KW/+o1yGqvVidqJaCM1HH3vTaJz5JSqua 9mvTDpCvDJ1U8jxy09etqHxTLy9BdwHVeiDcL6tey52kA0cDwgO9n7qYAc4QfcD6EbWO gQ2g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cp18si5778091plb.196.2019.05.24.13.07.03; Fri, 24 May 2019 13:07:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391829AbfEXUDl (ORCPT + 99 others); Fri, 24 May 2019 16:03:41 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:57465 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391612AbfEXUDl (ORCPT ); Fri, 24 May 2019 16:03:41 -0400 Received: from mail-ot1-f71.google.com ([209.85.210.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hUGPi-0007wv-F1 for linux-kernel@vger.kernel.org; Fri, 24 May 2019 20:03:38 +0000 Received: by mail-ot1-f71.google.com with SMTP id 73so4999384oty.2 for ; Fri, 24 May 2019 13:03:38 -0700 (PDT) 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=MdZgSrzvQrNvArhhMwV6uq98L6kGwXydzTCUTc3ed/4=; b=nyzkxWlpmuQTSM7FL8BbV7PvXVB4xXH0cSeWffJLbTSbrj03V2WDPh/ZdXcfNG3yoU L5L3u0ZVoTo5fNICoeiL4xhZ37bRhduTSFxjcIguZHKDIsrpOwBWAkH7Y+Qv8HL/WQIJ CHdznPhvV09D9nadnKXRj32wT69+Jdat8PR3XnLTq72BBEIwifNChCvYE8pw0ZTp9CL1 VeMCAgB+ZtMfOkDKIzcdMSjEooTtGLCQ2FEXopxVBicVlCC/I20dyWOkzSX8ENynQ87o Q/hIfZdtEsxJRFume/r5VOAIAhbe2CQB4Iy8aNbNF8F0TN0/Z01pg9Qvl9Tr1paVa+tf IhiA== X-Gm-Message-State: APjAAAVXvzfQlU1yYLQnFZS1RxCxaUn3Ii9vsEsPn3CgdClOwEj88jSJ 4oPkAEfpvq14fovKp9dRbq6OhhU9MJZ/SyCuOnwnUMlhziM0zBE9di7fLNtcAqFDcpbgaQ4hvE7 Qk+y4KggDeVYroRKISGYaIzQbp085xwifvJe3rdsDQfsg0tDsGyA4VYTvhg== X-Received: by 2002:a05:6830:164d:: with SMTP id h13mr31758686otr.99.1558728217210; Fri, 24 May 2019 13:03:37 -0700 (PDT) X-Received: by 2002:a05:6830:164d:: with SMTP id h13mr31758663otr.99.1558728216929; Fri, 24 May 2019 13:03:36 -0700 (PDT) MIME-Version: 1.0 References: <20190524040633.16854-1-nicoleotsuka@gmail.com> In-Reply-To: <20190524040633.16854-1-nicoleotsuka@gmail.com> From: dann frazier Date: Fri, 24 May 2019 14:03:25 -0600 Message-ID: Subject: Re: [PATCH v3 0/2] Optimize dma_*_from_contiguous calls To: Nicolin Chen Cc: Christoph Hellwig , Robin Murphy , Marek Szyprowski , vdumpa@nvidia.com, linux@armlinux.org.uk, Catalin Marinas , Will Deacon , 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 , linux-kernel@vger.kernel.org, linux-xtensa@linux-xtensa.org, iommu@lists.linux-foundation.org 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 Thu, May 23, 2019 at 10:08 PM Nicolin Chen wrote: > > [ 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(-) Thanks Nicolin. Tested on a HiSilicon D06 system. Tested-by: dann frazier