From: Matthew Wilcox <willy@infradead.org>
To: Tony Battersby <tonyb@cybernetics.com>
Cc: Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Sathya Prakash <sathya.prakash@broadcom.com>,
Chaitra P B <chaitra.basappa@broadcom.com>,
Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
iommu@lists.linux-foundation.org, linux-mm <linux-mm@kvack.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
MPT-FusionLinux.pdl@broadcom.com
Subject: Re: [PATCH v2 4/9] dmapool: improve scalability of dma_pool_alloc
Date: Thu, 2 Aug 2018 13:08:04 -0700 [thread overview]
Message-ID: <20180802200804.GA14318@bombadil.infradead.org> (raw)
In-Reply-To: <1dbe6204-17fc-efd9-2381-48186cae2b94@cybernetics.com>
On Thu, Aug 02, 2018 at 03:58:40PM -0400, Tony Battersby wrote:
> @@ -339,11 +360,16 @@ void *dma_pool_alloc(struct dma_pool *po
>
> spin_lock_irqsave(&pool->lock, flags);
>
> - list_add(&page->page_list, &pool->page_list);
> + list_add(&page->dma_list, &pool->page_list[POOL_AVAIL_IDX]);
> ready:
> page->in_use++;
> offset = page->offset;
> page->offset = *(int *)(page->vaddr + offset);
> + if (page->offset >= pool->allocation) {
> + /* Move page from the "available" list to the "full" list. */
> + list_del(&page->dma_list);
> + list_add(&page->dma_list, &pool->page_list[POOL_FULL_IDX]);
I think this should be:
list_move_tail(&page->dma_list,
&pool->page_list[POOL_FULL_IDX]);
> @@ -444,6 +476,11 @@ void dma_pool_free(struct dma_pool *pool
> #endif
>
> page->in_use--;
> + if (page->offset >= pool->allocation) {
> + /* Move page from the "full" list to the "available" list. */
> + list_del(&page->dma_list);
> + list_add(&page->dma_list, &pool->page_list[POOL_AVAIL_IDX]);
This one probably wants to be
list_move(&page->dma_list, &pool->page_list[POOL_AVAIL_IDX]);
so that it's first-in-line to be allocated from for cache warmth purposes.
next prev parent reply other threads:[~2018-08-02 20:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 19:58 Tony Battersby
2018-08-02 20:08 ` Matthew Wilcox [this message]
2018-08-03 9:02 ` Andy Shevchenko
2018-08-03 13:55 ` Tony Battersby
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=20180802200804.GA14318@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=MPT-FusionLinux.pdl@broadcom.com \
--cc=chaitra.basappa@broadcom.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=linux-scsi@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=sathya.prakash@broadcom.com \
--cc=suganath-prabu.subramani@broadcom.com \
--cc=tonyb@cybernetics.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox