All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: "Friendy.Su@sony.com" <Friendy.Su@sony.com>,
	"linux-erofs@lists.ozlabs.org" <linux-erofs@lists.ozlabs.org>
Cc: "Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com>,
	"Daniel.Palmer@sony.com" <Daniel.Palmer@sony.com>
Subject: Re: [PATCH v1] erofs-utils: mkfs: Implement 'dsunit' alignment on blobdev
Date: Thu, 21 Aug 2025 11:39:06 +0800	[thread overview]
Message-ID: <97d6c19f-1faf-423f-83e7-0996fff2ca26@linux.alibaba.com> (raw)
In-Reply-To: <6b611a64-6a63-4588-acbf-dd853d3bc624@linux.alibaba.com>



On 2025/8/21 11:33, Gao Xiang wrote:
> Hi Friendy,
> 
> On 2025/8/21 11:17, Friendy.Su@sony.com wrote:
>> Hi, Gao,
>>
>>> So I tend to just constrain the case to your limited case
>>> first, could you explain more if chunk deduplication is
>>> needed for your scenarios? and what's your real `chunksize`?
>>
>> chunk deduplication is needed.
>>
>> As I wrote in commit msg, we expect scenario below:
>>
>> 1. mount with -o dax=always,
>> 2. application calls mmap(addr, file).
>> 3. application read from addr, page fault is triggered.
>> We hope in kernel, erofs_dax_vm_ops.huge_fault() can be handled, do not fallback to erofs_dax_vm_ops.fault().
> 
> I totally understand the runtime side, but in short:
> 
>>
>> This required file body on blob devices aligned on huge page(2M), and deduplicate unit also is 2M. We can specify --dsunit=512, --chunksize=2*1024*1024 to fulfill this.
>>
>> I don't think need a new command option.
>> Currently, '--dsunit' can be set for formatting blobdev. The following cmdline completes successfully. User certainly thinks mkfs.erofs has executed --dsunit alignment.
>> But actually, it does not.  This patch just simply makes actual runtime fit for cmdline looks like.
>>
>> mkfs.erofs --blobdev /dev/sdb1 --dsunit 512 ......
>>
>> If actually `--dsunit` does not work on blobdev, should prompt warning msg to user.
> 
> My cercern is why `--chunksize=4096 --dsunit=512` will not
> lead to each 4k chunk to the 2M data boundary, is it obvious?
> 
> chunksize = 4096
> dsunit = 512 = 2M
> 
> inode A (8k)    2M, 4M
> inode B (12k)    6M, 2M, 4M, 8M?
> 
> Are you sure if there is no such use case in the
> future? Mixing `--chunksize=4096 --dsunit=512` seems
> non-obvious for this case.

Or as I mentioned before, I'm fine to leave each `dsunit` logical
aligned chunks (but not any deduplicated chunk in this logical range)
alignes with dsunit value, it enables PMD-mapping as you mentioned.

But if there is some deduplciated chunks in the logical dsunit
boundary, don't align it at all since there is no real benefit.
Although I'm still not sure what's the default behavior of `dsunit`
for chunks.

Thanks,
Gao Xiang

> 
> Thanks,
> Gao Xiang
> 
> 
>>
>> Best Regards
>> Friendy Su
>>
>> ________________________________________
>> From: Gao Xiang <hsiangkao@linux.alibaba.com>
>> Sent: Thursday, August 21, 2025 10:00
>> To: Su, Friendy; linux-erofs@lists.ozlabs.org
>> Cc: Mo, Yuezhang; Palmer, Daniel (SGC)
>> Subject: Re: [PATCH v1] erofs-utils: mkfs: Implement 'dsunit' alignment on blobdev
>>
>> On 2025/8/20 17: 38, Friendy. Su@ sony. com wrote: > Hi, Gao, > >> What's your `--chunksize` ? consider the following: > > chunksize = 4096 > dsunit = 512 = 2M > >> and two inodes: > >> inode A (8k) 2M, 2M+4k
>>
>>
>>
>>
>> On 2025/8/20 17:38, Friendy.Su@sony.com wrote:
>>> Hi, Gao,
>>>
>>>> What's your `--chunksize` ? consider the following:
>>>
>>>     chunksize = 4096
>>>     dsunit = 512 = 2M
>>>
>>>> and two inodes:
>>>
>>>> inode A (8k)    2M, 2M+4k
>>>
>>>> inode B (12k)   4M, 2M, 4M+4k, 4M+8k?
>>>
>>>> Is it possible? what's the expected behavior of
>>>> this case.
>>>
>>> Yes. This is the expected behavior. See runtime below:
>>
>> I understand that is the expected behavior according to this
>> patch, but I'm just unsure if it's an expected behavior for
>> the future wider setups (because some users may use `--dsunit`
>> for other usage).
>>
>> So I tend to just constrain the case to your limited case
>> first, could you explain more if chunk deduplication is
>> needed for your scenarios? and what's your real `chunksize`?
>>
>> Maybe adding another command option for this is better.
>>
>> Thanks,
>> Gao Xiang
> 



  reply	other threads:[~2025-08-21  3:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20  7:23 [PATCH v1] erofs-utils: mkfs: Implement 'dsunit' alignment on blobdev Friendy Su
2025-08-20  7:44 ` Gao Xiang
2025-08-20  9:00   ` Friendy.Su
2025-08-20  9:12     ` Gao Xiang
2025-08-20  9:38       ` Friendy.Su
2025-08-21  2:00         ` Gao Xiang
2025-08-21  3:17           ` Friendy.Su
2025-08-21  3:33             ` Gao Xiang
2025-08-21  3:39               ` Gao Xiang [this message]
2025-08-21  9:36                 ` Friendy.Su
2025-08-21 10:03                   ` Gao Xiang
2025-08-21 10:13                     ` Friendy.Su

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=97d6c19f-1faf-423f-83e7-0996fff2ca26@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=Daniel.Palmer@sony.com \
    --cc=Friendy.Su@sony.com \
    --cc=Yuezhang.Mo@sony.com \
    --cc=linux-erofs@lists.ozlabs.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.