All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, hch@infradead.org,
	bryan.odonoghue@linaro.org, kbusch@kernel.org,
	akpm@linux-foundation.org
Subject: [folded-merged] dmapool-link-blocks-across-pages-fix.patch removed from -mm tree
Date: Sun, 26 Feb 2023 15:17:34 -0800	[thread overview]
Message-ID: <20230226231735.8AD0FC433D2@smtp.kernel.org> (raw)


The quilt patch titled
     Subject: dmapool: push new blocks in ascending order
has been removed from the -mm tree.  Its filename was
     dmapool-link-blocks-across-pages-fix.patch

This patch was dropped because it was folded into dmapool-link-blocks-across-pages.patch

------------------------------------------------------
From: Keith Busch <kbusch@kernel.org>
Subject: dmapool: push new blocks in ascending order
Date: Tue, 21 Feb 2023 08:54:00 -0800

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.

usb/chipidea/udc.c qh_pool called "ci_hw_qh".  My initial thought was
dmapool isn't the right API if you need a specific order when allocating
from it, but I can't readily test any changes to that driver.  Restoring
the previous behavior is easy enough.

Link: https://lkml.kernel.org/r/20230221165400.1595247-1-kbusch@meta.com
Fixes: ced6d06a81fb69 ("dmapool: link blocks across pages")
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reported-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---


--- a/mm/dmapool.c~dmapool-link-blocks-across-pages-fix
+++ b/mm/dmapool.c
@@ -301,7 +301,7 @@ EXPORT_SYMBOL(dma_pool_create);
 static void pool_initialise_page(struct dma_pool *pool, struct dma_page *page)
 {
 	unsigned int next_boundary = pool->boundary, offset = 0;
-	struct dma_block *block;
+	struct dma_block *block, *first = NULL, *last = NULL;
 
 	pool_init_page(pool, page);
 	while (offset + pool->size <= pool->allocation) {
@@ -312,11 +312,22 @@ static void pool_initialise_page(struct dma_pool *pool, struct dma_page *page)
 		}
 
 		block = page->vaddr + offset;
-		pool_block_push(pool, block, page->dma + offset);
+		block->dma = page->dma + offset;
+		block->next_block = NULL;
+
+		if (last)
+			last->next_block = block;
+		else
+			first = block;
+		last = block;
+
 		offset += pool->size;
 		pool->nr_blocks++;
 	}
 
+	last->next_block = pool->next_block;
+	pool->next_block = first;
+
 	list_add(&page->page_list, &pool->page_list);
 	pool->nr_pages++;
 }
_

Patches currently in -mm which might be from kbusch@kernel.org are

dmapool-add-alloc-free-performance-test.patch
dmapool-move-debug-code-to-own-functions.patch
dmapool-rearrange-page-alloc-failure-handling.patch
dmapool-consolidate-page-initialization.patch
dmapool-simplify-freeing.patch
dmapool-dont-memset-on-free-twice.patch
dmapool-link-blocks-across-pages.patch
dmapool-create-destroy-cleanup.patch


                 reply	other threads:[~2023-02-26 23:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230226231735.8AD0FC433D2@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=hch@infradead.org \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.