Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp601601pxb; Thu, 31 Mar 2022 12:38:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1gy4XqONwwfPBI+7iV6QAnqFPYOf5RRPSAyPL2VGZ6i9bm3cJ0b1aq9EwuLIQREKGzjai X-Received: by 2002:a17:907:d04:b0:6db:56be:ef8 with SMTP id gn4-20020a1709070d0400b006db56be0ef8mr6690983ejc.188.1648755530619; Thu, 31 Mar 2022 12:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648755530; cv=none; d=google.com; s=arc-20160816; b=gsyyBaF2nfmcr8Wf2eIgUeNH2NYiHt2FVVybqNZczOFC06N8SQlfpoyTPDPGkOY31X uwp75J5oNy4CFNKLJPocB4AjWfS26HfXtWSCiGJfY8gRlt4KL+CTTftA2ZySZ4ldUEom ZalFPvqUqbJV0UQPgeFzsb16W/hkODKbk+Q/HMY9aJcAtf6v/br4kKd42vyuDewri6HX EuxsZOInYjmj5o97gqBRxmeXU8nrl564i9JezXfW7vVxHUiGMjnCLcXmHtG85UYqxO2O Giy5eJ9+x8AHcf7/PmPSUNIzh99H3o+EjtHW2rde6v+uXgKy063E0Km7C1Wk/x9J9h/h IVEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3OVG7rRs2TdxNhin07a4J/J4tSbwW3zVKWCQEqpy4T0=; b=PuACsAcIN+3hlts7FDB4Q4tD9MriHbf047Va7tNXka7jRwiZSs1s7oegowI6b4euWT 93ZuRCRH944PSsbR5qeKs1BCjQE4L6O4/qrfqsD8gXkvXkTXU96/KBkzgyuTMV3fgxSc 1YPBJ31vdiI8Nm9ntX4q1q+1d0C+to2SQVcPli6EDaWTsQ3aB8uUI21kGpxkqwZ8mRZV 42btSGJbEXzVTCwSrPRCbXOympPSyXg2q0tSLvbf+jXuKzzk8/HQAvfpxe4O4jcuZv1M 4bG3HqK6aIlHSv9bLEPgMC1AWKbGyOsuGnnBera7onoJ84GByxemq6HONs65B4WECIm8 kUjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=RG4lduE7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a17090681c800b006e019eeee9esi257778ejx.674.2022.03.31.12.38.25; Thu, 31 Mar 2022 12:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=RG4lduE7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235912AbiCaTJu (ORCPT + 99 others); Thu, 31 Mar 2022 15:09:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234157AbiCaTJt (ORCPT ); Thu, 31 Mar 2022 15:09:49 -0400 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B709821C727 for ; Thu, 31 Mar 2022 12:08:00 -0700 (PDT) Received: by mail-qv1-xf33.google.com with SMTP id ke15so303401qvb.11 for ; Thu, 31 Mar 2022 12:08:00 -0700 (PDT) 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=3OVG7rRs2TdxNhin07a4J/J4tSbwW3zVKWCQEqpy4T0=; b=RG4lduE77Jx8ZvyFt0EEudaFQPE1BG1QemD1WbZ9kW59cgVUqy0SCXMOSppS+G6cVf cxktuXi0BZS0Tx2g7D5YSybqxaGh43sibMhPHWEp+pI1F9ZrBxIKh8ykoQvHOKyatXvi O83/FHYqSuuR0U8E17Cc4cdXkpTR6pEf2jFCoCT7d88iTIOd+dNKFkCcAYW9QHVsQFtZ K7yZlpPoEdc/+L/xsgIOY3A4kPPItFYk+hrCwGpVsIebdDQErh3Bi962ANb6E/rDZx2o Rp+I8NRtEKfZAPWAMQpiN91TqH2SD1pTEFUNOiyi1jSOg0G78Ifnrn76h8iD1lTxDKk2 ZFDw== 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=3OVG7rRs2TdxNhin07a4J/J4tSbwW3zVKWCQEqpy4T0=; b=0OQjeMls1ZMPIsQQ8DeqQQxXhm+7PnHCOPSXDYKijfhIt23+hSFscPzvNGvsXkIvON fZUEM3QkEcGSmwrrP7X65His9TETeCWT4PzA/yfT1DylNBVglNYUAdf3SB2f+qKo11y+ 7U5yw+QJKBcikpM6tvCFgZpMrkvzCsO7aO76ya7pooko09NEBYMizyQ4F5EhTGqbL6l8 qaprcao1M3MtinAmKryKLHxMwtQR8la3WYNtzdWDz/W/wvGrwMfSpJzULsl/rn2X+oNa 3snAdDpQ9ck2K/G2dFS3D0wCB14gUAvajt4/4P1CVwi89c9MbB+3Mmfh1/BfMjBTz085 b6rg== X-Gm-Message-State: AOAM530Qgwt6KVziIKDD8wL0Vj4rVQpt6kAkTegtHnkuflGLD4TJ3Rok fZ8K3BdoPy+lvy4JlXuRgTvV8A== X-Received: by 2002:a05:6214:766:b0:441:a5df:8ace with SMTP id f6-20020a056214076600b00441a5df8acemr5388121qvz.87.1648753679514; Thu, 31 Mar 2022 12:07:59 -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 b29-20020a05620a271d00b0067e0c273331sm78539qkp.111.2022.03.31.12.07.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 12:07:58 -0700 (PDT) Date: Thu, 31 Mar 2022 15:07:58 -0400 From: Johannes Weiner To: Christoph Hellwig Cc: CGEL , axboe@kernel.dk, viro@zeniv.linux.org.uk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, Yang Yang , Ran Xiaokai Subject: Re: [PATCH] block/psi: make PSI annotations of submit_bio only work for file pages Message-ID: References: <623938d1.1c69fb81.52716.030f@mx.google.com> <20220323061058.GA2343452@cgel.zte@gmail.com> <62441603.1c69fb81.4b06b.5a29@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 30, 2022 at 10:15:32PM -0700, Christoph Hellwig wrote: > On Wed, Mar 30, 2022 at 12:17:09PM -0400, Johannes Weiner wrote: > > It's add_to_page_cache_lru() that sets the flag. > > > > Basically, when a PageWorkingset (hot) page gets reclaimed, the bit is > > stored in the vacated tree slot. When the entry is brought back in, > > add_to_page_cache_lru() transfers it to the newly allocated page. > > Ok. In this case my patch didn't quite do the right thing for readahead > either. But that does leave a question for the btrfs compressed > case, which only adds extra pages to a read to readahad a bigger > cluster size - that is these pages are not read at the request of the > VM. Does it really make sense to do PSI accounting for them in that > case? I think it does. I suppose it's an argument about readahead pages in general, which technically the workload itself doesn't commission explicitly. But those pages are still triggered by a nearby access, their reads contribute to device utilization, and if they're PageWorkingset it means they're only being read because there is a lack of memory. In a perfect world, readahead would stop when memory or IO are contended. But it doesn't, and the stalls it can inject into the workload are as real as stalls from directly requested reads.