Scope applications into transient services
Closed, ResolvedPublic

Description

Effectively this requires a KIO change from calling QProcess(someExec)
to calling systemd-run someExec (or the equivalent DBus call)

Reasons:

  • everything will work at a cgroup level instead of PIDs which is more useful for a user
    • will allow better grouping in our taskmanager
    • resource limits and quotas on a per-app basis
    • will allow freezer controllers for the phone
  • allows us to use all sorts of other features (private /tmp, read only home etc)
  • We use a synchronised launch env
  • systemd will ship 3 slices, background services, apps, and "chrome" (i.e plasmashell) this will allow "nice" settings to be prioritised to apps by default
  • allows for a cleaner shutdown of 3rd party background services

Gnome libs are now also doing this.

During a FOSDEM meeting we agreed on a pseudo standard for which slices and a cgroup naming scheme. That scheme being:

I have a patch ready.

(obviously opt in)

bshah added a subscriber: bshah.Feb 11 2020, 11:56 AM

It would be really nice to have this for application life-cycle management in mobile. In general, Currently, all applications that are started are in foreground, and are never suspended.

To categorize, there are three types of user process in Plasma session.

  • User applications (dialer, phonebook, games, calender)
  • Services (telepathy mission-control, powerdevil, kded5)
  • Chrome (plasmashell, kwin_wayland)

For user applications

  • User starts multiple applications
  • Maximum 1-3 applications are allowed to stay in foreground
  • Other applications are suspended/frozen
  • Depending on application switching, we suspend/resume the applications.

For services

Depending on the service, we can decide to,

  • Lazy load it when needed using e.g. dbus activation
  • Load it at start-up but with limited resources available to it to avoid them taking available resources during start-up or system resume.

Chrome processes

Chrome services needs to be running only if the device is under active usage. We want to suspend the chrome processes during device sleep, or periodic wake-up to check push notifications or poll online sources.

In general if application/services are scoped in transient services/units, it would make it easier to implement system like this.

This could potentially be very useful for laptops as well - I don't think automatic suspending of apps would be wanted there but lazy loading of services and manual suspending of apps could make it easier to save power.
What I would have in mind for manual suspend of apps would be a suspend button in the window decorations which would suspend the app and hide the window. Once it's un-minimized by the user then we'd wake the app up automatically.

Additionally we could prioritize the currently focused app more to increase responsiveness on the desktop in general. A energy saving mode could also prioritize minimized apps less to increase battery life without sacrificing the actual performance a user will see and without potentially interrupting a programs wanted work like with suspend (for example: a download that the user wants to keep running but without using the app in the foregground).

davidedmundson closed this task as Resolved.Mar 26 2020, 1:20 PM