]> git.eshelyaron.com Git - emacs.git/commitdiff
%CPU can exceed 100 on GNU/Linux
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Mar 2022 03:21:38 +0000 (19:21 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Mar 2022 03:29:05 +0000 (19:29 -0800)
* src/sysdep.c (system_process_attributes) [GNU_LINUX]:
CPU usage can exceed 100% on a multicore platform when Emacs is
not entirely single-threaded.

doc/lispref/processes.texi
src/sysdep.c

index d338d59a814aa5904d9b1f5e7fabfbc3822ec322..ed07c1cbf7035ea38a6cb4a33c7a12c4d8771e87 100644 (file)
@@ -2382,8 +2382,9 @@ occupied by the process in the machine's physical memory.
 
 @item pcpu
 The percentage of the CPU time used by the process since it started.
-The corresponding @var{value} is a floating-point number between 0 and
-100.
+The corresponding @var{value} is a nonnegative floating-point number.
+Although in theory the number can exceed 100 on a multicore platform,
+it is usually less than 100 because Emacs is typically single-threaded.
 
 @item pmem
 The percentage of the total physical memory installed on the machine
index 28d32c77c63b9fb79baf57b7835cd457ed880df8..c9101f94818fbaa41d8e2c28d27f59eaf41d2fd0 100644 (file)
@@ -3487,8 +3487,6 @@ system_process_attributes (Lisp_Object pid)
          attrs = Fcons (Fcons (Qetime, make_lisp_time (telapsed)), attrs);
          us_time = time_from_jiffies (u_time + s_time, clocks_per_sec);
          pcpu = timespectod (us_time) / timespectod (telapsed);
-         if (pcpu > 1.0)
-           pcpu = 1.0;
          attrs = Fcons (Fcons (Qpcpu, make_float (100 * pcpu)), attrs);
          pmem = 4.0 * 100 * rss / procfs_get_total_memory ();
          if (pmem > 100)