Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp1217781rdb; Mon, 21 Aug 2023 00:17:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXGlCqeiQH/KTq9p43m5W1yRPWy6SWlPPF+TAQiVfk7cusb3OHtpu10Lbae7A7eG2JI8qY X-Received: by 2002:a05:6a20:938d:b0:135:bf8d:b758 with SMTP id x13-20020a056a20938d00b00135bf8db758mr8929816pzh.16.1692602276236; Mon, 21 Aug 2023 00:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692602276; cv=none; d=google.com; s=arc-20160816; b=vzp6XjGEvFvqogzea44alLzU5yV0yT+62ibOaAEKE551c22tDOILBmDtEULuNOKcOz DMY2+izNoKaV0UFrcK2HmubBVlWrfbOW5zwtLoCrpSSUTMWQSGam21bD0ynAGQE1ekpm tbPbjeuer4DQEJRt0CbUpOnjww/IdT77HksExVEKGrSQ4o59DT5o4HVcBvTiUm3aw7IL PkviqfKCc/ccvW+U9ZBjT4PB7RjWEGKVFkm/v6ztbZeUCORGdlwg28J4FDpVcEOsue7s Z1kEhxvShqvP45fdBIx7VdMYSrLrCyxlBC+7t2b/LptaC4oS15/lWB4p1laAPQnEYwgc nDkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=U1KhNt8sTYKdtzjbOT4KtAPL1Mx70Awi71g3n8NnAfk=; fh=U90oH+c+JbXJQyqnUvNChjnMkwnenO3lQv0dZQpOyfA=; b=OyWCtUEEtI/nt8Vv6SGGpCAkoCmZSXJV/iLox5hCCw2MSCGpDUBXXSxeFfdsrOOEnd SyY0XyLk7WglYANGe4RrJjgfv25K/JT9IV9u6uuE0JWzMNqEAkkFpnVY4rLEI/+I4jqj QO2NUr/Hpw3UEWF30CB7I+VZk19nmB/6i6CymtaQYRmPo5xiu/nuoimj5hir0x7F4J// eCj3/3lwSHDJmORi0XqWOGxR19cRZqfDec1e/+L01yEfnAFVCVlarSItWGfr6isayMm/ 3trFt1mVPMoywRmvl5hZSYGRPyXKMS2NKWT2Rbcf/5ZGn2DDocl2DrqHEZezzmVxstPT j54Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca20-20020a056a02069400b00543cba6043asi7091899pgb.151.2023.08.21.00.17.43; Mon, 21 Aug 2023 00:17:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233087AbjHUEyq (ORCPT + 99 others); Mon, 21 Aug 2023 00:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjHUEyp (ORCPT ); Mon, 21 Aug 2023 00:54:45 -0400 Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 031D9A3; Sun, 20 Aug 2023 21:54:41 -0700 (PDT) X-AuditID: a67dfc5b-d85ff70000001748-91-64e2ee0f13f7 Date: Mon, 21 Aug 2023 13:51:36 +0900 From: Byungchul Park To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, kernel_team@skhynix.com, torvalds@linux-foundation.org, damien.lemoal@opensource.wdc.com, linux-ide@vger.kernel.org, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, will@kernel.org, tglx@linutronix.de, rostedt@goodmis.org, joel@joelfernandes.org, sashal@kernel.org, daniel.vetter@ffwll.ch, duyuyang@gmail.com, johannes.berg@intel.com, tj@kernel.org, tytso@mit.edu, david@fromorbit.com, amir73il@gmail.com, gregkh@linuxfoundation.org, kernel-team@lge.com, linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@kernel.org, minchan@kernel.org, hannes@cmpxchg.org, vdavydov.dev@gmail.com, sj@kernel.org, jglisse@redhat.com, dennis@kernel.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, vbabka@suse.cz, ngupta@vflare.org, linux-block@vger.kernel.org, josef@toxicpanda.com, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, jlayton@kernel.org, dan.j.williams@intel.com, hch@infradead.org, djwong@kernel.org, dri-devel@lists.freedesktop.org, rodrigosiqueiramelo@gmail.com, melissa.srw@gmail.com, hamohammed.sa@gmail.com, 42.hyeyoo@gmail.com, chris.p.wilson@intel.com, gwan-gyeong.mun@intel.com, max.byungchul.park@gmail.com, boqun.feng@gmail.com, longman@redhat.com, hdanton@sina.com, her0gyugyu@gmail.com Subject: Re: [RESEND PATCH v10 25/25] dept: Track the potential waits of PG_{locked,writeback} Message-ID: <20230821045136.GB73328@system.software.com> References: <20230821034637.34630-1-byungchul@sk.com> <20230821034637.34630-26-byungchul@sk.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA02SbUxTZxTH9zz39rm3nXXX6rJHWDbt4rZgJi9xyYkuy7LE7Vm2JSa6D7oP 0K030lDQFEUgMcFZFXmtJsCo3VJgK4gVtRDFabWAUpgOmCBWBDI6NkFaSMCi5c21c2Z+Ofnl /HN++X84IqfJIzGiIWOvbMrQGbVExauCy6ree2XSr0/4yxcPx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am-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Mon, Aug 21, 2023 at 05:25:41AM +0100, Matthew Wilcox wrote: > On Mon, Aug 21, 2023 at 12:46:37PM +0900, Byungchul Park wrote: > > @@ -377,44 +421,88 @@ static __always_inline int Page##uname(struct page *page) \ > > #define SETPAGEFLAG(uname, lname, policy) \ > > static __always_inline \ > > void folio_set_##lname(struct folio *folio) \ > > -{ set_bit(PG_##lname, folio_flags(folio, FOLIO_##policy)); } \ > > +{ \ > > + set_bit(PG_##lname, folio_flags(folio, FOLIO_##policy)); \ > > + dept_page_set_bit(&folio->page, PG_##lname); \ > > The PG_locked and PG_writeback bits only actually exist in the folio; > the ones in struct page are just legacy and never actually used. > Perhaps we could make the APIs more folio-based and less page-based? Yeah. I need to make it more folio-based. I will work on it. Thank you. > > static __always_inline void SetPage##uname(struct page *page) \ > > -{ set_bit(PG_##lname, &policy(page, 1)->flags); } > > +{ \ > > + set_bit(PG_##lname, &policy(page, 1)->flags); \ > > + dept_page_set_bit(page, PG_##lname); \ > > +} > > I don't think we ever call this for PG_writeback or PG_locked. If > I'm wrong, we can probably fix that ;-) Okay then, I will assume this will never be used. So are you asking me to get rid of this part, right? > > static __always_inline void __SetPage##uname(struct page *page) \ > > -{ __set_bit(PG_##lname, &policy(page, 1)->flags); } > > +{ \ > > + __set_bit(PG_##lname, &policy(page, 1)->flags); \ > > + dept_page_set_bit(page, PG_##lname); \ > > +} > > Umm. We do call __SetPageLocked() though ... I'll fix those up to > be __set_folio_locked(). Haha Okay. Lemme know when you get done on it. Thanks. Byungchul