@@ -123,9 +123,11 @@ void find_children(PROC_MAP& pm) {
123123 }
124124}
125125
126- // get resource usage of non-BOINC apps
126+ // get resource usage of non-BOINC apps running above background priority.
127127// NOTE: this is flawed because it doesn't account for short-lived processes.
128- // It's not used on Win, Mac, or Linux, which have better ways of getting total CPU usage.
128+ // It's not used on Win, Mac, or Linux,
129+ // which have ways of getting total CPU usage.
130+ // See client/app.cpp
129131//
130132void procinfo_non_boinc (PROCINFO & procinfo, PROC_MAP & pm) {
131133 procinfo.clear ();
@@ -162,8 +164,20 @@ void procinfo_non_boinc(PROCINFO& procinfo, PROC_MAP& pm) {
162164#endif
163165}
164166
165- // get CPU time of BOINC-related processes, low-priority processes,
166- // and (if we're using Vbox) the Vbox daemon.
167+ // get CPU time of things we don't want to count as non-BOINC-related
168+ // - BOINC apps
169+ // - low-priority processes
170+ // - (if Vbox apps are running) the Vbox daemon
171+ // - Windows: WSL daemon ('vmmem')
172+ // - Linux/Mac:
173+ // we don't account Docker/podman CPU time here,
174+ // since we don't know what the processes are.
175+ // Instead we do it in the client (by looking at ACTIVE_TASKS)
176+ //
177+ // processes named 'podman'
178+ //
179+ // This is subtracted from total CPU time to get
180+ // the 'non-BOINC CPU time' used in computing preferences
167181//
168182double boinc_related_cpu_time (PROC_MAP & pm, bool vbox_app_running) {
169183 double sum = 0 ;
@@ -180,8 +194,11 @@ double boinc_related_cpu_time(PROC_MAP& pm, bool vbox_app_running) {
180194 // if a VBox app is running,
181195 // count VBox processes as BOINC-related
182196 // e.g. VBoxHeadless.exe and VBoxSVC.exe on Win
197+ #ifdef _WIN32
198+ || strstr (p.command , " vmmem" )
199+ #endif
183200 ) {
184- sum += p.user_time ;
201+ sum += ( p.user_time + p. kernel_time ) ;
185202 }
186203 }
187204 return sum;
0 commit comments