From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH v3 5/8] gfs2: Implement iomap buffered write support
Date: Fri, 6 Apr 2018 10:44:13 -0400 (EDT) [thread overview]
Message-ID: <807083870.16612494.1523025853631.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20180323191728.23819-6-agruenba@redhat.com>
Hi,
----- Original Message -----
(snip)
> +static int gfs2_iomap_begin_write(struct inode *inode, loff_t pos, loff_t
> length,
> + unsigned flags, struct iomap *iomap)
(snip)
> +{
> + struct metapath mp = { .mp_aheight = 1, };
> + struct gfs2_inode *ip = GFS2_I(inode);
> + struct gfs2_sbd *sdp = GFS2_SB(inode);
> + unsigned int data_blocks = 0, ind_blocks = 0, rblocks;
> + bool unstuff, alloc_required;
> + int ret;
> +
> + ret = gfs2_write_lock(inode);
> + if (ret)
> + return ret;
> +
> + unstuff = gfs2_is_stuffed(ip) &&
> + pos + length > gfs2_max_stuffed_size(ip);
> +
> + ret = gfs2_iomap_get(inode, pos, length, flags, iomap, &mp);
> + if (ret)
> + goto out_release;
> +
> + alloc_required = unstuff || iomap->type != IOMAP_MAPPED;
> +
> + if (alloc_required || gfs2_is_jdata(ip))
> + gfs2_write_calc_reserv(ip, iomap->length, &data_blocks, &ind_blocks);
It would be ideal if the iomap_get could tell us how many blocks are mapped
and how many are unmapped, if it wouldn't cause unnecessary IO.
If we could use the number of unmapped blocks rather than iomap->length, it could
potentially save us from reserving unnecessary journal space, for example, on
rewrites (iow where the metadata for the writes already exists).
(snip)
Bob Peterson
WARNING: multiple messages have this Message-ID (diff)
From: Bob Peterson <rpeterso@redhat.com>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: cluster-devel@redhat.com, Christoph Hellwig <hch@lst.de>,
linux-fsdevel@vger.kernel.org
Subject: Re: [Cluster-devel] [PATCH v3 5/8] gfs2: Implement iomap buffered write support
Date: Fri, 6 Apr 2018 10:44:13 -0400 (EDT) [thread overview]
Message-ID: <807083870.16612494.1523025853631.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20180323191728.23819-6-agruenba@redhat.com>
Hi,
----- Original Message -----
(snip)
> +static int gfs2_iomap_begin_write(struct inode *inode, loff_t pos, loff_t
> length,
> + unsigned flags, struct iomap *iomap)
(snip)
> +{
> + struct metapath mp = { .mp_aheight = 1, };
> + struct gfs2_inode *ip = GFS2_I(inode);
> + struct gfs2_sbd *sdp = GFS2_SB(inode);
> + unsigned int data_blocks = 0, ind_blocks = 0, rblocks;
> + bool unstuff, alloc_required;
> + int ret;
> +
> + ret = gfs2_write_lock(inode);
> + if (ret)
> + return ret;
> +
> + unstuff = gfs2_is_stuffed(ip) &&
> + pos + length > gfs2_max_stuffed_size(ip);
> +
> + ret = gfs2_iomap_get(inode, pos, length, flags, iomap, &mp);
> + if (ret)
> + goto out_release;
> +
> + alloc_required = unstuff || iomap->type != IOMAP_MAPPED;
> +
> + if (alloc_required || gfs2_is_jdata(ip))
> + gfs2_write_calc_reserv(ip, iomap->length, &data_blocks, &ind_blocks);
It would be ideal if the iomap_get could tell us how many blocks are mapped
and how many are unmapped, if it wouldn't cause unnecessary IO.
If we could use the number of unmapped blocks rather than iomap->length, it could
potentially save us from reserving unnecessary journal space, for example, on
rewrites (iow where the metadata for the writes already exists).
(snip)
Bob Peterson
next prev parent reply other threads:[~2018-04-06 14:44 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 19:17 [Cluster-devel] [PATCH v3 0/8] gfs2 iomap write support Andreas Gruenbacher
2018-03-23 19:17 ` Andreas Gruenbacher
2018-03-23 19:17 ` [Cluster-devel] [PATCH v3 1/8] gfs2: gfs2_stuffed_write_end cleanup Andreas Gruenbacher
2018-03-23 19:17 ` Andreas Gruenbacher
2018-03-23 19:17 ` [Cluster-devel] [PATCH v3 2/8] gfs2: Remove ordered write mode handling from gfs2_trans_add_data Andreas Gruenbacher
2018-03-23 19:17 ` Andreas Gruenbacher
2018-03-23 19:17 ` [Cluster-devel] [PATCH v3 3/8] gfs2: Iomap cleanups and improvements Andreas Gruenbacher
2018-03-23 19:17 ` Andreas Gruenbacher
2018-04-06 14:06 ` [Cluster-devel] " Bob Peterson
2018-04-06 14:06 ` Bob Peterson
2018-04-06 15:19 ` Andreas Gruenbacher
2018-04-06 15:19 ` Andreas Gruenbacher
2018-03-23 19:17 ` [Cluster-devel] [PATCH v3 4/8] iomap: Add write_{begin, end} iomap operations Andreas Gruenbacher
2018-03-23 19:17 ` [PATCH v3 4/8] iomap: Add write_{begin,end} " Andreas Gruenbacher
2018-03-23 19:17 ` [Cluster-devel] [PATCH v3 5/8] gfs2: Implement iomap buffered write support Andreas Gruenbacher
2018-03-23 19:17 ` Andreas Gruenbacher
2018-04-06 14:44 ` Bob Peterson [this message]
2018-04-06 14:44 ` [Cluster-devel] " Bob Peterson
2018-04-06 15:15 ` Andreas Grünbacher
2018-04-06 15:15 ` Andreas Grünbacher
2018-03-23 19:17 ` [Cluster-devel] [PATCH v3 6/8] gfs2: Implement iomap direct I/O support Andreas Gruenbacher
2018-03-23 19:17 ` Andreas Gruenbacher
2018-04-06 15:08 ` [Cluster-devel] " Bob Peterson
2018-04-06 15:08 ` Bob Peterson
2018-03-23 19:17 ` [Cluster-devel] [PATCH v3 7/8] gfs2: Remove gfs2_write_{begin, end} Andreas Gruenbacher
2018-03-23 19:17 ` [PATCH v3 7/8] gfs2: Remove gfs2_write_{begin,end} Andreas Gruenbacher
2018-03-23 19:17 ` [Cluster-devel] [PATCH v3 8/8] iomap: Complete partial direct I/O writes synchronously Andreas Gruenbacher
2018-03-23 19:17 ` Andreas Gruenbacher
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=807083870.16612494.1523025853631.JavaMail.zimbra@redhat.com \
--to=rpeterso@redhat.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 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.