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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE981C433F5 for ; Thu, 2 Dec 2021 16:28:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EBF96B0073; Thu, 2 Dec 2021 11:28:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 272776B0074; Thu, 2 Dec 2021 11:28:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 113326B0075; Thu, 2 Dec 2021 11:28:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id 016806B0073 for ; Thu, 2 Dec 2021 11:28:38 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B8FDF89D2D for ; Thu, 2 Dec 2021 16:28:28 +0000 (UTC) X-FDA: 78873387096.09.99EE3EB Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by imf22.hostedemail.com (Postfix) with ESMTP id 446FC1902 for ; Thu, 2 Dec 2021 16:28:29 +0000 (UTC) Received: by mail-qv1-f52.google.com with SMTP id bu11so26592qvb.0 for ; Thu, 02 Dec 2021 08:28:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4u0nMlsipyu+XwIR6Y+VD6kLwYQ+DRyX7X93/2ae68g=; b=akVrJdkr8wzj7RT55iNYgflFIkgb3zeHg072iRJuFevQdx8fsyEVHDqLVZO/cahe6x ZsgBgn05Cql3xk3Ld2fTnymWQlClnzHCbGdBtNbPVUQ2SA+VLe4UpUF1YWg7msNM367P RJCDjHe+LcM7Mn+DwTSu2DX55GrdI/fqiWt1N4fL8IC1k+0cuv9ZlbGuF57w4c6iP0l/ t49gQuV9A0lWP5opLn1JKAkwWlS1JRftMCRnrt4FLACK52D2K2Tt6cg5bijADXSdePEN 6XuvNZ4ZpdDhFsxpxLCMQwuMzY5q4NvwPyxufnH8OXxp53hhbafZ4JlmJnh7l3BGdH/U YW1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4u0nMlsipyu+XwIR6Y+VD6kLwYQ+DRyX7X93/2ae68g=; b=e9BD2NmpHl9NVOvnQA9VF29vz3po5gDaFVrwE8kThTO6KtCAg1eWuE/8JPOhljRELE VqDKdf9FYTKrCmm6sFiuLLUaulgilIoABSJl/jS9XV5OO8T4msQFZ3V8yO1bZRQqQL51 xuCqFn9xntIwU0Zi3lI5ZSBTIThJ9jC3kZVCLe6nJn6matSOwljLoQlorMzDgMVocJ24 FECtcNShMp21gNUxtmRiN9ywq9HEgiTTv+YyHHaqn6tzFO7hKc8vISy0cF3z6M/MNBM5 EGlyTmlW/fff/UcpPr6ivDU8ARQeKRZOnlcy00Q+4rkvzEgs1kXwvCSmgT2kj9nIF2gi Fn4A== X-Gm-Message-State: AOAM530FjbKcmcJ3LzX273yeC+nHyoFEpLvzXU4WReL10VowhjMLfCAm g6Tvx5h4YQdWA4lprzElCOWkxQ== X-Google-Smtp-Source: ABdhPJxJr0AT4yc8k2UT9IH28cpAKE+WYM/yF2quU+grEDqO9xYwQyfMHiFCEXN6hS01D7rlLzmKxw== X-Received: by 2002:ad4:4710:: with SMTP id k16mr14157193qvz.105.1638462507292; Thu, 02 Dec 2021 08:28:27 -0800 (PST) Received: from localhost (cpe-98-15-154-102.hvc.res.rr.com. [98.15.154.102]) by smtp.gmail.com with ESMTPSA id f34sm139782qtb.7.2021.12.02.08.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 08:28:26 -0800 (PST) Date: Thu, 2 Dec 2021 11:28:25 -0500 From: Johannes Weiner To: Zhaoyang Huang Cc: Nitin Gupta , Sergey Senozhatsky , Jens Axboe , Minchan Kim , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Subject: Re: [RFC PATCH] mm: count zram read/write into PSI_IO_WAIT Message-ID: References: <1638356341-17014-1-git-send-email-huangzhaoyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 446FC1902 X-Stat-Signature: ns5ajc7ac59q7ag3p1i1m3d36bt3wgj6 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=akVrJdkr; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf22.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.219.52 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org X-HE-Tag: 1638462509-502319 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 Wed, Dec 01, 2021 at 07:12:30PM +0800, Zhaoyang Huang wrote: > There is no chance for zram reading/writing to be counted in > PSI_IO_WAIT so far as zram will deal with the request just in current > context without invoking submit_bio and io_schedule. Hm, but you're also not waiting for a real io device - during which the CPU could be doing something else e.g. You're waiting for decompression. The thread also isn't in D-state during that time. What scenario would benefit from this accounting? How is IO pressure from comp/decomp paths actionable to you? What about when you use zram with disk writeback enabled, and you see a mix of decompression and actual disk IO. Wouldn't you want to be able to tell the two apart, to see if you're short on CPU or short on IO bandwidth in this setup? Your patch would make that impossible. This needs a much more comprehensive changelog. > > @@ -1246,7 +1247,9 @@ static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, > > zram_get_element(zram, index), > > bio, partial_io); > > } > > - > > +#ifdef CONFIG_PSI > > + psi_task_change(current, 0, TSK_IOWAIT); > > +#endif Add psi_iostall_enter() and leave helpers that encapsulate the ifdefs.