From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69130C433EF for ; Tue, 7 Sep 2021 13:24:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1D898610E9 for ; Tue, 7 Sep 2021 13:24:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1D898610E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9A826900002; Tue, 7 Sep 2021 09:24:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94D536B0072; Tue, 7 Sep 2021 09:24:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E35D900002; Tue, 7 Sep 2021 09:24:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0128.hostedemail.com [216.40.44.128]) by kanga.kvack.org (Postfix) with ESMTP id 1CB026B0071 for ; Tue, 7 Sep 2021 09:24:33 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 373232C591 for ; Tue, 7 Sep 2021 13:24:31 +0000 (UTC) X-FDA: 78560846742.22.1B2EE08 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by imf09.hostedemail.com (Postfix) with ESMTP id C90613000100 for ; Tue, 7 Sep 2021 13:24:30 +0000 (UTC) Received: by mail-qk1-f178.google.com with SMTP id a10so10008595qka.12 for ; Tue, 07 Sep 2021 06:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=snKy/WADFwokRT+osDI9do+M8g2hziIwUcmQdPSAFyc=; b=XVv+i9saQ7NVKMuYyZaNVEK0Ukra4Ijtg+Rq16/2Nf2hK+/GvERQEMSlkMsxuhWYxn z2Gk06jl5PM8QlSxfPBwRwgdVHD6eWzZXZvkdkEvbK0gohnUs1MBcwGzoEMgapDK6mfa aZUKvI7nwU5GOkpQVyoaeNiWrtqw98qQUsNqA5uBx2JtJnxcj/OemDNrHKxIHgael230 p07XbUPC8IMw6lmmdmmFaHHVdYnDjUYaNnSC7Rzla5hfYdJBi+2v23Hud66U/TsdR7pE AJkh6gspQ9Uk6+lbY/Cjh4VhHrydNNGmTYyu1TpmUeid3noetauKF18nvM4y2jHrJvmB +4ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=snKy/WADFwokRT+osDI9do+M8g2hziIwUcmQdPSAFyc=; b=LbdpN5X16IrM01SGI7oOAsMciA0Iq5uZmR+AR2Xg5r5vnKp67+Ep0qqnz7r//5WqXm TwQTxvsQCvo6bpaMSbwYXdJBtEAsP4I/J3fEBoP/l9yDcieFGFg3JyhvMbgdsY+4lf8M 9JbsoI2Kud+vPfQhVCmrwN5x7UV7vdiclZ2nwTfwH9JlxyUYTdiELMeCdqq9jVS49ALX zYe8qMKLcwQeSilfhxPeNK9I6S5Onuqo6+VR88lfx6DVLlP+klNOxq/2KSUiQDGDdL/p a1Lt29XFl8J//ub2K2QN3aORyKBMqyTOLWmPKf+cKIorr4fyFPMl5abIQg+7iOJtgKY0 bppA== X-Gm-Message-State: AOAM531u63Nm7kJXHnoctFsSG3xefYR4K8Hx7o+npGq60/LZfL7esPXK J2EKP3k0CWbCfUUFVzOGbqntZA== X-Google-Smtp-Source: ABdhPJwl+xY/vbUI8SwIRZRn7WY9w2nTQTOJynm9CWgFNldLL4FjH0eNw8V7Ge1ULuU8Jb6JQX7MJw== X-Received: by 2002:a05:620a:444b:: with SMTP id w11mr15732760qkp.479.1631021070123; Tue, 07 Sep 2021 06:24:30 -0700 (PDT) Received: from localhost (cpe-98-15-154-102.hvc.res.rr.com. [98.15.154.102]) by smtp.gmail.com with ESMTPSA id b15sm8581895qka.107.2021.09.07.06.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 06:24:28 -0700 (PDT) Date: Tue, 7 Sep 2021 09:26:18 -0400 From: Johannes Weiner To: Zhaoyang Huang Cc: Vlastimil Babka , Andrew Morton , Minchan Kim , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Subject: Re: [PATCH] mm : bail out from psi memstall after submit_bio in swap_readpage Message-ID: References: <1631015968-9779-1-git-send-email-huangzhaoyang@gmail.com> <79c08d1d-eef5-bc15-8186-7e3367b4ebe7@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=XVv+i9sa; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf09.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.178 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: C90613000100 X-Stat-Signature: c584gedxmrnqui6gof6kj8hq37364yty X-HE-Tag: 1631021070-363581 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Sep 07, 2021 at 08:15:30PM +0800, Zhaoyang Huang wrote: > On Tue, Sep 7, 2021 at 8:03 PM Vlastimil Babka wrote: > > > > On 9/7/21 13:59, Huangzhaoyang wrote: > > > From: Zhaoyang Huang > > > > > > It doesn't make sense to count IO time into psi memstall. Bail out after > > > bio submitted. > > > > Isn't that the point if psi, to observe real stalls, which include IO? Yes, correct. > IO stalls could be observed within blk_io_schedule. The time cost of > the data from block device to RAM is counted here. Yes, that is on purpose. The time a thread waits for swap read IO is time in which the thread is not productive due to a lack of memory. For async-submitted IO, this happens in lock_page() called from do_swap_page(). If the submitting thread directly waits after the submit_bio(), then that should be accounted too. This patch doesn't make sense to me.