[LU-4865] osd-zfs: increase object block size dynamically as object grows Created: 06/Apr/14  Updated: 22/Jun/22  Resolved: 29/Aug/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.9.0

Type: Improvement Priority: Minor
Reporter: Isaac Huang (Inactive) Assignee: Jinshan Xiong (Inactive)
Resolution: Fixed Votes: 0
Labels: RZ_LS, zfs

Issue Links:
Related
is related to LU-6152 zfs large block support Resolved
is related to LU-15963 sanityn test_56b: OSS OOM with ZFS In Progress
is related to LU-7404 ZFS OSS - Numerous timeouts - SWL Resolved
is related to LU-8591 allow specifying ZFS blocksize via la... Open
is related to LU-7226 improve osd-zfs blocksize heuristics Resolved
Rank (Obsolete): 13423

 Description   

The ZFS VFS code does change blocksize as file grows, e.g. in zfs_write()->zfs_grow_blocksize(). But the osd-zfs just opens the objset and manipulate it directly by the DMU API, shortcutting ZFS VFS layers, so the zfs_grow_blocksize() logic will not work for us.

Currently the osd-zfs set blocksize to 0 on MDS (then ZFS converts it to the default 512 byte block size), and to 128K on OSS. Neither is optimal setting. We may need to duplicate the ZPL functionality to grow block size dynamically as well.



 Comments   
Comment by Isaac Huang (Inactive) [ 23/Jan/15 ]

For large block support, the hard-coded 128K block size in osd_mkreg() should be changed.

Comment by Brian Behlendorf [ 24/Jan/15 ]

This really needs to be implemented in Lustre to ensure good performance over a range of file sizes. While you can't use zfs_grow_blocksize since it's part of the ZPL. This is really just a thin wrapper around dmu_object_set_blocksize() which does all the heavy lifting, and this is available. It will also properly enforce the maximum supported block size allowed by the feature flags.

Comment by Brian Behlendorf [ 28/Jan/15 ]

I'll very likely take a crack at this tomorrow since this code is fresh in my mind after working on LU-6152.

Comment by Isaac Huang (Inactive) [ 19/Mar/15 ]

A comment from Eric: The first write to a file might be at a large offset if multiple clients are all racing to write at different offsets in a shared Lustre file, but the client could send a hint with that first write that this file looks like it's streaming.

Comment by Brian Behlendorf [ 20/Apr/15 ]

A write to any offset larger than the maximum block size needs to result in the maximum block size being used for the file.

Comment by Andreas Dilger [ 08/May/15 ]

As an enhancement after the basic implementation of the "grow block size to match file size, and choose maximum blocksize" code is done is to hook the block size selection into the ladvise call (LU-4931) to have LADVISE_RANDOM select a smaller blocksize, or even allow that call to specify the random IO blocksize along with the flag. That would avoid large read-modify-write operations with large blocksize, similar to how it is possible to specify the blocksize for a ZVOL.

Comment by Gerrit Updater [ 03/Jun/15 ]

Jinshan Xiong (jinshan.xiong@intel.com) uploaded a new patch: http://review.whamcloud.com/15127
Subject: LU-4865 zfs: grow block size by write pattern
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 7fc0e68df9f917fb0f590f3169867dfa082f6373

Comment by Gerrit Updater [ 10/Sep/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/15127/
Subject: LU-4865 zfs: grow block size by write pattern
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 3e4369135127b350dbc26a4a5dc94cfa46e394cf

Comment by Joseph Gmitter (Inactive) [ 10/Sep/15 ]

Landed for 2.8.0

Comment by Gerrit Updater [ 05/Nov/15 ]

Andreas Dilger (andreas.dilger@intel.com) uploaded a new patch: http://review.whamcloud.com/17053
Subject: Revert "LU-4865 zfs: grow block size by write pattern"
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 2c3835d58993488669d15c2603d8fbbfd55f40d4

Comment by Gerrit Updater [ 13/Nov/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/17053/
Subject: Revert "LU-4865 zfs: grow block size by write pattern"
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: d690560bcef69cfe91747ffb8a7efb77c04800e6

Comment by Gerrit Updater [ 13/Feb/16 ]

Jinshan Xiong (jinshan.xiong@intel.com) uploaded a new patch: http://review.whamcloud.com/18441
Subject: LU-4865 zfs: grow block size by write pattern
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c2f3cb1cd31bb69b5ca08a56485e4fa4d7e03d7d

Comment by Gerrit Updater [ 29/Aug/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/18441/
Subject: LU-4865 zfs: grow block size by write pattern
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: b738c4850935f3a9c483b3141cb37d6539557615

Comment by Joseph Gmitter (Inactive) [ 29/Aug/16 ]

Landed to master for 2.9.0

Generated at Sat Feb 10 01:46:32 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.