linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [rfc] Binding files to data-only memory cgroups
@ 2015-08-28 14:25 Konstantin Khlebnikov
  0 siblings, 0 replies; only message in thread
From: Konstantin Khlebnikov @ 2015-08-28 14:25 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Cgroups

Seems like subj could provide a very flexible approach for managing
memory in complicated scenarios. Depending on memory limits it could
work as mlock (with lock-on-fault semantics). Binding files to cgroup
with small memory limit gives long-awaited FADV_NOREUSE semantics.
Even without limits this gives valuable information about memory usage
by page-cache for particular set of files.

For example, our database keeps data in several files with completely
different access patterns: some of them should be cached and locked in
memory (but not completely), some shouldn't be cached because cache-hit
is almost impossible and so on. fadvise and mlock provides some
tuning but they are very limited.

Interface could be done as a single fadvise(fd, FADV_WILLOWN) which
binds inode to current memory cgroup (fails if already binded) and
migrates all present cache. All further allocations in this inode
will be charged to that cgroup. In userspace this will be used by
tiny tool which lives in target cgroup and holds all binded files,
so state will be persistent but without keeping anything in fs.

So, what do you think?
Is there any plans to alter always-charge-to-current logic?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-28 14:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-28 14:25 [rfc] Binding files to data-only memory cgroups Konstantin Khlebnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox