Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3664560pxb; Tue, 7 Sep 2021 05:04:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGolpJhT7NqTW69M8dfx8njhxmFVK27643o18Rhb+YVcZkp1Tp9ePu5YuP+op11Qq3iu3j X-Received: by 2002:a05:6638:1384:: with SMTP id w4mr12497773jad.21.1631016261674; Tue, 07 Sep 2021 05:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631016261; cv=none; d=google.com; s=arc-20160816; b=Udyg3MDcbpnmiD+3S8i6Nw/X+ljyCOeE/FRoJpO0TcyXFCiNaBK29YCQ2CloGIsci8 Z6XGqfwV2BkwmyfWen0Kn7zN6se/2/1bAePWkd3ddgF61JrwuyKUNAx0y56nXZJjLnYo LrI1+dVDmcHstVLw7LiRmY33GmDUtVc2kH8tGnLJ9lnvcDhLrWYoF0hPZDW72kBEDSkW vawEUZUvq3AkWmP2WX+IrwkGQyAQhwEamdDXj2wb/syV9T1siH++co9QDC3WMHxKrESf H8DveGIsNNNdscDVIxBf/uQUGaniRVwkPvnX9sn3ZcCmREttkO2xUIq794u6b667aRhH 726g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=j25+LpQod1QI80++OlSQRGUgFsrVKKSgFf0138c8TVQ=; b=BM7krbsIkfxUpW8UjjUnXLW82WEXZdk9dl8NbBbTvUx2jqRR2UIfOfoafmBw1oMAXU u0CcDrEvdEsvumb30uB4aiAQzQwmcYI6hNhvayKt16guB0hglxBYjjeqjKfP5uRe+8uD QszbhHv8I6A58TTDshtRpdVvxns3970nNLO6Nq/CmgEo4uV1CqX0Yi61KLso0ZZs3Z1Z 6a+HP5+8cCX5UKIVoh6aTzd1QFq2aYoMmHPdrx79i7tVZh42/Noeo4exPj5SPGn9Zvwi GSPIyfbBqp6q54CJdwE5volIqtO/sfrjCRwzt9Fp34KOcQg+UjukeuPooa5A/KjhMpoL 3o1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=L6bZSsu2; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="QdRf3J/O"; 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 1si9749751jaw.97.2021.09.07.05.04.10; Tue, 07 Sep 2021 05:04:21 -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=pass header.i=@suse.cz header.s=susede2_rsa header.b=L6bZSsu2; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b="QdRf3J/O"; 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 S242215AbhIGMEH (ORCPT + 99 others); Tue, 7 Sep 2021 08:04:07 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:42432 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233864AbhIGMEG (ORCPT ); Tue, 7 Sep 2021 08:04:06 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D210622119; Tue, 7 Sep 2021 12:02:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1631016179; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j25+LpQod1QI80++OlSQRGUgFsrVKKSgFf0138c8TVQ=; b=L6bZSsu2pNXyftKXlI+rdsHuDIyQPIGfBY09AwkHJ8dkrXqH5ssvKC99sB8OGrgfsnryqn OOZLx5m/Lhi/y5eH7r47QMsk0qZQecVl3jMSEQbZROIG1vv+I+h9qntEsTt/qGAe8xwLgP xnlCawBlaxGhjxtxSCHFqDGwOoeLPcQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1631016179; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j25+LpQod1QI80++OlSQRGUgFsrVKKSgFf0138c8TVQ=; b=QdRf3J/OBaiaXjxKdiy5D+6HSzM4dDlr59ppGPkwZ8KO1fqiFSJcbh+lBuPCt+Ciok5sGr V6mUxfeDYIxbPDDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B806013C56; Tue, 7 Sep 2021 12:02:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kcRTLPNUN2HdDAAAMHmgww (envelope-from ); Tue, 07 Sep 2021 12:02:59 +0000 Message-ID: <79c08d1d-eef5-bc15-8186-7e3367b4ebe7@suse.cz> Date: Tue, 7 Sep 2021 14:02:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.1 Subject: Re: [PATCH] mm : bail out from psi memstall after submit_bio in swap_readpage Content-Language: en-US To: Huangzhaoyang , Andrew Morton , Minchan Kim , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner References: <1631015968-9779-1-git-send-email-huangzhaoyang@gmail.com> From: Vlastimil Babka In-Reply-To: <1631015968-9779-1-git-send-email-huangzhaoyang@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Anyway, CCing Johannes. > Signed-off-by: Zhaoyang Huang > --- > mm/page_io.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/page_io.c b/mm/page_io.c > index c493ce9..1d131fc 100644 > --- a/mm/page_io.c > +++ b/mm/page_io.c > @@ -423,6 +423,7 @@ int swap_readpage(struct page *page, bool synchronous) > count_vm_event(PSWPIN); > bio_get(bio); > qc = submit_bio(bio); > + psi_memstall_leave(&pflags); > while (synchronous) { > set_current_state(TASK_UNINTERRUPTIBLE); > if (!READ_ONCE(bio->bi_private)) > @@ -433,7 +434,7 @@ int swap_readpage(struct page *page, bool synchronous) > } > __set_current_state(TASK_RUNNING); > bio_put(bio); > - > + return ret; > out: > psi_memstall_leave(&pflags); > return ret; >