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 E4440ECAAD8 for ; Wed, 14 Sep 2022 11:41:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62F106B0075; Wed, 14 Sep 2022 07:41:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DE126B0078; Wed, 14 Sep 2022 07:41:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A5D28D0001; Wed, 14 Sep 2022 07:41:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3CB456B0075 for ; Wed, 14 Sep 2022 07:41:44 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1D666140189 for ; Wed, 14 Sep 2022 11:41:44 +0000 (UTC) X-FDA: 79910501328.06.DF11FD1 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by imf12.hostedemail.com (Postfix) with ESMTP id 7A79A400C3 for ; Wed, 14 Sep 2022 11:41:43 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id bg5-20020a05600c3c8500b003a7b6ae4eb2so15288934wmb.4 for ; Wed, 14 Sep 2022 04:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=UQ6ki4yX5kQtVY1QftaIadGFPpTJFOi0It8Nz6sT1sA=; b=q/oyayVc8gtEqunNB1xJ3/FfxrAeboEzVVJSS32eCQHH7YkWiqGgc4DvqOkB0BmKB4 EGBb59YfleXrHU3uhnARoWo1nkO+5gVkRg434+fP58rkbQ+KyzSzFEdZMFr+gIQUNJxq vNaGHKI6gzmX6l03osdo1ByMaXvFnCpGisqVbAa62a/tMQq7SKC2J88arzMPMDjYF36K 5xDreZXRw+mz8OAlu6KXnu1yjwXtnaapCWAG0NQxDQmrAHbEmFBM9EVDoD7eLf/StPtW PVPtrMfMkfxUHkfJjD5j7HiSoRmkXQ3yJjff0qqwea5vgyNr/Dz+Fg3Y5dDOdpUikG5Q wIcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=UQ6ki4yX5kQtVY1QftaIadGFPpTJFOi0It8Nz6sT1sA=; b=mr882WX/G1IF9pr3eDhLmo6nnG3ZfBwmEoGiBSd79YRfWHpHGw25a9fnQHEdDOROdm u3r+/DXK9zXiN4DHF5HgmBxxJL4yW8qmEMDlfx6BngXGmG/YQEGHdgxqOkKECmIn6aVf 9BTW/dsSCP8IN+AR0XFc0GFpIau5tJkchpS2Nx0gdQNKpZAGT6WGcMLjffy3Tr/y5X13 GMzmx3i1ls/4Ui99XG/Qkly+Z2XEXR/tri+2x4w0dCnJrep2+/fHVlHU+JUbOgsYf6if hbzJLxICUM7IHlJLpL6my4/GmkjyDX5WFGpmhUfJ3sj7Rcg6hebREISIlrAZ06NTsaw5 DufA== X-Gm-Message-State: ACgBeo3cqAZdtthbafcvhWrHEnE9qmLk3YNylGXyFYpXMEollufUIDnZ l3thHCi7OrL2zKQ/nwCh1lnJHQ== X-Google-Smtp-Source: AA6agR5iucBxgT+lWuCgOcqjgv1Qz0MJiMgw6JKNQ8nsLCUf51/5QiLnwph6LP3BZLcxpH7lhwgthg== X-Received: by 2002:a7b:c457:0:b0:3b4:689d:b408 with SMTP id l23-20020a7bc457000000b003b4689db408mr2835029wmi.22.1663155702145; Wed, 14 Sep 2022 04:41:42 -0700 (PDT) Received: from localhost ([185.122.133.20]) by smtp.gmail.com with ESMTPSA id e17-20020a5d5951000000b00228dc37ce2asm13229870wri.57.2022.09.14.04.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Sep 2022 04:41:41 -0700 (PDT) Date: Wed, 14 Sep 2022 12:41:40 +0100 From: Johannes Weiner To: Christoph Hellwig Cc: Jens Axboe , Matthew Wilcox , Suren Baghdasaryan , Andrew Morton , Chris Mason , Josef Bacik , David Sterba , Gao Xiang , Chao Yu , linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-mm@kvack.org Subject: Re: [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls Message-ID: References: <20220910065058.3303831-1-hch@lst.de> <20220910065058.3303831-2-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220910065058.3303831-2-hch@lst.de> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663155703; a=rsa-sha256; cv=none; b=7Vi5YPmwpnFK3WoxVh7Zy4+2qcEa7BA6jUbKbIal1TsRb/07NV+zRL9JX/kCGJv8a6whaX OUZuNBFGCobJgPFCfmBCtqMBM3LVdDoC4o45iduWJm5xsL5vLX5kZVXai3xdqRu2C8pSc2 eN0d90TL2+jqHFqvnUqos4gLlx2189w= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b="q/oyayVc"; spf=pass (imf12.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.128.50 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663155703; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UQ6ki4yX5kQtVY1QftaIadGFPpTJFOi0It8Nz6sT1sA=; b=rplp4ZB5cHaMEsdZD1sUS7N7imAdGLerdJYvvZa2u8peBKt/WXLHidyu2BAE3yuCFNUjBo zWnNngEU5xMqZTh8YM7ObEFvHoi9WIQhYPwLRHpNYDl81gNFrR88iOOjuKEzC2JHWVb2aU 17KqlsRxiEObfBRDFFHRIrl6sCwlpaM= X-Rspam-User: Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b="q/oyayVc"; spf=pass (imf12.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.128.50 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org X-Rspamd-Server: rspam02 X-Stat-Signature: dq9myhgmhjscnhoqiammgmbnmb6qo847 X-Rspamd-Queue-Id: 7A79A400C3 X-HE-Tag: 1663155703-390390 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 Sat, Sep 10, 2022 at 08:50:54AM +0200, Christoph Hellwig wrote: > PSI tries to account for the cost of bringing back in pages discarded by > the MM LRU management. Currently the prime place for that is hooked into > the bio submission path, which is a rather bad place: > > - it does not actually account I/O for non-block file systems, of which > we have many > - it adds overhead and a layering violation to the block layer > > Add the accounting into the two places in the core MM code that read > pages into an address space by calling into ->read_folio and ->readahead > so that the entire file system operations are covered, to broaden > the coverage and allow removing the accounting in the block layer going > forward. > > As psi_memstall_enter can deal with nested calls this will not lead to > double accounting even while the bio annotations are still present. > > Signed-off-by: Christoph Hellwig This is much cleaner. With the fixlet Willy pointed out: Acked-by: Johannes Weiner