linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: "Misono, Tomohiro" <misono.tomohiro@jp.fujitsu.com>,
	Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: Re: [PATCH 5/5] btrfs: Show more accurate max_inline
Date: Fri, 2 Mar 2018 10:33:29 +0200	[thread overview]
Message-ID: <4c45603e-6747-a30c-3ed9-1fecb48fc358@suse.com> (raw)
In-Reply-To: <51d4f512-364d-61f5-be5b-4f996d82249e@jp.fujitsu.com>



On  2.03.2018 10:21, Misono, Tomohiro wrote:
> On 2018/03/02 14:22, Qu Wenruo wrote:
>> Btrfs shows max_inline option into kernel message, but for
>> max_inline=4096, btrfs won't really inline 4096 bytes inline data if
>> it's not compressed.
> 
> Hello,
> I have a question.
> 
> man mount(8) says: 
>    max_inline=bytes
>           Specify  the  maximum  amount  of space, in bytes, that can be
>           inlined in a metadata B-tree leaf.  The value is specified  in
>           bytes,  optionally with a K, M, or G suffix, case insensitive.
>           In practice, this value is limited by the  root  sector  size,
>           with  some  space  unavailable  due to leaf headers.  For a 4k
>           sectorsize, max inline data is ~3900 bytes.
> 
> So, is the size of 4k-(size of leaf header) actually the maximum value
> of max_inline instead of 4095 for 4k sectorsize?

I think the documentation is wrong. Without patch 3/5 we have the max
inline data size as:

BTRFS_MAX_ITEM_SIZE(info) - BTRFS_FILE_EXTENT_INLINE_DATA_START

so MAX_ITEM_SIZE  = nodesize - sizeof(btrfs_header) -
sizeof(btrfs_item).  So this gives us the data portion in the leaf.

So if we substitute the raw number we get:

16k - 101 - 25 = 16258 bytes.

>From this number we also subtract the offset of disk_bytenr in
btrfs_file_extent_item (which is 21). So we end up with
MAX_INLINE_DATA_SIZE of 16258 - 21 = 16237

With Qu's patch the min_t will always be taking 4095 as the
MAX_INLINE_DATA_SIZE.

> 
> Thanks,
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2018-03-02  8:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02  5:22 [PATCH 0/5] max_inline related enhancement Qu Wenruo
2018-03-02  5:22 ` [PATCH 1/5] btrfs: Parse options after node/sector size initialized Qu Wenruo
2018-03-07 15:20   ` David Sterba
2018-03-02  5:22 ` [PATCH 2/5] btrfs: Always limit inline extent size by uncompressed size Qu Wenruo
2018-03-02 10:46   ` Filipe Manana
2018-03-02 10:54     ` Qu Wenruo
2018-03-02 11:00       ` Filipe Manana
2018-03-02 11:40         ` Qu Wenruo
2018-03-06 11:58           ` David Sterba
2018-03-06 12:08             ` Qu Wenruo
2018-03-02  5:22 ` [PATCH 3/5] btrfs: Embed sector size check into BTRFS_MAX_INLINE_DATA_SIZE() Qu Wenruo
2018-03-06 12:34   ` David Sterba
2018-03-02  5:22 ` [PATCH 4/5] btrfs: Unify inline extent creation condition for plain and compressed data Qu Wenruo
2018-03-02  5:22 ` [PATCH 5/5] btrfs: Show more accurate max_inline Qu Wenruo
2018-03-02  8:21   ` Misono, Tomohiro
2018-03-02  8:33     ` Nikolay Borisov [this message]
2018-03-02  8:34     ` Qu Wenruo
2018-03-02  8:37       ` Nikolay Borisov
2018-03-02 10:57         ` Qu Wenruo
2018-03-02  8:13 ` [PATCH 0/5] max_inline related enhancement Nikolay Borisov

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=4c45603e-6747-a30c-3ed9-1fecb48fc358@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=misono.tomohiro@jp.fujitsu.com \
    --cc=wqu@suse.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 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).