All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Pankaj Raghav <p.raghav@samsung.com>, David Sterba <dsterba@suse.com>
Cc: Josef Bacik <josef@toxicpanda.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Javier Gonzalez <javier.gonz@samsung.com>
Subject: Re: [PATCH 5/5] btrfs: zoned: make auto-reclaim less aggressive
Date: Wed, 23 Mar 2022 09:11:55 +0000	[thread overview]
Message-ID: <PH0PR04MB7416CD1BC88132E22790A1869B189@PH0PR04MB7416.namprd04.prod.outlook.com> (raw)
In-Reply-To: f4e4a70c-0349-fafa-8375-8c4177a3e260@samsung.com

On 23/03/2022 10:09, Pankaj Raghav wrote:
> Hi Johannes,
> 
> I tried this patchset and I am noticing a weird behaviour wrt the value
> of factor in btrfs_zoned_should_reclaim function.
> 
> Here is my setup in QEMU:
> size 12800M
> zoned=true,zoned.zone_capacity=128M,zoned.zone_size=128M
> 
> btrfs mkfs:
> mkfs.btrfs -d single -m single <znsdev>;  mount -t auto <znsdev>
> /mnt/real_scratch
> 
> I added a print statement in btrfs_zoned_should_reclaim to get the
> values for the factor, used and total params.
> 
> When I run the btrfs/237 xfstest, I am noticing the following values:
> [   54.829309] btrfs: factor: 4850 used: 19528679424, total: 402653184
> 
> The used > total, thereby making the factor greater than 100. This will
> force a reclaim even though the drive is almost empty:
> 
>   start: 0x000000000, len 0x040000, cap 0x040000, wptr 0x000078 reset:0
> non-seq:0, zcond: 2(oi) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x000040000, len 0x040000, cap 0x040000, wptr 0x000000 reset:0
> non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x000080000, len 0x040000, cap 0x040000, wptr 0x0001e0 reset:0
> non-seq:0, zcond: 2(oi) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x0000c0000, len 0x040000, cap 0x040000, wptr 0x000d80 reset:0
> non-seq:0, zcond: 2(oi) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x000100000, len 0x040000, cap 0x040000, wptr 0x000000 reset:0
> non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x000140000, len 0x040000, cap 0x040000, wptr 0x008520 reset:0
> non-seq:0, zcond: 2(oi) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x000180000, len 0x040000, cap 0x040000, wptr 0x000000 reset:0
> non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x0001c0000, len 0x040000, cap 0x040000, wptr 0x000000 reset:0
> non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x000200000, len 0x040000, cap 0x040000, wptr 0x000000 reset:0
> non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x000240000, len 0x040000, cap 0x040000, wptr 0x000000 reset:0
> non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x000280000, len 0x040000, cap 0x040000, wptr 0x000000 reset:0
> non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
>   start: 0x0002c0000, len 0x040000, cap 0x040000, wptr 0x000000 reset:0
> non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)]
> .....
> .....
> 
> I am also noticing the same behaviour for ZNS drive with size 1280M:
> 
> [   86.276409] btrfs: factor: 350 used: 1409286144, total: 402653184
> 
> Is something going wrong with the calculation? Or am I missing something
> here?
> 

Apparently I'm either too dumb for basic maths, or 
btrfs_calc_available_free_space() doesn't give us the values we're expecting.

I'll recheck.

  reply	other threads:[~2022-03-23  9:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 16:14 [PATCH 0/5] btrfs: rework background block group relocation Johannes Thumshirn
2022-03-21 16:14 ` [PATCH 1/5] btrfs: make the bg_reclaim_threshold per-space info Johannes Thumshirn
2022-03-22 17:32   ` Josef Bacik
2022-03-22 17:34     ` Johannes Thumshirn
2022-03-21 16:14 ` [PATCH 2/5] btrfs: allow block group background reclaim for !zoned fs'es Johannes Thumshirn
2022-03-22 17:38   ` Josef Bacik
2022-03-22 17:40     ` Johannes Thumshirn
2022-03-21 16:14 ` [PATCH 3/5] btrfs: change the bg_reclaim_threshold valid region from 0 to 100 Johannes Thumshirn
2022-03-21 16:14 ` [PATCH 4/5] btrfs: make calc_available_free_space available outside of space-info Johannes Thumshirn
2022-03-22 17:34   ` Josef Bacik
2022-03-21 16:14 ` [PATCH 5/5] btrfs: zoned: make auto-reclaim less aggressive Johannes Thumshirn
2022-03-23  9:08   ` Pankaj Raghav
2022-03-23  9:11     ` Johannes Thumshirn [this message]
2022-03-23  9:14       ` Pankaj Raghav
2022-03-23 10:39         ` Johannes Thumshirn
2022-03-23 11:24           ` Pankaj Raghav
2022-03-23 11:52             ` Johannes Thumshirn
2022-03-23 19:37               ` Pankaj Raghav
2022-03-24  0:06               ` Damien Le Moal

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=PH0PR04MB7416CD1BC88132E22790A1869B189@PH0PR04MB7416.namprd04.prod.outlook.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=dsterba@suse.com \
    --cc=javier.gonz@samsung.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.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.