public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Sungjong Seo" <sj1557.seo@samsung.com>
To: "'linkinjeon'" <linkinjeon@kernel.org>
Cc: "'linux-fsdevel'" <linux-fsdevel@vger.kernel.org>,
	"'linux-kernel'" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2 0/3] exfat: remove duplicate write directory entries
Date: Thu, 21 Jul 2022 09:36:42 +0900	[thread overview]
Message-ID: <011d01d89c99$f2b1fd70$d815f850$@samsung.com> (raw)
In-Reply-To: <SG2PR04MB3899752B10CFB6CF93A6127C81879@SG2PR04MB3899.apcprd04.prod.outlook.com>

> Changes for v2:
>   - [1/3]: Fix timing of calling __exfat_write_inode()
>     - __exfat_write_inode() should be called after updating inode.
>     - This call will be removed in [3/3], so the patch series is
>       no code changes between v1 and v2.
> 
> 
> These patches simplifie the code, and removes unnecessary writes for the
> following operations.

Looks good. Thanks.

Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>

> 
> 1. Write data to an empty file
>   * Preparation
>     ```
>     mkdir /mnt/dir;touch /mnt/dir/file;sync
>     ```
>   * Capture the blktrace log of the following command
>     ```
>     dd if=/dev/zero of=/mnt/dir/file bs=${cluster_size} count=1
> oflag=append conv=notrunc
>     ```
>   * blktrace log
>     * Before
>       ```
>       179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]
> BootArea
>       179,3    2        1    30.259435003   189  C   W 2628864 + 256 [0]
> /dir/file
>       179,3    0        2    30.264066003    84  C   W 2627584 + 1 [0]
> BitMap
>       179,3    2        2    30.261749337   189  C   W 2628608 + 1 [0]        /dir/
>       179,3    0        3    60.479159007    84  C   W 2628608 + 1 [0]        /dir/
>       ```
>     * After
>       ```
>       179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]
> BootArea
>       179,3    3        1    30.185383337    87  C   W 2629888 + 256 [0]
> /dir/file
>       179,3    0        2    30.246422004    84  C   W 2627584 + 1 [0]
> BitMap
>       179,3    0        3    60.466497674    84  C   W 2628352 + 1 [0]        /dir/
>       ```
> 
> 2. Allocate a new cluster for a directory
>   * Preparation
>     ```
>     mkdir /mnt/dir
>     for ((i=1; i<cluster_size/96; i++)); do > /mnt/dir/file$i; done
>     mkdir /mnt/dir/dir1; sync
>     ```
>   * Capture the blktrace log of the following command
>     ```
>     > /mnt/dir/file
>     ```
>   * blktrace log
>     - Before
>       ```
>       179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]
> BootArea
>       179,3    2        1    30.263762003   189  C   W 2629504 + 128 [0]      /dir/
>       179,3    2        2    30.275596670   189  C   W 2629376 + 128 [0]      /dir/
>       179,3    2        3    30.290174003   189  C   W 2629119 + 1 [0]        /dir/
>       179,3    2        4    30.292362670   189  C   W 2628096 + 1 [0]        /
>       179,3    2        5    30.294547337   189  C   W 2627584 + 1 [0]
> BitMap
>       179,3    0        2    30.296661337    84  C   W 2625536 + 1 [0]
> FatArea
>       179,3    0        3    60.478775007    84  C   W 2628096 + 1 [0]        /
>       ```
>     - After
>       ```
>       179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]
> BootArea
>       179,3    3        1    30.288114670    87  C   W 2631552 + 128 [0]      /dir/
>       179,3    3        2    30.303518003    87  C   W 2631424 + 128 [0]      /dir/
>       179,3    3        3    30.324212337    87  C   W 2631167 + 1 [0]        /dir/
>       179,3    3        4    30.326579003    87  C   W 2627584 + 1 [0]
> BitMap
>       179,3    0        2    30.328892670    84  C   W 2625536 + 1 [0]
> FatArea
>       179,3    0        3    60.503128674    84  C   W 2628096 + 1 [0]        /
>       ```
> 
> 3. Truncate and release cluster from the file
>   * Preparation
>     ```
>     mkdir /mnt/dir
>     dd if=/dev/zero of=/mnt/dir/file bs=${cluster_size} count=2
>     sync
>     ```
>   * Capture the blktrace log of the following command
>     ```
>     truncate -s ${cluster_size} /mnt/dir/file
>     ```
> 
>   * blktrace log
>     * Before
>       ```
>       179,3    0        1     0.000000000    84  C  WS 2623488 + 1 [0]
> BootArea
>       179,3    1        1     5.048452334    49  C   W 2629120 + 1 [0]        /dir/
>       179,3    0        2     5.062994334    84  C   W 2627584 + 1 [0]        BitMap
>       179,3    0        3    10.031253002    84  C   W 2629120 + 1 [0]        /dir/
>       ```
> 
>      * After
>       ```
>       179,3    0        1     0.000000000  9143  C  WS 2623488 + 1 [0]
> BootArea
>       179,3    0        2    14.839244001  9143  C   W 2629888 + 1 [0]        /dir/
>       179,3    0        3    14.841562335  9143  C   W 2627584 + 1 [0]
> BitMap
>       ```
> 
> Yuezhang Mo (3):
>   exfat: reuse __exfat_write_inode() to update directory entry
>   exfat: remove duplicate write inode for truncating file
>   exfat: remove duplicate write inode for extending dir/file
> 
>  fs/exfat/exfat_fs.h |  1 +
>  fs/exfat/file.c     | 82 ++++++++++++++-------------------------------
>  fs/exfat/inode.c    | 41 ++++++-----------------
>  fs/exfat/namei.c    | 20 -----------
>  4 files changed, 37 insertions(+), 107 deletions(-)
> 
> --
> 2.25.1


       reply	other threads:[~2022-07-21  0:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220711093004epcas1p4b7f4a4426c8d4f950631731156d95aa3@epcas1p4.samsung.com>
     [not found] ` <SG2PR04MB3899752B10CFB6CF93A6127C81879@SG2PR04MB3899.apcprd04.prod.outlook.com>
2022-07-21  0:36   ` Sungjong Seo [this message]
2022-07-22  6:32   ` [PATCH v2 0/3] exfat: remove duplicate write directory entries Namjae Jeon

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='011d01d89c99$f2b1fd70$d815f850$@samsung.com' \
    --to=sj1557.seo@samsung.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox