[LU-8591] allow specifying ZFS blocksize via ladvise Created: 07/Sep/16  Updated: 16/Jul/19

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Andreas Dilger Assignee: WC Triage
Resolution: Unresolved Votes: 1
Labels: None

Issue Links:
Cloners
Clones LU-7225 change ladvise wire protocol for lock... Resolved
Related
is related to LU-4931 New feature of giving server/storage ... Resolved
is related to LU-4865 osd-zfs: increase object block size d... Resolved
is related to LU-11657 Prefetch whole ZFS block into client ... Open
is related to LU-7226 improve osd-zfs blocksize heuristics Resolved
Rank (Obsolete): 9223372036854775807

 Description   

As a continuation of LU-4931 "New feature of giving server/storage side advice of accessing file" and LU-4865 "osd-zfs: increase object block size dynamically as object grows" it is useful to be able to specify the ZFS blocksize for a file directly from the client, so that the OSS doesn't have to guess at this itself.

This can be done via the "ladvise" functionality by adding a new LU_LADVISE_BLOCKSIZE advice. There are reserved fields in the lu_ladvise struct for passing arbitrary information as part of the request.

struct lu_ladvise {
        __u16 lla_advice;       /* advice type */
        __u16 lla_value1;       /* values for different advice types */
        __u32 lla_value2;   
        __u64 lla_start;        /* first byte of extent for advice */
        __u64 lla_end;          /* last byte of extent for advice */
        __u32 lla_value3;   
        __u32 lla_value4;   
};

The blocksize can be up to 16MB (or possibly more in the future), so if specified in bytes it should go into lla_value2, but it might make sense to limit this to be a power-of-two value, in which case lla_value1 would be enough. It makes sense to #define lla_blocksize lla_valueX to map this to the correct field so that there are no errors in usage from userspace or in the kernel. It doesn't make sense to specify lla_start or lla_end for a single object, but it may be useful for PFL files, so that should be handled transparently by osd-zfs. It should return an error from osd-ldiskfs, or from osd-zfs if the blocksize is specified but it doesn't match the current blocksize and the blocksize is smaller than the current file size. Increasing the osd-zfs blocksize should be permitted, but it should be "sticky" on the object (at least until the object is evicted from RAM) so that dynamic blocksize heuristics from LU-7226 don't override the user-specified value.



 Comments   
Comment by Andreas Dilger [ 07/Sep/16 ]

Note that this same interface could also be used to specify the ZFS compression type and level on a per-file basis as well.

Generated at Sat Feb 10 02:18:53 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.