From: Matthew Wilcox <willy@infradead.org>
To: Tony Battersby <tonyb@cybernetics.com>
Cc: Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
iommu@lists.linux-foundation.org, linux-mm@kvack.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH v4 8/9] dmapool: improve accuracy of debug statistics
Date: Mon, 12 Nov 2018 22:30:37 -0800 [thread overview]
Message-ID: <20181113063037.GS21824@bombadil.infradead.org> (raw)
In-Reply-To: <bb0ee76c-78ac-b75b-b32d-8c94d881f7d6@cybernetics.com>
On Mon, Nov 12, 2018 at 10:45:58AM -0500, Tony Battersby wrote:
> +++ linux/mm/dmapool.c 2018-08-06 17:52:53.000000000 -0400
> @@ -61,6 +61,7 @@ struct dma_pool { /* the pool */
> struct device *dev;
> unsigned int allocation;
> unsigned int boundary;
> + unsigned int blks_per_alloc;
> char name[32];
> struct list_head pools;
> };
This one I'm not totally happy with. You're storing this value when
it could be easily calculated each time through the show_pools() code.
I appreciate this is a topic where reasonable people might have different
opinions about which solution is preferable.
> @@ -182,6 +182,9 @@ struct dma_pool *dma_pool_create(const c
> retval->size = size;
> retval->boundary = boundary;
> retval->allocation = allocation;
> + retval->blks_per_alloc =
> + (allocation / boundary) * (boundary / size) +
> + (allocation % boundary) / size;
>
> INIT_LIST_HEAD(&retval->pools);
>
>
prev parent reply other threads:[~2018-11-13 6:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-12 15:45 Tony Battersby
2018-11-13 6:30 ` Matthew Wilcox [this message]
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=20181113063037.GS21824@bombadil.infradead.org \
--to=willy@infradead.org \
--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=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