Cryptohome: Use Ext4 quota features and gids to manage disk space |
||||
Issue descriptionCurrently for android root/android-data/data/data/*/cache are marked with const char kAndroidCacheInodeAttribute[] = "user.inode_cache"; to mark them as deletable. Android switched to using Ext4 Quota and "gid" to mark cache directories, which is less expensive to read (and track through quota): In the new scheme of things since Android O, caches are marked with cache gids which are cheaper to scan than xattrs (because of where they are stored). Action plan for Cryptohome would be something like: - migrate to use ext4 quota to track storage usage per cache type. - migrate existing files and codebase to use gid (or project?) instead of xattr to track cache type to take advantage of ext4 quota features. - remove the xattr scanning code path from cache management as a final cleanup step.
,
Apr 17 2018
Note: We might need to backport any kernel patches for Ext4 quota.
,
Apr 18 2018
,
Apr 18 2018
IIUC, what needs to be done to decide whether or not to use kernel quota in cryptohome cache in general is: 1. make sure that GID currently doesn't have special meaning in Cryptohome yet (which I think is confirmed by uekawa@ in the meeting). 2. check with chromeos-security if they are ok with it. Is there anything else that might be a game changer here?
,
Apr 18 2018
- I think the gid for chrome OS cache files should be different from Android cache files to make sure we are not adding extra permissions. - new gid should be assigned for this new purpose, like chronos-access was defined here: src/third_party/eclass-overlay/profiles/base/accounts/group/chronos-access
,
Apr 19 2018
As per discussion, loyso@ and risan@ are working on a design.
,
Apr 20 2018
Btw, looking at the title, does this bug cover disk space management in Cryptohome in general or is it just about cache? Regarding cache, what I can see: 1. Android: the only location where cryptohome care about Android cache is within HomeDirs::FreeSpace code - and it seems that it will immediately remove some Android cache directory contents without checking their size, so it doesn't seem that we care whether or not quota is enabled for Android and we only need to change xattr attribute check to gid check during traversal in HomeDirs::DeleteAndroidCacheCallback. 2. Rest of Cryptohome: quota is potentially useful in this kind of calculation: https://cs.chromium.org/chromium/src/components/drive/chromeos/file_cache.cc?gsn=GetCacheFilePath&l=301 if they are bottleneck. Is there other place where Cryptohome needs to know the cache size? oh and noob question: where are cache stored in ChromeOS?
,
Apr 23 2018
> does this bug cover disk space management in Cryptohome in general or is it just about cache? It meant to be pretty general. > we only need to change xattr attribute check to gid check during traversal in HomeDirs::DeleteAndroidCacheCallback. yup, this would be an ARC++ task. > where are cache stored in ChromeOS? Short answer: it's complicated. Files App has its own thumbnails cache, for instance. The disk space management task presumes a creation of unified cache management across ChromeOS.
,
Apr 23 2018
This bug is rather a reminder that there is an Ext4 quota feature and we should use it in ChromeOS (somehow). To be designed.
,
Jul 9
|
||||
►
Sign in to add a comment |
||||
Comment 1 by loyso@google.com
, Apr 17 2018