Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fstrim service and fstrim timer by default #2804

Merged
merged 1 commit into from
Apr 21, 2019

Conversation

zhenggen-xu
Copy link
Collaborator

Add fstrim service and fstrim timer by default

This service (weekly) will let SSD firmware to do the garbage collection
after file-system deleted files. It could avoid slowness or
even READ-ONLY error due to SSD not being able to free the pages
even though the file system thinks there was a lot of space left.

Signed-off-by: Zhenggen Xu zxu@linkedin.com

- What I did
Add fstrim service and fstrim timer by default

- How I did it
Enable the service and timer for all platforms during the building process.

- How to verify it
After build image and load image:

sudo service fstrim status
● fstrim.service - Discard unused blocks
Loaded: loaded (/etc/systemd/system/fstrim.service; static)
Active: inactive (dead) since Tue 2019-03-26 05:25:29 UTC; 9min ago
Process: 22259 ExecStart=/sbin/fstrim -av (code=exited, status=0/SUCCESS)
Main PID: 22259 (code=exited, status=0/SUCCESS)

Mar 26 05:25:29 sonic fstrim[22259]: /var/log: 3.8 GiB (4072431616 bytes) trimmed
Mar 26 05:25:29 sonic systemd[1]: Started Discard unused blocks.

admin@sonic:~$ sudo systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
Wed 2019-03-27 05:30:29 UTC 23h left Tue 2019-03-26 05:30:29 UTC 4min 57s ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2019-04-01 00:00:00 UTC 5 days left Tue 2019-03-26 05:25:29 UTC 9min ago fstrim.timer fstrim.service

2 timers listed.
Pass --all to see loaded but inactive timers, too.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

This service (weekly) will let SSD firmware to do the garbage collection
after file-system deleted files. It could avoid slowness or
even READ-ONLY error due to SSD not being able to free the pages
even though the file system thinks there was a lot of space left.

Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
@jleveque jleveque requested a review from lguohan April 18, 2019 23:17
@lguohan lguohan merged commit 75964ef into sonic-net:master Apr 21, 2019
MichelMoriniaux pushed a commit to criteo-forks/sonic-buildimage that referenced this pull request May 28, 2019
…t#2804)

This service (weekly) will let SSD firmware to do the garbage collection
after file-system deleted files. It could avoid slowness or
even READ-ONLY error due to SSD not being able to free the pages
even though the file system thinks there was a lot of space left.

Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
@zhenggen-xu zhenggen-xu deleted the fstrim branch June 7, 2019 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants