Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1051736pxa; Fri, 28 Aug 2020 02:11:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkN6iUkqwaB32Y7ZWoAtakFD3qqnwwsz+cBa9FxO47DmLHMfnXNdOAkcpU8E5byDRLTML9 X-Received: by 2002:a05:6402:342:: with SMTP id r2mr852669edw.353.1598605900520; Fri, 28 Aug 2020 02:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598605900; cv=none; d=google.com; s=arc-20160816; b=VFc3jmkzsbDDOhFRF/CP1wQzs+ngtJRuGr3Q6GPwc3+4z+pPQLjM7Rlrd2TASRG7wl O3BLGdsLpjZuZQxs+HIEABHXkl6XfveFNqGBPfhUOAQvmTjAOLEAumqK/rITwo7npgE9 WVnD1MgIB/gUZ7NMzM5c7RE0EcJgSG3SdvF0ArPlbuiks7oWIHl59rYdaWfaSdTcHt5j 2DyHOfz9/2fmqHWYaxGkx/840z76LhwyTSrWMewRjwD1bt3jgAlMPQvOK48kcnjRExeI 0U6zld/Ar987zieiG76bgvhpKlB8pItTS0m7NWZDQ/fVYKzj7eUK4KDdp7XuEiZ5fkB7 krfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=OCLR/ZgRgIDU1Za+nMPcFKSe6wyAHENv7Vfjt1vEDMw=; b=VWATsHIx877Opz5DZ/WEqjbfN2BLg2WElmCzRDCOaMuOEAxB8M7fXfkJNAusbFc+cw JcMJVtYcBQCidD5zV/wTvBtDdOy1TSz9zQhuLq1K3dnWnyHLkvYArfa2no2MRulDWZoe YV6NTQPIKCii66crL4lOdkZ/26hntQp/Z/MCTzsr1xIbK5w1jCRGhKPjXwVHwvT0gEOU jJO18/+dsks9DA+rnnc49ftUlC1UGTRTMtt1D2knWvwF1W6qASBlSd4MNYoAbKS5X21F JtnjluoC1BHkO65GWL8I7fm5nQjSopPILimskvrwQpS/iJAdnuFbQ+XGUkwfS1Awl4Mr fezg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=RhkXHhTg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si239121eja.330.2020.08.28.02.11.18; Fri, 28 Aug 2020 02:11:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=RhkXHhTg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728680AbgH1JH7 (ORCPT + 99 others); Fri, 28 Aug 2020 05:07:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728016AbgH1JH7 (ORCPT ); Fri, 28 Aug 2020 05:07:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54EB9C061264; Fri, 28 Aug 2020 02:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=OCLR/ZgRgIDU1Za+nMPcFKSe6wyAHENv7Vfjt1vEDMw=; b=RhkXHhTgpEKihLf7pqcWWdluts Z6WqG43HsDDIIzVJQBmDVRhvwC9UzJbGS+n2FCoaAjVhrQXv9f95QvnYGU1tBZ9TX7BdAQ7vePARc dhQ7Rgb8OpHOd9t/7fFiMdhW1ZPQjhEU5Nebu6KdyNy3QmXMF3kgrcmh3Yr9cckw4c1Zici2EnC95 cBeyQriv90eHJ1CKJWTLdbEGPtkFzX2ws3+pgciKBNNbLO3jo63pp6bV4TBh0XpPvKbY0EzRtUVlh 3jXYFUkHISKa6/UPhSBTDe1zXYkhIv7HexpNfz3jx9n3SyhV3xNIRF6B0b8aH81j/mQWkN5JtOGAD 2j0LspSw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBaM6-0006F1-6X; Fri, 28 Aug 2020 09:07:31 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 655113003E5; Fri, 28 Aug 2020 11:07:29 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 44CAB2C56E664; Fri, 28 Aug 2020 11:07:29 +0200 (CEST) Date: Fri, 28 Aug 2020 11:07:29 +0200 From: peterz@infradead.org To: Xianting Tian Cc: , , , , , , , , , , , , Subject: Re: [PATCH] aio: make aio wait path to account iowait time Message-ID: <20200828090729.GT1362448@hirez.programming.kicks-ass.net> References: <20200828060712.34983-1-tian.xianting@h3c.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200828060712.34983-1-tian.xianting@h3c.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2020 at 02:07:12PM +0800, Xianting Tian wrote: > As the normal aio wait path(read_events() -> > wait_event_interruptible_hrtimeout()) doesn't account iowait time, so use > this patch to make it to account iowait time, which can truely reflect > the system io situation when using a tool like 'top'. Do be aware though that io_schedule() is potentially far more expensive than regular schedule() and io-wait accounting as a whole is a trainwreck. When in_iowait is set schedule() and ttwu() will have to do additional atomic ops, and (much) worse, PSI will take additional locks. And all that for a number that, IMO, is mostly useless, see the comment with nr_iowait(). But, if you don't care about performance, and want to see a shiny random number generator, by all means, use io_schedule().