Skip to contentSkip to conversation

mkfs.f2fs: set .so to cold files

PATCH In review Jaegeuk Kim 3 participants 3 messages Nov 3, 2017 – Feb 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.f2fs: set .so to cold files

This patch adds .so in cold file extention list.

---
 mkfs/f2fs_format.c | 1 +
 1 file changed, 1 insertion(+)
mkfs/f2fs_format.c +1 -0
index 2103f9d..2ba8dd3 100644
@@ -62,6 +62,7 @@ const char *media_ext_lists[] = {
 	"jpeg",
 	"video",
 	"apk",	/* for android system */
+	"so",	/* for android system */
 	NULL
 };
 
Signature · 6 lines
2.14.0.rc1.383.gd1ce394fe2-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
#1 lore raw

I'm not entirely familiar with how cold and hot files are treated in f2fs, but I'm going to assume it has to do something with GC and less-prioritizing for random R/W operations.

If my assumption is correct, I see some things problematic here.

Android still does a lot of random reads inside .apk files. While the Java bytecodes are compiled and stored separately in /data/app/*/base.odex and base.vdex,
resources(graphics, assets, etc) are still directly accessed from the .apk files(which btw, I really want Google to change to access via Linux filesystem directly).

And .so extensions are not Android specific. Those are shared libraries and desktop distros also use them.
A simple find /usr /lib* -name '*.so' | wc -l run on my Ubuntu setup returns 7382 files. While most Android's /system partition is formatted as ext4, I'm not sure if you still want to do that for the rest of the user app's libraries(stored in /data/app/*/lib).

Are these really intended?
I'd appreciate if someone explain how cold and hot files are treated differently.

And also, I don't understand why one would want this hardcoded to the block device at the time of mkfs.
Wouldn't it make much more sense to ship new lists on each Linux merge windows and allow users to customize on runtime via sysfs?

Quoted 23 lines · Jaegeuk Kim

This patch adds .so in cold file extention list.

---
 mkfs/f2fs_format.c | 1 +
 1 file changed, 1 insertion(+)
mkfs/f2fs_format.c +1 -1
index 2103f9d..2ba8dd3 100644
@@ -62,6 +62,7 @@ const char *media_ext_lists[] = {
        "jpeg",
        "video",
        "apk",  /* for android system */
+       "so",   /* for android system */
        NULL
 };
 
--

2.14.0.rc1.383.gd1ce394fe2-goog

Quoted 7 lines

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot

#2 lore raw
Quoted 13 lines · Ju Hyung Park

I'm not entirely familiar with how cold and hot files are treated in f2fs, but I'm going to assume it has to do something with GC and less-prioritizing for random R/W operations.

If my assumption is correct, I see some things problematic here.

Android still does a lot of random reads inside .apk files. While the Java bytecodes are compiled and stored separately in /data/app/*/base.odex and base.vdex,
resources(graphics, assets, etc) are still directly accessed from the .apk files(which btw, I really want Google to change to access via Linux filesystem directly).

Quoted 8 lines

And .so extensions are not Android specific. Those are shared libraries and desktop distros also use them.
A simple find /usr /lib* -name '*.so' | wc -l run on my Ubuntu setup returns 7382 files. While most Android's /system partition is formatted as ext4, I'm not sure if you still want to do that for the rest of the user app's libraries(stored in /data/app/*/lib).

Are these really intended?

Yup.

Quoted 2 lines

I'd appreciate if someone explain how cold and hot files are treated differently.

f2fs makes all cold files going into cold type data segments, normally, predefined cold file won't change in its life time anymore, so we can expect that there will be less GC triggered on those cold type segment than segment contains both hot and cold data.

Quoted 5 lines

And also, I don't understand why one would want this hardcoded to the block device at the time of mkfs.
Wouldn't it make much more sense to ship new lists on each Linux merge windows and allow users to customize on runtime via sysfs?

Agreed. If new cold type file was discovered, we should not let user configure the extension list by mkfs which may make all data lost.

Thanks,

Quoted 25 lines · Jaegeuk Kim
Quoted 23 lines

This patch adds .so in cold file extention list.

---
 mkfs/f2fs_format.c | 1 +
 1 file changed, 1 insertion(+)
mkfs/f2fs_format.c +1 -1
index 2103f9d..2ba8dd3 100644
@@ -62,6 +62,7 @@ const char *media_ext_lists[] = {
        "jpeg",
        "video",
        "apk",  /* for android system */
+       "so",   /* for android system */
        NULL
 };
 
--

2.14.0.rc1.383.gd1ce394fe2-goog

Quoted 16 lines
Quoted 7 lines

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot