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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F229C4332F for ; Wed, 30 Mar 2022 16:17:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348694AbiC3QS7 (ORCPT ); Wed, 30 Mar 2022 12:18:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbiC3QS5 (ORCPT ); Wed, 30 Mar 2022 12:18:57 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A90BEBE22 for ; Wed, 30 Mar 2022 09:17:11 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id j21so18496555qta.0 for ; Wed, 30 Mar 2022 09:17:11 -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=sE79b5xf1pu5spCGHEXKbfq2zO6/d3c8ibhtXAoqtQ8=; b=0MJRsQjAcGaYRmd1h6Pqxr17HDJtykd8JOH+AOEISyH5SHZzxS8LscnZAXcKOFHdVF zpo83KdVFXKzTrrBkdac9nldVOA2KFBimbg7untEnME14A+bruTvVC+WVVPZWOeM7UEo xS8Fc9GofuwWqbcSmn4dufLUSvrWhUF/vl2lQo07i0t9LFTS3FCx4fFPPfIiqLmzUwb1 13yjnnWj/PIyED9DcxN/IW7n6ogFQn3BviOTH2hBN18UsUQXbN7p33moYsp6bHRvswCl YhvIlqYNacFE+iHwNivuq04BuVbB8hWfG6zrRXGI0X7QTOkbWjqPaNP+OQoVFqQ4NJik OhTg== 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=sE79b5xf1pu5spCGHEXKbfq2zO6/d3c8ibhtXAoqtQ8=; b=L1KVqBSHVVayxsD+yh1Ft6EbvBWqbTS4yP+bjBEMQlpgnvqa+1kY61h/EBNm3zUqCf rU3gJ8GWUjUotQ3nzWoc5W3O2q50sCp0XVbZ/ShCYME7Zg60vW1L8pfLFouNG0A3mWsf sYB8oxjq08GzqWM9whsT5fZ5cFfeXPEd5bvvOha8HTk3g7RTgos79uXINQkc9wUmSpou jpJW2eOjwtdhtB0KSHtR3zEhP2APlPTCv/cCH3gCQzsD9YRL19mFf6ummVUqeFZeUu/l iNyyto4IPz0TcycjVS8V1iK5Qxxh5gAjVDdq7zDBHlIaMI69OOvrIoqi5G9jiKiAQbqo Cglg== X-Gm-Message-State: AOAM532wpymk04nh+yG4/CJVJpZvHV9h+jwEeJKWe18EgdIZzZLuuomg pZlh+aCdxtoRhfvHr9o7GLOfuw== X-Google-Smtp-Source: ABdhPJzF/ry2xuy0oHxOMDKGlfKRY6IH7+5YeycyXAPyxi9mB2917VgqHJK8duwayZ5P0FrMTPzVgA== X-Received: by 2002:a05:622a:8e:b0:2e1:fee4:8ca2 with SMTP id o14-20020a05622a008e00b002e1fee48ca2mr242426qtw.431.1648657030772; Wed, 30 Mar 2022 09:17:10 -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 s13-20020a05620a0bcd00b0067afe7dd3ffsm11684222qki.49.2022.03.30.09.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 09:17:10 -0700 (PDT) Date: Wed, 30 Mar 2022 12:17:09 -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: <20220316063927.2128383-1-yang.yang29@zte.com.cn> <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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 30, 2022 at 08:54:09AM -0700, Christoph Hellwig wrote: > On Wed, Mar 30, 2022 at 11:45:56AM -0400, Johannes Weiner wrote: > > > FYI, I started redoing that version and I think with all the cleanups > > > to filemap.c and the readahead code this can be done fairly nicely now: > > > > > > http://git.infradead.org/users/hch/block.git/commitdiff/666abb29c6db870d3941acc5ac19e83fbc72cfd4 > > > > Yes, it's definitely much nicer now with the MM instantiating the > > pages for ->readpage(s). > > > > But AFAICS this breaks compressed btrfs (and erofs?) because those > > still do additional add_to_page_cache_lru() and bio submissions. > > In btrfs, add_ra_bio_pages only passed freshly allocated pages to > add_to_page_cache_lru. These can't really have PageWorkingSet set, > can they? In erofs they can also come from a local page pool, but > I think otherwise the same applies. 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. add_to_page_cache_lru() filemap_add_folio() __filemap_add_folio(mapping, folio, index, gfp, &shadow) *shadow = *slot *slot = folio if (shadow) workingset_refault(folio, shadow) folio_set_workingset()