From: Theodore Ts'o <tytso@mit.edu>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 26/25] libext2fs: call get_alloc_block hook when allocating blocks
Date: Fri, 12 Sep 2014 18:17:53 -0400 [thread overview]
Message-ID: <20140912221753.GB27092@thunk.org> (raw)
In-Reply-To: <20140912175750.GA10150@birch.djwong.org>
On Fri, Sep 12, 2014 at 10:57:50AM -0700, Darrick J. Wong wrote:
>
> > errcode_t ext2fs_alloc_blocks(ext2_filsys fs, blk64_t goal,
> > unsigned int *num_blocks,
> > char *block_buf, int flags, blk64_t *ret)
> >
> > ... which can be used to efficiently allocate up to *num_blocks blocks
> > at a time, much like the mballoc interface. I suspect that would be
> > useful for a number of different cases, including ext2fs_fallocate and
> > mk_hugefiles.c.
>
> Sounds familiar: http://marc.info/?l=linux-ext4&m=139898612510491&w=2
Yes, but I'm thinking of something which is a superset of
ext2fs_alloc_block2(). That is, that it should call the
get_alloc_block hook (and also adding a possible get_alloc_blocks
hook), and that a flag would control whether the data blocks would be
zero'ed or not. (Indeed, I was thinking originally of calling it
ext2fs_alloc_block3.)
> > What I'm currently wondering about is whether it's worth the interface
> > complexity to have something like a "struct ext2fs_allocation_request"
> > structure, so we can potentially add more hints that a future
> > implementation might use, or whether that's not worth it.
> >
> > What do folks think?
>
> I'm not sure changing a struct vs. changing whatever parameters we feed into
> that function is all that much different. I guess you could get around
> structure size changes by forcing callers to use a library allocator function.
> But OTOH large allocations are probably rare.
We can also insulate against structure sizes by using padding fields,
but the ultimate question is how complicated we want to make this
interface. We know it will be used by mk_hugeblock and the fallocate
interface. In theory it could be use by your fuse driver to do
allocations more efficiently. There is the question of whether it's
worth it, although it has crossed my mind that this might be an
interesting place to start experimenting with an eventual replacement
of the buddy-bitmap implementation in mballoc with something that use
in-memory rbtrees, for example....
- Ted
next prev parent reply other threads:[~2014-09-12 22:17 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 23:11 [PATCH 00/25] e2fsprogs Summer 2014 patchbomb, part 5.2 Darrick J. Wong
2014-09-08 23:11 ` [PATCH 01/25] e2fsck/debugfs: fix descriptor block size handling errors with journal_csum Darrick J. Wong
2014-09-11 16:43 ` Theodore Ts'o
2014-09-08 23:11 ` [PATCH 02/25] libext2fs: report bad magic over bad sb checksum Darrick J. Wong
2014-09-11 16:43 ` Theodore Ts'o
2014-09-08 23:11 ` [PATCH 03/25] misc: don't return ENOMEM if we run out of disk space Darrick J. Wong
2014-09-11 16:43 ` Theodore Ts'o
2014-09-08 23:12 ` [PATCH 04/25] libext2fs: write_journal_inode should check iterate return value Darrick J. Wong
2014-09-11 16:43 ` Theodore Ts'o
2014-09-08 23:12 ` [PATCH 05/25] mke2fs: allow creation of journal device with superblock checksum Darrick J. Wong
2014-09-11 16:43 ` Theodore Ts'o
2014-09-08 23:12 ` [PATCH 06/25] e2fsck: detect and repair external journal superblock checksum errors Darrick J. Wong
2014-09-11 16:43 ` Theodore Ts'o
2014-09-08 23:12 ` [PATCH 07/25] tune2fs: explicitly disallow tuning of journal devices Darrick J. Wong
2014-09-11 16:44 ` Theodore Ts'o
2014-09-08 23:12 ` [PATCH 08/25] dumpe2fs: display external journal feature flags Darrick J. Wong
2014-09-11 16:44 ` Theodore Ts'o
2014-09-08 23:12 ` [PATCH 09/25] misc: zero s_jnl_blocks when removing internal journal Darrick J. Wong
2014-09-11 16:44 ` Theodore Ts'o
2014-09-08 23:12 ` [PATCH 10/25] debugfs: create journal handling routines Darrick J. Wong
2014-09-11 18:53 ` Theodore Ts'o
2014-09-11 19:03 ` Darrick J. Wong
2014-09-11 20:14 ` Theodore Ts'o
2014-09-11 20:25 ` Darrick J. Wong
2014-09-08 23:12 ` [PATCH 11/25] e2fsck: fix minor errors in journal handling Darrick J. Wong
2014-09-11 20:58 ` Theodore Ts'o
2014-09-08 23:12 ` [PATCH 12/25] debugfs: add the ability to write transactions to the journal Darrick J. Wong
2014-09-11 20:58 ` Theodore Ts'o
2014-09-08 23:13 ` [PATCH 13/25] tests: test writing and recovering checksum-free 32/64bit journals Darrick J. Wong
2014-09-11 20:59 ` Theodore Ts'o
2014-09-08 23:13 ` [PATCH 14/25] tests: test writing and recovering 64bit csum_v3 journals Darrick J. Wong
2014-09-11 20:59 ` Theodore Ts'o
2014-09-08 23:13 ` [PATCH 15/25] tests: test writing and recovering 32bit " Darrick J. Wong
2014-09-11 20:59 ` Theodore Ts'o
2014-09-08 23:13 ` [PATCH 16/25] tests: write and replay blocks with the old journal checksum Darrick J. Wong
2014-09-11 20:59 ` Theodore Ts'o
2014-09-08 23:13 ` [PATCH 17/25] tests: test recovery of 32 and 64-bit journals with checksum v2 Darrick J. Wong
2014-09-11 20:59 ` Theodore Ts'o
2014-09-08 23:13 ` [PATCH 18/25] tests: test how e2fsck recovers from corrupt journal superblocks Darrick J. Wong
2014-09-11 21:04 ` Theodore Ts'o
2014-09-08 23:13 ` [PATCH 19/25] tests: test e2fsck recovery of corrupt revoke blocks Darrick J. Wong
2014-09-11 21:04 ` Theodore Ts'o
2014-09-08 23:13 ` [PATCH 20/25] tests: test e2fsck recovery with broken commit blocks Darrick J. Wong
2014-09-11 21:04 ` Theodore Ts'o
2014-09-08 23:13 ` [PATCH 21/25] tests: test e2fsck recovery of corrupt descriptor blocks Darrick J. Wong
2014-09-10 1:15 ` Darrick J. Wong
2014-09-11 17:33 ` Darrick J. Wong
2014-09-11 18:18 ` Theodore Ts'o
2014-09-11 18:40 ` Darrick J. Wong
2014-09-11 19:31 ` [PATCH 21/25 v2] " Darrick J. Wong
2014-09-11 22:34 ` Theodore Ts'o
2014-09-08 23:14 ` [PATCH 22/25] tests: test recovery from an external journal Darrick J. Wong
2014-09-11 21:04 ` Theodore Ts'o
2014-09-08 23:14 ` [PATCH 23/25] ext2fs: add readahead method to improve scanning Darrick J. Wong
2014-09-11 21:10 ` Theodore Ts'o
2014-09-11 21:29 ` [PATCH 23/25 v2] " Darrick J. Wong
2014-09-08 23:14 ` [PATCH 24/25] libext2fs/e2fsck: provide routines to read-ahead metadata Darrick J. Wong
2014-09-08 23:14 ` [PATCH 25/25] e2fsck: read-ahead metadata during passes 1, 2, and 4 Darrick J. Wong
2014-09-09 22:53 ` [PATCH 00/25] e2fsprogs Summer 2014 patchbomb, part 5.2 Andreas Dilger
2014-09-10 1:13 ` Darrick J. Wong
2014-09-11 19:41 ` [PATCH 26/25] libext2fs: call get_alloc_block hook when allocating blocks Darrick J. Wong
2014-09-11 22:05 ` Theodore Ts'o
2014-09-11 22:34 ` Darrick J. Wong
2014-09-12 17:35 ` Theodore Ts'o
2014-09-12 17:57 ` Darrick J. Wong
2014-09-12 22:17 ` Theodore Ts'o [this message]
2014-09-13 0:13 ` Darrick J. Wong
2014-09-11 19:43 ` [PATCH 27/25] tune2fs: always check disable_uninit_bg() return code Darrick J. Wong
2014-09-11 22:07 ` Theodore Ts'o
2014-09-11 19:44 ` [PATCH 28/25] e2fsck: ignore badblocks if it says badblocks inode is bad Darrick J. Wong
2014-09-11 22:09 ` Theodore Ts'o
2014-09-11 19:48 ` [PATCH 29/25] e2fsck: expand root dir if linking l+f fails Darrick J. Wong
2014-09-11 22:10 ` Theodore Ts'o
2014-09-11 20:17 ` [PATCH 30/25] libext2fs: check ea value offset when loading Darrick J. Wong
2014-09-11 22:11 ` Theodore Ts'o
2014-09-11 22:33 ` [PATCH 00/25] e2fsprogs Summer 2014 patchbomb, part 5.2 Theodore Ts'o
2014-09-11 22:50 ` Darrick J. Wong
2014-09-11 22:52 ` Theodore Ts'o
2014-09-11 23:07 ` Darrick J. Wong
2014-09-11 23:14 ` Theodore Ts'o
2014-09-11 23:30 ` Darrick J. Wong
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=20140912221753.GB27092@thunk.org \
--to=tytso@mit.edu \
--cc=darrick.wong@oracle.com \
--cc=linux-ext4@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.