From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755412AbcFGMBh (ORCPT ); Tue, 7 Jun 2016 08:01:37 -0400 Received: from merlin.infradead.org ([205.233.59.134]:56330 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753063AbcFGMBe (ORCPT ); Tue, 7 Jun 2016 08:01:34 -0400 Date: Tue, 7 Jun 2016 14:01:25 +0200 From: Peter Zijlstra To: Cao jin Cc: linux-kernel@vger.kernel.org, =?utf-8?B?SXp1bWksIFRha3Uv5rOJIOaLkw==?= Subject: Re: about definition of iowait Message-ID: <20160607120125.GH30154@twins.programming.kicks-ass.net> References: <5756AEFE.60300@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5756AEFE.60300@cn.fujitsu.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 07, 2016 at 07:24:46PM +0800, Cao jin wrote: > Hi, > > I noticed some problems about iowait entry of /proc/stat: it seems not > accurate, and sometimes will decrease in SMP. > > For UP, we have a simple definition about iowait, which is: > The time that the processor is idle, during which there is a task waiting > for I/O. > > This definition seems don't fit well when step into SMP era, so I think > maybe it can be extended like: > For a given CPU, the I/O wait time is the time during which that CPU was > idle, and there is at least one outstanding disk I/O operation requested by > a task scheduled on that CPU. > > But tasks can migrate among cpus, so this definition maybe not accurate. > > I also saw some suggestions that it should be a global value, not per cpu, > but don`t see clear definition, so anyone have suggestions about it? > (personally guessing, maybe: there is task waiting for outstanding I/O while > all cpus are idle? But I don't think it is good...) It is possible to come up with definition for a single global number; per-cpu iowait numbers are doomed. But I don't see it matters one way or the other. Personally I would just make the kernel return 0 and be done with it.