Thread (16 messages) 16 messages, 2 authors, 2018-08-22

Re: [PATCH 8/9] psi: pressure stall information for CPU, memory, and IO

From: Peter Zijlstra <peterz@infradead.org>
Date: 2018-08-06 16:03:43
Also in: linux-mm, lkml

Possibly related (same subject, not in this thread)

On Mon, Aug 06, 2018 at 11:19:28AM -0400, Johannes Weiner wrote:
On Fri, Aug 03, 2018 at 06:56:41PM +0200, Peter Zijlstra wrote:
quoted
On Wed, Aug 01, 2018 at 11:19:57AM -0400, Johannes Weiner wrote:
quoted
quoted
+		u32 uninitialized_var(nonidle);
urgh.. I can see why the compiler got confused. Dodgy :-)
:-) I think we can make this cleaner. Something like this (modulo the
READ_ONCE/WRITE_ONCE you pointed out in the other email)?
quoted hunk ↗ jump to hunk
@@ -244,60 +287,17 @@ static bool psi_update_stats(struct psi_group *group)
 	 */
 	for_each_online_cpu(cpu) {
 		struct psi_group_cpu *groupc = per_cpu_ptr(group->pcpu, cpu);
+		u32 nonidle;
+
+		nonidle = read_update_delta(groupc, PSI_NONIDLE, cpu);
+		nonidle = nsecs_to_jiffies(nonidle);
+		nonidle_total += nonidle;
+
+		for (s = 0; s < PSI_NONIDLE; s++) {
+			u32 delta;
+
+			delta = read_update_delta(groupc, s, cpu);
+			deltas[s] += (u64)delta * nonidle;
 		}
 	}
Yes, much clearer, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help