From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751876AbcF0GAY (ORCPT ); Mon, 27 Jun 2016 02:00:24 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:21291 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751248AbcF0GAX (ORCPT ); Mon, 27 Jun 2016 02:00:23 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="8088634" Subject: Re: about definition of iowait To: Peter Zijlstra References: <5756AEFE.60300@cn.fujitsu.com> <20160607120125.GH30154@twins.programming.kicks-ass.net> CC: , =?UTF-8?B?SXp1bWksIFRha3Uv5rOJIOaLkw==?= From: Cao jin Message-ID: <5770C265.1000109@cn.fujitsu.com> Date: Mon, 27 Jun 2016 14:06:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20160607120125.GH30154@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.69] X-yoursite-MailScanner-ID: E41C741C0BAB.A84AC X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: caoj.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter Sorry to bother you on this topic again. On 06/07/2016 08:01 PM, Peter Zijlstra wrote: > 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. > So I just want to make sure, is it acceptable if I send a patch make iowait a constant 0? Because make it zero seems we are abandoning it(0 doesn'`t have any meanings for it). While maybe some user space tools monitors this value. -- Yours Sincerely, Cao jin