Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3274833rwb; Fri, 16 Dec 2022 12:29:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf66VWiQ4Mf8wmkGaaRnT0ZlApG0Yt7URqIkup4+PshllHWHCa3BaTXrEr91GQ/oEi5UroWc X-Received: by 2002:a17:906:34c9:b0:7c0:f558:e518 with SMTP id h9-20020a17090634c900b007c0f558e518mr16052363ejb.51.1671222576766; Fri, 16 Dec 2022 12:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671222576; cv=none; d=google.com; s=arc-20160816; b=iZg0B99DVS1JpaTuWp9/ERnGXP2ULKHtU14jGVU+4gpPDcNxBFaqjmv0PolHnYgMxd T+TsCqOU/pkINRA6JbfV33CtYNgroawVtEycn2XVwkROnA1PHEatpx5rUXsuXkAmS6Nc 96oABknFtaIiqpg/QSwaW6Fyds4+mgHKMZCzxiKPoIVDklARgE+ztTcimI3w1XLuvK7s 5o9/69gN5It4Nj9r3BeYDMSZH1VFI+oj07aUUVVNhX9iKoigIMnc9T9VjhdUnItNFBpg LpgIqkjn29W3M6aZB+1vRem1k2bb2CcnHGicuZhUvKPbUp0KOxK9K5norE3TfnPh+anr 292A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=thktE/bo2HltCwBKROxOHKReAsv2PUYhaxcs9QYKzYQ=; b=ohBNNYZSv8TCdO0GBRr5uDxM+hbkR9wXBRnEeVQM35od1rQvhTXtrrhtzQ5d2qyjem VPyzCmyj4W8DxO4EBN0d/P8UXTa3oC7hZcRJqnNHSU0US3JSosXon2Rel3WkJwDVuH0n sA+IujeCnHrr6mBvu3m2cwryx8DNx9n9Bjys/Ly3BWM/8E0oloissKuzS5E2OwDYYwmt +IslMkp6207/+aH57GAbuMSXRoGmf/Azfju8N/mRBi/+wf2Kj8a1OFP37FBUJkflNfdX 3CqFteBT3JLHmEo0z1k+jqZfG7bqa+X4g9iu5bAbHv/QZaOmfGuS8KI0MSThw1dTmxDP SySA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=G3AN1gIi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww2-20020a170907084200b007c0f68539ecsi3182099ejb.604.2022.12.16.12.29.20; Fri, 16 Dec 2022 12:29:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=G3AN1gIi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231984AbiLPURg (ORCPT + 69 others); Fri, 16 Dec 2022 15:17:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231964AbiLPURV (ORCPT ); Fri, 16 Dec 2022 15:17:21 -0500 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B4C6A748 for ; Fri, 16 Dec 2022 12:17:20 -0800 (PST) Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BGJxSYO015449 for ; Fri, 16 Dec 2022 12:17:20 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=s2048-2021-q4; bh=thktE/bo2HltCwBKROxOHKReAsv2PUYhaxcs9QYKzYQ=; b=G3AN1gIivSwV/TRPXYIlFwTOIcT5PsbterRO2tbkUlUT2QzjrAaCeQUN8vDcB1PzMNBQ Vy7njlDwdOF7zkQsDawR1Dkvo162pr8bG7Ig/wlEr+89QGG8YJXC7xYVsnxCT5DR1hk1 C8bjWldNnhVckpX8IdGeB0VhzuqN3fSeLT8s6w3+F9tmPO3BXw84aqhyIU8/h7f4A5Sh 9Cl5YhTvsQzcBIwbwD8jYipexWG1FpCPz850cS/xTyOFWrc1QDRIjuUKtgK/JccaU/tM qn3vUlJNqNjDCf0r43qSMkDOil4gT63qwmeUCo/6VvE2H0xg3wanAUpGtFEOGjcPSK14 Aw== Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3mg3hj2det-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 16 Dec 2022 12:17:19 -0800 Received: from twshared24004.14.frc2.facebook.com (2620:10d:c085:208::11) by mail.thefacebook.com (2620:10d:c085:11d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Dec 2022 12:17:18 -0800 Received: by devbig007.nao1.facebook.com (Postfix, from userid 544533) id DE0B3D042AAF; Fri, 16 Dec 2022 12:17:09 -0800 (PST) From: Keith Busch To: , , Matthew Wilcox CC: Tony Battersby , Kernel Team , Keith Busch Subject: [PATCHv2 00/11] dmapool enhancements Date: Fri, 16 Dec 2022 12:16:14 -0800 Message-ID: <20221216201625.2362737-1-kbusch@meta.com> X-Mailer: git-send-email 2.30.2 X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: vLq88CMB5qsir95h0gMWeKKE1kblfR6J X-Proofpoint-ORIG-GUID: vLq88CMB5qsir95h0gMWeKKE1kblfR6J Content-Transfer-Encoding: quoted-printable X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-16_14,2022-12-15_02,2022-06-22_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Keith Busch The time spent in dma_pool alloc/free goes up linearly as the number of pages backing the pool increases. We can reduce this to constant time with some minor changes to how free pages are tracked. Changes since previous version: Fixed dmapool_test to use appropriate dma_op accessors Fixed up comment in dmapool about the data structures Fixed dma pool boundary checks when initializing the pool And since I mess up the boundary checks for odd alignment, I updated dmapool_test allow setting arbitrary alignment and boundary to catch the same case that failed in the previous version, reported here: https://lore.kernel.org/oe-lkp/202212112301.ad0819f7-oliver.sang@intel.c= om/ Keith Busch (7): dmapool: add alloc/free performance test dmapool: move debug code to own functions dmapool: rearrange page alloc failure handling dmapool: consolidate page initialization dmapool: simplify freeing dmapool: don't memset on free twice dmapool: link blocks across pages Tony Battersby (4): dmapool: remove checks for dev =3D=3D NULL dmapool: use sysfs_emit() instead of scnprintf() dmapool: cleanup integer types dmapool: speedup DMAPOOL_DEBUG with init_on_alloc mm/Kconfig | 9 ++ mm/Makefile | 1 + mm/dmapool.c | 356 ++++++++++++++++++++++------------------------ mm/dmapool_test.c | 146 +++++++++++++++++++ 4 files changed, 324 insertions(+), 188 deletions(-) create mode 100644 mm/dmapool_test.c --=20 2.30.2