Combine disk cleanup routine and Low disk space warning checks to save resources |
|||||||||||||
Issue description--- split from issue 673859 --- We currently have two tasks with different clock cycles that check for the same thing and trigger different actions 1. We check for disk space below 512MB to show a warning every 1 MINUTE 2. We check for disk space below 512MB* to start disk cleanup every 1 HOUR Instead, we should have a single check every minute which would trigger the right actions. (*) the 512MB number is going to change to 1GB in M58
,
Mar 14 2017
Why doesn't disk clean up happen only on an as-needed basis?
,
Mar 14 2017
We check the space periodically because monitoring all changes on the file system has performance overhead.
,
Mar 15 2017
In addition to the performance overhead, an app could check for disk space available and decide that there isn't enough with it's own internal parameter without us actually being able to detect that as no file system actions are taken.
,
Aug 8 2017
,
Dec 12 2017
Here are my 2 cents, related to another issue. https://bugs.chromium.org/p/chromium/issues/detail?id=701293#c11
,
Mar 7 2018
Agreed that disk clean up should happen only on an as-needed basis. (Think of: on-demand garbage collection) omrilio@ or fukino@ - ping? Any decisions/updates?
,
Mar 15 2018
,
Mar 28 2018
,
Apr 5 2018
,
Apr 12 2018
,
Apr 18 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/7e8c637f03bb08c7ee187f643b26a17e9a5dddd8 commit 7e8c637f03bb08c7ee187f643b26a17e9a5dddd8 Author: Alexey Baskakov <loyso@chromium.org> Date: Wed Apr 18 09:08:06 2018 cryptohome: Combine disk cleanup routine and Low disk space warning checks Previously, Cryptohome checked AmountOfFreeDiskSpace to show a LowDiskSpace warning every 1 minute. Independently, the disk cleanup routine was called on a hourly basis. As a result, a user was spammed with low disk space notifications for up to 1 hour without any cleanup actions from the OS. This CL combines those two callbacks. We trigger heavy cleanups on minutely basis, if needed. We shouldn't repeat cleanups on every minute if the disk space stays below the threshold. We request an ahead-of-schedule cleanup, basically. Related change: UpdateCurrentUserActivityTimestamp must be called every 24 hours. But the code used a static counter variable. Now it is an explicit function with a dedicated timestamp. BUG= chromium:701290 TEST=Ran all the Cryptohome unit tests, logged callbacks on the dev chromebook. Change-Id: Idf681dc6be393dd124dc553cf834285562c15aa8 Reviewed-on: https://chromium-review.googlesource.com/1013884 Commit-Ready: Alexey Baskakov <loyso@chromium.org> Tested-by: Alexey Baskakov <loyso@chromium.org> Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org> [modify] https://crrev.com/7e8c637f03bb08c7ee187f643b26a17e9a5dddd8/cryptohome/service.h [modify] https://crrev.com/7e8c637f03bb08c7ee187f643b26a17e9a5dddd8/cryptohome/service.cc [modify] https://crrev.com/7e8c637f03bb08c7ee187f643b26a17e9a5dddd8/cryptohome/service_unittest.cc
,
Apr 19 2018
,
Apr 19 2018
,
Apr 20 2018
,
May 10 2018
How to reproduce: 1) Login as a test user (Alice) and fill its Browsing Data and/or Offline Files by browsing internet or browsing google drive content in FilesApp. The idea is to allocate some data which may be evicted. Make sure you have enough data allocated in Settings->Device->Storage management: say, X mb (X>100MB). Log out. 2) Login as a second user (Bob). Create a low disk space situation: fill up your primary drive until it goes slightly below 2GB threshold. A notification will pop up. 3) Previously, Bob had to wait for 0-60 minutes to get Alice's cache erased. With this fix, Alice's cache becomes deleted right after "low disk space notification". Check free disk space. It should be higher than 2GB threshold (old disk space + X mb, X megabytes freed) 4) Login as Alice. Check that your cache was deleted in Storage Manager.
,
May 10 2018
As verified in M68.0.3425.0 10663.0.0 dev paine, "Device is low on space" warning was seen when disk space availability is less than 1GB and some temporary data such as browsing data were deleted to make space available again.
,
May 11 2018
This is just my opinion, but wouldn't it be beneficial to suppress the "Device is low on space" message if the cleanup routine is successful in freeing up space? This would mitigate some confusion for the end user. If the cleanup routine is unable to make >2GB (or whatever threshold) available, THEN display the message?
,
May 12 2018
weifangsun@, ping? IMHO, 2GB is just a bare minimum to avoid bricking the device. A user should free more space manually (Downloads/ folder, mostly)
,
May 14 2018
I 100% agree. Unfortunately, a) A lot of users simply won't. b) In a multi-user environment like a school, it is typically not the logged in user who is using up all the space...it is the 90 other user profiles on the device over which the current user has no control or access to be able to fee up the needed space.
,
May 14 2018
A notification message is still useful as the basic cleanup routine frees up some space, but with the goal of just making sure the device is usable. - Users will always have the ability to manually free up additional space. - Per Comment #20, agreed that not all users will/have the ability to proactively clean up their disk space. We are currently exploring options to more intelligently handle these use cases.
,
Nov 16
Hi folks We have feedback from a school thats piloting Dru, - Space maxed out and the current user was being advised to uninstall some apps to create space, but later the device became unresponsive. Files were not auto-cleared and old profiles were not auto-deleted. In parallel I tried to reproduce this issue with my test device. I started it on v68, added 12 profiles with heavy files and got space filled down to 5mb, with multiple alerts to uninstall apps to create space (it didn't autodelete profiles) and it actually updated to 70 somehow. System diagnostics from both devices : https://drive.google.com/corp/drive/u/0/folders/130DwfLRfxedle3tQnO4Qf1_h0imJgpBU Need to check - Any issue with the the eviction logic on Dru - Root cause of behaviour on both devices Thanks !
,
Nov 16
,
Nov 18
This bug is marked as fixed - suggest you create a new one if you think there's ongoing/other issues to investigate.
,
Nov 19
Just tested -- logged in as 11 users; by the 11th, it gave me the attached message when it tried to install a 4th Android app. I couldn't copy the screenshot either, I assume from lack of space, so I had to resort to taking a photo of the screen. I had thought that the idea was to delete the oldest user on the device rather than simply displaying a message about space. |
|||||||||||||
►
Sign in to add a comment |
|||||||||||||
Comment 1 by omrilio@chromium.org
, Mar 14 2017