From: Christopher Lameter <cl@linux.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>,
Ming Lei <tom.leiming@gmail.com>,
Vlastimil Babka <vbabka@suse.cz>,
Dave Chinner <david@fromorbit.com>,
"Darrick J . Wong" <darrick.wong@oracle.com>,
"open list:XFS FILESYSTEM" <linux-xfs@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Dave Chinner <dchinner@redhat.com>,
Christoph Hellwig <hch@lst.de>,
Alexander Duyck <alexander.h.duyck@linux.intel.com>,
Aaron Lu <aaron.lu@intel.com>,
Linux FS Devel <linux-fsdevel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>,
linux-block <linux-block@vger.kernel.org>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc
Date: Tue, 26 Feb 2019 15:30:39 +0000 [thread overview]
Message-ID: <010001692a6de63c-e2304a50-263c-49c5-a9fd-675cfb7094f5-000000@email.amazonses.com> (raw)
In-Reply-To: <20190226134247.GA30942@ming.t460p>
On Tue, 26 Feb 2019, Ming Lei wrote:
> Then something like the following patch should work for all fs, could
> anyone comment on this approach?
Note that various subsystems have similar implementations. Have a look at
drivers/dma/dmaengine.c
struct dmaengine_unmap_pool {
struct kmem_cache *cache;
const char *name;
mempool_t *pool;
size_t size;
};
#define __UNMAP_POOL(x) { .size = x, .name = "dmaengine-unmap-"
__stringify(x) }
static struct dmaengine_unmap_pool unmap_pool[] = {
__UNMAP_POOL(2),
#if IS_ENABLED(CONFIG_DMA_ENGINE_RAID)
__UNMAP_POOL(16),
__UNMAP_POOL(128),
__UNMAP_POOL(256),
#endif
};
Or drivers/md/dm-bufio.c:
struct dm_bufio_client {
struct mutex lock;
struct list_head lru[LIST_SIZE];
unsigned long n_buffers[LIST_SIZE];
struct block_device *bdev;
unsigned block_size;
s8 sectors_per_block_bits;
void (*alloc_callback)(struct dm_buffer *);
void (*write_callback)(struct dm_buffer *);
struct kmem_cache *slab_buffer;
struct kmem_cache *slab_cache;
struct dm_io_client *dm_io;
struct list_head reserved_buffers;
unsigned need_reserved_buffers;
unsigned minimum_buffers;
struct rb_root buffer_tree;
wait_queue_head_t free_buffer_wait;
sector_t start;
int async_write_error;
struct list_head client_list;
struct shrinker shrinker;
};
next prev parent reply other threads:[~2019-02-26 15:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 4:09 [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc Ming Lei
2019-02-25 4:36 ` Dave Chinner
2019-02-25 8:46 ` Ming Lei
2019-02-25 10:03 ` Ming Lei
2019-02-25 20:11 ` Dave Chinner
2019-02-25 13:15 ` Vlastimil Babka
2019-02-25 20:26 ` Dave Chinner
2019-02-26 2:22 ` Ming Lei
2019-02-26 3:02 ` Dave Chinner
2019-02-26 3:27 ` Matthew Wilcox
2019-02-26 4:58 ` Dave Chinner
2019-02-26 9:33 ` Ming Lei
2019-02-26 10:06 ` Vlastimil Babka
2019-02-26 11:12 ` Ming Lei
2019-02-26 12:12 ` Matthew Wilcox
2019-02-26 12:35 ` Ming Lei
2019-02-26 13:02 ` Matthew Wilcox
2019-02-26 13:42 ` Ming Lei
2019-02-26 14:04 ` Matthew Wilcox
2019-02-26 16:14 ` Darrick J. Wong
2019-02-26 16:19 ` Matthew Wilcox
2019-02-27 1:41 ` Ming Lei
2019-02-27 7:07 ` Vlastimil Babka
2019-03-08 8:18 ` Christoph Hellwig
2019-02-27 21:38 ` Dave Chinner
2019-02-26 15:30 ` Christopher Lameter [this message]
2019-02-26 20:45 ` Dave Chinner
2019-02-27 1:50 ` Ming Lei
2019-02-27 3:41 ` Dave Chinner
2019-02-26 15:20 ` Christopher Lameter
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=010001692a6de63c-e2304a50-263c-49c5-a9fd-675cfb7094f5-000000@email.amazonses.com \
--to=cl@linux.com \
--cc=aaron.lu@intel.com \
--cc=alexander.h.duyck@linux.intel.com \
--cc=axboe@kernel.dk \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--cc=hch@lst.de \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=tom.leiming@gmail.com \
--cc=vbabka@suse.cz \
--cc=vkuznets@redhat.com \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).