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 0A0D4C6FA8E for ; Fri, 24 Feb 2023 18:24:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7EDBF6B0071; Fri, 24 Feb 2023 13:24:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 79EE06B0073; Fri, 24 Feb 2023 13:24:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6656C6B0074; Fri, 24 Feb 2023 13:24:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 47F246B0071 for ; Fri, 24 Feb 2023 13:24:29 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 107A9A0801 for ; Fri, 24 Feb 2023 18:24:29 +0000 (UTC) X-FDA: 80503010658.26.32362F9 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf25.hostedemail.com (Postfix) with ESMTP id 4CFE4A0006 for ; Fri, 24 Feb 2023 18:24:27 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VnL9HUjR; spf=pass (imf25.hostedemail.com: domain of kbusch@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=kbusch@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677263067; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yGTqZgezueRIrUMUx2zmIkQRdi8t3FJqIGsG71s/+o4=; b=NIEIWRx60O8f5da9hR4xMicssvoXO/11HsFK3CFqnNG9CPF9umteBPaCwK5CZSj2/uDSL8 PixoGi2xBJ69i3ASBqHg9GA6DsO2Qtkl4Xhsvpzq/1JvOkPNIUPXJEV+w6M3Y/OlPXeeO4 7x1UMDNGa5Z1bpYotdnjPY8M1aTLLZE= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=VnL9HUjR; spf=pass (imf25.hostedemail.com: domain of kbusch@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=kbusch@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677263067; a=rsa-sha256; cv=none; b=d/cxtx+KnoFAVowNQl8prtc/NjXF+TGBryhA6N/OkEmlE+4ptJ+v74wCspd4vpleUQYY2s pScH5NMxeABcLeZd4KSa80n/TBmm48FVrrTbUpXxXgdCuMptyV41TBP+P3/UmyMCfq8+kO EylpySyWwLHAzXBN/r2LuwzCG7HqND4= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A98FFB81CD9; Fri, 24 Feb 2023 18:24:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDDF3C433EF; Fri, 24 Feb 2023 18:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677263064; bh=KLpV/GVEKy/KsLgMBV7FJaRlFv3lDlFyBPwS+ACw4tg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VnL9HUjRVk8FtjOuZ1eXSphGfEI3qvqB2Ly2w16Evw/6x8SHLxOD8UQMzIJElEgGs Elf9DpEzxSl7ktVM0jlxNklE4CYkmglHdiv68pZk0sfLvTxeHj9seZ91v8naOFR9aU httDovbWy2gBQmpxEc9FPDYAHLmPJq1HzIvRxW3/AsAPy0U40mn8JtVrnlJO3pclCt wZRIql98Zn8F5hnBzivzxWtTJW93fbj5U3qzDP0NtFKTfuWj7V6yNnllj72vMyGPLG ksERvJRvpXEVLcz2U+FRmGC8zT9GPgnrk02C+hNq/5bt+QyrpwjWrvpCoyYsoFbJ0Q hxXn3F60w9j1g== Date: Fri, 24 Feb 2023 11:24:21 -0700 From: Keith Busch To: Andrew Morton Cc: Christoph Hellwig , Keith Busch , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue Subject: Re: [PATCH] dmapool: push new blocks in ascending order Message-ID: References: <20230221165400.1595247-1-kbusch@meta.com> <20230223124137.e6fe921659e6f6f1c10668b6@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230223124137.e6fe921659e6f6f1c10668b6@linux-foundation.org> X-Stat-Signature: c66pi4rjo3eymmzimngppqzzqoeks6pj X-Rspam-User: X-Rspamd-Queue-Id: 4CFE4A0006 X-Rspamd-Server: rspam06 X-HE-Tag: 1677263067-395356 X-HE-Meta: U2FsdGVkX1+gCM5lR9NqT09XPqzBpDSqS0Abt3jMb57ZL0p9iBM6FLjmoospI9+xW9jSV9RaTtjFR/SqCUBI3fA/dzorVx7egq4wWLb/AyA7vy/iSbec3nnZiNqQgg+O/+64r1a+h4sOtuawx741Gg9yWtHOx61V31LYK4TVffUvsJY2zoQjfY/SVGE9U0o/TBTqfgy2pKfbeDF7/gi4cjmoynAsZeq9FuqZC8NPeuTLHJXQ19CULtd2DcE3iVlNMhz9tH2GaaZwDxbDHzoER6msaa3WdcCWtMwY0eev7CoPcDSnwP19KIUswyE8FKg6poeUPBU7amW4yJtW6lM51tr1hKyKRkiwpKd9/87TDFTQFkKZvhFiyzqWA0C48S0PW+JTYlPpKEWZbEErXPcSw4ElzA8w/wGNIkIF8fMcUZi07jX7KqCg+X+mNd6W2nXKIipodJXfVsvUkZmDOCBrFLpZsX/951mK+P6mdVE2RSkHysap5lz/jsR4tzCAvwpwypfersFvX0IiDLbyYsY7eOyvT5Rel7cR+sMk1rP67N7gxbakNQSFgztvmMqlmUbU9XbNephSPNFcNKrSc0JyYmY23Ni+B7+arrIx4fSLpeQGXZy1fIJOlX/1UqUIRJi+2yOThGs5mfYRNw8kin5o9oygBfDMWfq1TtBPAlzsF99t6N3GQHUd+n+EUjRHyCYCEbR3t3+dappxJt/KbGArH44VSsjPmu1lj/7vl0w6FLQzq9F1w86I0EJLRKKHb03h0aLLi3LouSMMsW006Iy+TZzdftVOZ0HOfNSmSLwDpWytXZgu7oJtIbDzNSaIUiBkplKrOlzvE5Ru2bbroKH0wTpJJC8nhABedqbs5uvoGishrnVVPBeDn2JGlB87+8i00xx3r2H0bmvMi7zqo0QOPYfW40c4ow2aiVUvbzWJPcb2p4xbmN5S3+6uw1AoUGvdpd4R2LTQRZynORm5/qt sz9yAw/B D8kcOijNmP8YzJ14W4NayW0q7fNkGvL8t98o8Of4vlrzcn35RssGV74AxpRGPJcLan3KAJA5Tv/oWN5d5aoCLahcfppYCNbAyRzQIkW18ucTDbTEFWttUeXd9XItSnC9VDKbDljqAtFGo/ueQHxJcjzvDtqfQqeEpr2TOsu61L5H9sHaDX/HvFjWSmPnIZvyTC1V5rOi3UI7BykShEMtACuiWo1rXdZDFDe49lH5ABzQp45N8c+UqDnV5yE1QTYiUpl6ETE8eoYiKO+xBJm7s5YeeAgTuPRvMDj2WchcpreZPl0XrSexSbOKNQiv6hefuZcGw 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 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).