From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B403C64ED8 for ; Fri, 24 Feb 2023 22:28:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 822036B0071; Fri, 24 Feb 2023 17:28:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D0AD6B0073; Fri, 24 Feb 2023 17:28:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 699146B0074; Fri, 24 Feb 2023 17:28:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5646A6B0071 for ; Fri, 24 Feb 2023 17:28:36 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 25ADFA0BC3 for ; Fri, 24 Feb 2023 22:28:36 +0000 (UTC) X-FDA: 80503625832.08.EC71ACE Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by imf18.hostedemail.com (Postfix) with ESMTP id 395741C000E for ; Fri, 24 Feb 2023 22:28:32 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=mCKNrSsW; spf=pass (imf18.hostedemail.com: domain of bryan.odonoghue@linaro.org designates 209.85.128.48 as permitted sender) smtp.mailfrom=bryan.odonoghue@linaro.org; dmarc=pass (policy=none) header.from=linaro.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677277713; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/NyMBqJPXAtbFE6QfoEt0ShoiVYWsmZyw6lZIW+hMhI=; b=hUa1f6OTlYkmYK74+GNsDj8KiGYfWYleQfx30pRXcXVHYveCJvpTDBo4igCFTQgzXEvoIE 5NzOfjV0QAFa2M2oWCLt8qz20AtIDvvKeImVWRX6XvgNX1Bi+o9EIWwoVz2Aiinr6dzTHN v05S6qxaXqaZCGWMpSUefrnEasVPIXk= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=mCKNrSsW; spf=pass (imf18.hostedemail.com: domain of bryan.odonoghue@linaro.org designates 209.85.128.48 as permitted sender) smtp.mailfrom=bryan.odonoghue@linaro.org; dmarc=pass (policy=none) header.from=linaro.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677277713; a=rsa-sha256; cv=none; b=pgfCP42W4oui3Y6AITGuLbojVGXT5M/5hOyI1KOyasaoZxOoNtYvMhysFVKzrZyqIuthIP MVmx0/uzgG89S8xXcbfTkfXPHj+ZXAgF6RNsJO2fHAceAvs19Jx5eKpMB/Xd1nem56vGo9 vJSX3Jp5YCwquO5E8tVuEaer5ogzJiY= Received: by mail-wm1-f48.google.com with SMTP id l7-20020a05600c4f0700b003e79fa98ce1so426852wmq.2 for ; Fri, 24 Feb 2023 14:28:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/NyMBqJPXAtbFE6QfoEt0ShoiVYWsmZyw6lZIW+hMhI=; b=mCKNrSsWccliXsjAtwUObNGFGWCC9tox/Kye5+fSI3ZkWNqgJH4+VVsxqqUjQjLQYt bWwU4Ty3Y58DQyWPDg7Vu+d1DwyoW1DnV7fskLqUTNO3txqpvOaqG+9ZszKab2xkl1vq 9LOzcvXL3Jd4hMOJ/EJrniuFOiCi4JHiNioS9gsuQqeCQIKTVBWVpdGFYytwK+alxmsx 0E31kwU+Q6dDD1YPu+R5EB5UO5N+A+gwcTbZdnN+deEiFtXgy9VQy87bSNGmV/+Px2dw lsxg8tQvJo27NafXd6XMW4knBbZ+BEb2daq09WTJ8RLHsQ9f2BPTtCYqJLv7EI9wFxLx Qeqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/NyMBqJPXAtbFE6QfoEt0ShoiVYWsmZyw6lZIW+hMhI=; b=DjtDSqjQn9ZNBfODlKyIvCYVJIfQ4evoUXunjRoP7/EyBIOO2PG85HXqN/lEAQK2/i oT3q+kmvEoScizm1wsFsqpJjXDZhF2Oezl8hyVHC5tkiLDDfnyAkNano5YS/k168V7hG 1x4wp/fWQcO9fe+TWj5bovG2dX/R4TeV23IPEhc7lj0U1PwUAJnh7UMd3rd1etb56n89 pUR+6ivWnzsNFZmpuxOp1ItuhyoWwebxCsJkCJGSkau0D84oU+7E1CLqf5nSdXtZnk/9 /jcKTSTJQ+nabChG2zzXw3RfmWZ5lT16bJoailgmzdFVVAS9UpGgpQCD5/XE0qD/4tDe N3Og== X-Gm-Message-State: AO0yUKV29ZpZUG1GJvX/mAoDMF+mdFSrW0DffnCxKmXpT6OWTIWn9jSP D1eH865ces/GeVdi6QsT5ICQ0Q== X-Google-Smtp-Source: AK7set8wxYzcLZjEgC80AAfy0pLilux9eS9KmtMdA3ECEPrQc/S+DtFqk8p8qWkTm2nk6Ub/bPjgOQ== X-Received: by 2002:a05:600c:4e89:b0:3e2:5f6:3647 with SMTP id f9-20020a05600c4e8900b003e205f63647mr967650wmq.16.1677277711671; Fri, 24 Feb 2023 14:28:31 -0800 (PST) Received: from [192.168.0.162] (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id h18-20020a05600c351200b003eb192787bfsm541692wmq.25.2023.02.24.14.28.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Feb 2023 14:28:31 -0800 (PST) Message-ID: Date: Fri, 24 Feb 2023 22:28:30 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Subject: Re: [PATCH] dmapool: push new blocks in ascending order To: Keith Busch , Andrew Morton Cc: Christoph Hellwig , Keith Busch , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20230221165400.1595247-1-kbusch@meta.com> <20230223124137.e6fe921659e6f6f1c10668b6@linux-foundation.org> Content-Language: en-US From: Bryan O'Donoghue In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: e7w3x8tyud16g4s4p7zur7komoa4dnka X-Rspamd-Queue-Id: 395741C000E X-HE-Tag: 1677277712-28261 X-HE-Meta: U2FsdGVkX18W6ZYXUIvwDpxn34ASIsFnF4IqQUKfgAE4DN3deVyo1H+bceibgkLxUzG0E4JwHziR/+KrozlDi4Ync3RIPercjfeKQh2nM8s5M7qoOs4yikjvr+hjp7cwPZP0oi8Pfs6CF9mErBQswCsb6vJFg1I8s/zRWmzI8pw2dWUgPag2+cTcxjdOCWC5T/dya33wo8BYDheigrOEA2PIvcwAYbEgBRwp74M/ECfK5D9Dff8+Kupvwcl3+YFT29xf2XI9VCKb11Y7XYPjLXjjijEKwXDGoYho+UM5gGfUT1kg7Rg3q5guWL9kUjBTKnWpU+kxIvF0y7jxbNoygqNm17M1TjgEQZhKpEqkVUKIwj5MAzZi1J9KNd7GREDuEIElkw/VP3ZdQjepnfhjA/Pg5Ji+vTasen5rdQkTLElC+t+8u+ChvmfXezZuXHou/SvIyaI70bmVwgPWuQsSkJ72UUvoUf96ma+rIslxT62K4jlN/TNYktD8MAxSgEMP9LbW0nXBpPGdMtr2sDuu5dUbnx0sssS4fJNZEGV+WLDS1GSgdBuT+8H2De8X/1saFXz1kJ3IPqHSCH5DGxEC63xAGpBJei55Qu+hoo/Vb2BioglKPczxu19RbHpcyHHVrawTbWoVydA/w5cnboBKfmdzJVoDJmblmnu9m+XsNiuooI9va6r+QWOWoRdSpM9qRr/RbK6f/TDQADs39YhqW59YXYjDwcl86SVVFmm+zdFpHu8sbl21wQdgJMmIG0wlFk3qJfgqg5O8x3NNvTK9odT5YCMZ45Z5qMlsyPV4WtJEmZ7plwDQoO5eh8p9vjq5LwPwRi1GbkTyilYhP7gCwqO21w8VN33FHMcOa0oZ3H5prreT8KJt46K1X4On3Tqxt+NJD8UAG5waf1hrDfwj1Nh3AoUkGaumyiJmM6IHRTE1YSnSC9Mp0gRfguPkf6KV7h3nFw6pzOEUc2ZmChC tCoBUbY9 ZK7fubdpklY2q7/EXaYLwFSPjB0fTTDCN9Lzn5Hsmxh866fau8wpC9BXdqTwi2DcbSTrvyGNPET65AJxT1YhQTnUQN5ba8LB3a6h+CCO3FEz/XFsnTROyEc4Nl3Inq7V6MpNDinPpM0ScSx2Y1gOVYX8H4SpCZ9W6YtNp989qSZAJtIq4TCG1+4ty60pghoGr0T/HxALbW96lhQtxvagOkJ7bcA4BbzTBJ638QhJzAntaEh4+Y3gLlEqPW1Q5PULLsCNS5gFRqhELyr7Ha7IHWPtTCayiT67bkhQDNOwXegP7wCvcBN0gnBu18K5XwgfsFe7ayVvVLgcolPopjQG77yIvqYLm2F7q7Mdlq4DSVs0LeI48fH0cs4mbImE2Y2/S6g+zkDHgBsitnc0dTSO2js/NZIRZkaiZWMDANTtk+e0CG7g= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 24/02/2023 18:24, Keith Busch wrote: > On Thu, Feb 23, 2023 at 12:41:37PM -0800, Andrew Morton wrote: >> On Tue, 21 Feb 2023 11:07:32 -0700 Keith Busch wrote: >> >>> On Tue, Feb 21, 2023 at 10:02:34AM -0800, Christoph Hellwig wrote: >>>> On Tue, Feb 21, 2023 at 08:54:00AM -0800, Keith Busch wrote: >>>>> From: Keith Busch >>>>> >>>>> Some users of the dmapool need their allocations to happen in ascending >>>>> order. The recent optimizations pushed the blocks in reverse order, so >>>>> restore the previous behavior by linking the next available block from >>>>> low-to-high. >>>> >>>> Who are those users? >>>> >>>> Also should we document this behavior somewhere so that it isn't >>>> accidentally changed again some time in the future? >>> >>> usb/chipidea/udc.c qh_pool called "ci_hw_qh". >> >> It would be helpful to know why these users need this side-effect. Did >> the drivers break? Or just get slower? > > The affected driver was reported to be unusable without this behavior. > >> Are those drivers misbehaving by assuming this behavior? Should we > > I do think they're using the wrong API. You you shouldn't use the dmapool if > your blocks need to be arranged in a contiguous address order. They should just > directly use dma_alloc_coherent() instead. > >> require that they be altered instead of forever constraining the dmapool >> implementation in this fashion? > > This change isn't really constraining dmapool where it matters. It's just an > unexpected one-time initialization thing. > > As far as altering those drivers, I'll reach out to someone on that side for > comment (I'm currently not familiar with the affected subsystem). We can always change this driver, I'm fine to do that in-parallel/instead. The symptom we have is a silent failure absent this change so, I just wonder are we really the _only_ code path that would be affected absent the change in this patch ? --- bod