f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: introduce sysfs/data_io_flag to attach REQ_META/FUA
This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature.
-> attach REQ_FUA to Hot Data writes
-> attach REQ_FUA to Hot|Warm Data writes
-> attach REQ_FUA to Hot|Warm|Cold Data writes
-> attach REQ_FUA to Hot|Warm|Cold Data writes as well as
REQ_META to Hot Data writes
--- Documentation/ABI/testing/sysfs-fs-f2fs | 9 +++++++++ fs/f2fs/data.c | 23 +++++++++++++++++++++++ fs/f2fs/f2fs.h | 3 +++ fs/f2fs/sysfs.c | 3 ++- 4 files changed, 37 insertions(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-fs-f2fs +9 -0
@@ -323,3 +323,12 @@ What: /sys/fs/f2fs/<disk>/mounted_time_sec Date: February 2020 Contact: "Jaegeuk Kim" <[email protected]> Description: Show the mounted time in secs of this partition. + +What: /sys/fs/f2fs/<disk>/data_io_flag +Date: April 2020 +Contact: "Jaegeuk Kim" <[email protected]> +Description: Give a way to attach REQ_META|FUA to data writes + given temperature-based bits. Now the bits indicate: + * REQ_META | REQ_FUA | + * 5 | 4 | 3 | 2 | 1 | 0 | + * Cold | Warm | Hot | Cold | Warm | Hot |
fs/f2fs/data.c +23 -0
@@ -513,6 +513,28 @@ void f2fs_submit_bio(struct f2fs_sb_info *sbi,__submit_bio (sbi, bio, type); } +static void __attach_data_io_flag (struct f2fs_io_info *fio) +{ +struct f2fs_sb_info *sbi = fio->sbi; +unsigned int temp_mask = (1 <<NR_TEMP_TYPE ) -1 ; +unsigned int fua_flag = sbi->data_io_flag & temp_mask; +unsigned int meta_flag = (sbi->data_io_flag >>NR_TEMP_TYPE ) & + temp_mask; +/* +* data io flag bits per temp: +* REQ_META | REQ_FUA | +* 5 | 4 | 3 | 2 | 1 | 0 | +* Cold | Warm | Hot | Cold | Warm | Hot | +*/ +if (fio->type !=DATA ) +return ; + +if ((1 << fio->temp) & meta_flag) + fio->op_flags |=REQ_META ; +if ((1 << fio->temp) & fua_flag) + fio->op_flags |=REQ_FUA ; +} +static void __submit_merged_bio (struct f2fs_bio_info *io) {struct f2fs_io_info *fio = &io->fio;
@@ -520,6 +542,7 @@ static void __submit_merged_bio(struct f2fs_bio_info *io)if (!io->bio)return ; +__attach_data_io_flag (fio);bio_set_op_attrs (io->bio, fio->op, fio->op_flags);if (is_read_io (fio->op))
fs/f2fs/f2fs.h +3 -0
@@ -1510,6 +1510,9 @@ struct f2fs_sb_info {unsigned long long write_iostat[NR_IO_TYPE ];bool iostat_enable; +/* to attach REQ_META|REQ_FUA flags */ +unsigned int data_io_flag; +/* For sysfs suppport */ struct kobject s_kobj;struct completion s_kobj_unregister;
fs/f2fs/sysfs.c +2 -1
@@ -373,7 +373,6 @@ static ssize_t __sbi_store(struct f2fs_attr *a,return count; } -if (!strcmp (a->attr.name,"iostat_enable" )) { sbi->iostat_enable = !!t;if (!sbi->iostat_enable)
@@ -544,6 +543,7 @@ F2FS_RW_ATTR(F2FS_SBI, f2fs_super_block, extension_list, extension_list);F2FS_RW_ATTR (FAULT_INFO_RATE , f2fs_fault_info, inject_rate, inject_rate);F2FS_RW_ATTR (FAULT_INFO_TYPE , f2fs_fault_info, inject_type, inject_type);#endif +F2FS_RW_ATTR (F2FS_SBI , f2fs_sb_info, data_io_flag, data_io_flag);F2FS_GENERAL_RO_ATTR (dirty_segments);F2FS_GENERAL_RO_ATTR (free_segments);F2FS_GENERAL_RO_ATTR (lifetime_write_kbytes);
@@ -623,6 +623,7 @@ static struct attribute *f2fs_attrs[] = {ATTR_LIST (inject_rate),ATTR_LIST (inject_type), #endif +ATTR_LIST (data_io_flag),ATTR_LIST (dirty_segments),ATTR_LIST (free_segments), ATTR_LIST(unusable),
Signature · 1 line
2.26.0.292.g33ef6b2f38-goog
Quoted 11 lines · Jaegeuk Kim
This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature.
-> attach
REQ_FUAto Hot Data writes-> attach
REQ_FUAto Hot|Warm Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes as well as
REQ_METAto Hot Data writes
Out of curiosity, what scenario it is used for?
Thanks,
Jaegeuk Kim
maintainerQuoted 6 lines · Chao Yu
Quoted 5 lines · Jaegeuk Kim
This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature.
-> attach
REQ_FUAto Hot Data writes
Quoted 8 lines
Quoted 6 lines
-> attach
REQ_FUAto Hot|Warm Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes as well as
REQ_METAto Hot Data writesOut of curiosity, what scenario it is used for?
It's testing purpose to compare the bandwidths per different IO flags.
Quoted 2 lines
Thanks,
Quoted 9 lines · Jaegeuk Kim
Quoted 8 lines · Chao Yu
Quoted 7 lines · Jaegeuk Kim
This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature.
-> attach
REQ_FUAto Hot Data writes-> attach
REQ_FUAto Hot|Warm Data writes
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
-> attach
REQ_FUAto Hot|Warm|Cold Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes as well as
REQ_METAto Hot Data writesOut of curiosity, what scenario it is used for?
It's testing purpose to compare the bandwidths per different IO flags.
Thanks for the hint. :)
As nobarrier was set in Android, so REQ_PREFLUSH will not be considered in this sysfs interface?
Thanks,
Quoted 5 lines
Quoted 3 lines
Thanks,
.
Jaegeuk Kim
maintainerQuoted 15 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
Quoted 13 lines · Chao Yu
Quoted 11 lines · Jaegeuk Kim
This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature.
-> attach
REQ_FUAto Hot Data writes-> attach
REQ_FUAto Hot|Warm Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes as well as
REQ_METAto Hot Data writes
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Out of curiosity, what scenario it is used for?
It's testing purpose to compare the bandwidths per different IO flags.
Thanks for the hint. :)
As nobarrier was set in Android, so
REQ_PREFLUSHwill not be considered in this sysfs interface?
I don't see any diff on performance, so not interesting. :)
Quoted 8 lines
Thanks,
Quoted 5 lines
Quoted 3 lines
Thanks,
.
Quoted 18 lines · Jaegeuk Kim
Quoted 17 lines · Chao Yu
Quoted 16 lines · Jaegeuk Kim
Quoted 14 lines · Chao Yu
Quoted 11 lines · Jaegeuk Kim
This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature.
-> attach
REQ_FUAto Hot Data writes-> attach
REQ_FUAto Hot|Warm Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes as well as
REQ_METAto Hot Data writesOut of curiosity, what scenario it is used for?
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
It's testing purpose to compare the bandwidths per different IO flags.
Thanks for the hint. :)
As nobarrier was set in Android, so
REQ_PREFLUSHwill not be considered in this sysfs interface?I don't see any diff on performance, so not interesting. :)
I doubt it may has diff on non-ufs/emmc device? just guess.
Thanks,
Quoted 11 lines
Quoted 9 lines
Thanks,
Quoted 5 lines
Quoted 3 lines
Thanks,
.
.
Jaegeuk Kim
maintainerQuoted 21 lines · Chao Yu
Quoted 20 lines · Jaegeuk Kim
Quoted 19 lines · Chao Yu
Quoted 17 lines · Jaegeuk Kim
Quoted 6 lines · Chao Yu
Quoted 5 lines · Jaegeuk Kim
This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature.
-> attach
REQ_FUAto Hot Data writesQuoted 8 lines
Quoted 6 lines
-> attach
REQ_FUAto Hot|Warm Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes as well as
REQ_METAto Hot Data writesOut of curiosity, what scenario it is used for?
It's testing purpose to compare the bandwidths per different IO flags.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Thanks for the hint. :)
As nobarrier was set in Android, so
REQ_PREFLUSHwill not be considered in this sysfs interface?I don't see any diff on performance, so not interesting. :)
I doubt it may has diff on non-ufs/emmc device? just guess.
I don't have any data on emmc, so maybe. Which case do we send REQ_PREFLUSH?
Quoted 14 lines
Thanks,
Quoted 11 lines
Quoted 9 lines
Thanks,
Quoted 5 lines
Quoted 3 lines
Thanks,
.
.
Quoted 24 lines · Jaegeuk Kim
Quoted 23 lines · Chao Yu
Quoted 22 lines · Jaegeuk Kim
Quoted 21 lines · Chao Yu
Quoted 9 lines · Jaegeuk Kim
Quoted 8 lines · Chao Yu
Quoted 7 lines · Jaegeuk Kim
This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature.
-> attach
REQ_FUAto Hot Data writes-> attach
REQ_FUAto Hot|Warm Data writesQuoted 8 lines
Quoted 6 lines
Quoted 4 lines
-> attach
REQ_FUAto Hot|Warm|Cold Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes as well as
REQ_METAto Hot Data writesOut of curiosity, what scenario it is used for?
It's testing purpose to compare the bandwidths per different IO flags.
Thanks for the hint. :)
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
As nobarrier was set in Android, so
REQ_PREFLUSHwill not be considered in this sysfs interface?I don't see any diff on performance, so not interesting. :)
I doubt it may has diff on non-ufs/emmc device? just guess.
I don't have any data on emmc, so maybe. Which case do we send
REQ_PREFLUSH?
fsync w/ barrier mount option.
Quoted 17 lines
Quoted 15 lines
Thanks,
Quoted 11 lines
Quoted 9 lines
Thanks,
Quoted 5 lines
Quoted 3 lines
Thanks,
.
.
.
Quoted 5 lines · Jaegeuk Kim
This patch introduces a way to attach REQ_META/FUA explicitly to all the data writes given temperature.
-> attach
REQ_FUAto Hot Data writes
Quoted 8 lines
-> attach
REQ_FUAto Hot|Warm Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes-> attach
REQ_FUAto Hot|Warm|Cold Data writes as well as
REQ_METAto Hot Data writesSigned-off-by Jaegeuk Kim <[email protected]>
Thanks,