All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: "dsterba@suse.cz" <dsterba@suse.cz>,
	David Sterba <dsterba@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] btrfs: zoned: fix compressed writes
Date: Mon, 17 May 2021 13:39:37 +0200	[thread overview]
Message-ID: <20210517113937.GM7604@twin.jikos.cz> (raw)
In-Reply-To: <PH0PR04MB74168343747A058F5F53D8309B2D9@PH0PR04MB7416.namprd04.prod.outlook.com>

On Mon, May 17, 2021 at 11:21:49AM +0000, Johannes Thumshirn wrote:
> On 17/05/2021 09:07, Johannes Thumshirn wrote:
> >>> +	if (use_append) {
> >>> +		struct extent_map *em;
> >>> +		struct map_lookup *map;
> >>> +
> >>> +		em = btrfs_get_chunk_map(fs_info, disk_start, PAGE_SIZE);
> >> The caller already does the em lookup, so this is duplicate, allocating
> >> memory, taking locks and doing a tree lookup. All happening on write out
> >> path so this seems heavy.
> > Right, I did not check this, sorry. Is it OK to add another patch as 
> > preparation swapping some of the parameters to btrfs_submit_compressed_write()
> > from the em? Otherwise btrfs_submit_compressed_write() will have 10 parameters
> > which sounds awefull.
> > 
> 
> Actually I can't do that. The caller does calls create_io_em() while this patch
> needs to call brtfs_get_chunk_map(). The 'em' returned by create_io_em() does not
> have em->map_lookup populated and we need the stripe's block device from 
> em->map_lookup.
> 
> So it looks like we need to live with the additional memory allocation and locks.

Ok then, it's limited to zoned mode so the allocation won't affect
regular mode.

      reply	other threads:[~2021-05-17 11:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 14:01 [PATCH 0/2] btrfs: zoned: fix writes on a compressed zoned filesystem Johannes Thumshirn
2021-05-12 14:01 ` [PATCH 1/2] btrfs: zoned: pass start block to btrfs_use_zone_append Johannes Thumshirn
2021-05-12 14:01 ` [PATCH 2/2] btrfs: zoned: fix compressed writes Johannes Thumshirn
2021-05-12 14:42   ` David Sterba
2021-05-17  7:07     ` Johannes Thumshirn
2021-05-17  9:12       ` David Sterba
2021-05-17  9:20         ` Johannes Thumshirn
2021-05-17 11:21       ` Johannes Thumshirn
2021-05-17 11:39         ` David Sterba [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=20210517113937.GM7604@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@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.