Cache management under low memory

41 views
Skip to first unread message

Justin Mattson

unread,
Feb 2, 2022, 12:53:34 PM2/2/22
to stora...@fuchsia.dev
When the kernel has signaled a low memory state, how is this managed for filesystems? For example, are in-memory caches trimmed and is the total count of pages of pageable memory clamped at some level until the kernel signals memory conditions have improved?

Thanks,
Justin

Chris Suter

unread,
Feb 2, 2022, 5:28:44 PM2/2/22
to Justin Mattson, stora...@fuchsia.dev
Except for the fact that loaded blobs for Blobfs are discardable memory (which is managed by the kernel), I don't think we do anything at the moment. When we land write-back support for mutable filesystems, that'll help (since that memory can be marked discardable too), but that's some way off. It might be a while before we start looking at doing something for metadata caches.

— Chris

--
All posts must follow the Fuchsia Code of Conduct https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
---
You received this message because you are subscribed to the Google Groups "storage-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to storage-dev...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/storage-dev/CA%2BX8dX9r1VDGiVLbttKL5f%3Dev_SLSR%3DuXQaHbXSvdVJBmx7kxQ%40mail.gmail.com.

Adam Barth

unread,
Feb 2, 2022, 10:30:34 PM2/2/22
to Chris Suter, Étienne J. Membrives, David Moore, Justin Mattson, stora...@fuchsia.dev
+Étienne J. Membrives +David Moore / Note: Public thread]

Looking at some memory profiles, I noticed zxcrypt-buffer is fairly large:


Looks like it's size is initialized to a constant:


I wonder if there's something more sophisticated we should do for sizing that buffer.  I guess I should file an issue:


Adam


Message has been deleted

Seokhwan Kim

unread,
Feb 22, 2022, 7:40:22 AM2/22/22
to storage-dev, Adam Barth, Justin Mattson, stora...@fuchsia.dev, Chris Suter, Étienne J. Membrives, David Moore
As a set of CLs for writeback has been merged, f2fs is able to adjust the number of committed pages in a writeback cache. Basically, f2fs uses discardable vmo to present a file block in memory, and it keeps vmo_lock for dirty vmos as well as ones in use. In order to limit the total amount of locked discardable pages, it writes out dirty vmos when the amount exceed a threshold.
If it is notified of the current memory state from kernel, I think we can add a CL to adjust the threshold and the number of locked committed pages according to the state. 

https://fuchsia-review.googlesource.com/c/fuchsia/+/626194

Best regards,
Seokhwan

2022년 2월 3일 목요일 오후 12시 30분 34초 UTC+9에 Adam Barth님이 작성:
Reply all
Reply to author
Forward
0 new messages