Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12BCEC433E0 for ; Wed, 10 Jun 2020 15:31:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE4E520734 for ; Wed, 10 Jun 2020 15:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730178AbgFJPa7 (ORCPT ); Wed, 10 Jun 2020 11:30:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:58726 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726979AbgFJPa7 (ORCPT ); Wed, 10 Jun 2020 11:30:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 312A4AC7F; Wed, 10 Jun 2020 15:31:01 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id EE0C91E1283; Wed, 10 Jun 2020 17:30:56 +0200 (CEST) Date: Wed, 10 Jun 2020 17:30:56 +0200 From: Jan Kara To: Christoph Hellwig Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Ted Tso , Martijn Coenen , tj@kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/3] writeback: Avoid skipping inode writeback Message-ID: <20200610153056.GA20677@quack2.suse.cz> References: <20200601091202.31302-1-jack@suse.cz> <20200601091904.4786-1-jack@suse.cz> <20200610150203.GA21733@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200610150203.GA21733@infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed 10-06-20 08:02:03, Christoph Hellwig wrote: > This generall looks ok, but a few nitpicks below: > > > -static void redirty_tail(struct inode *inode, struct bdi_writeback *wb) > > +static void __redirty_tail(struct inode *inode, struct bdi_writeback *wb) > > I think redirty_tail_locked would be a more decriptive name, and also > fit other uses in this file (e.g. inode_io_list_move_locked and > inode_io_list_del_locked). Fair enough, will do. > > { > > + assert_spin_locked(&inode->i_lock); > > if (!list_empty(&wb->b_dirty)) { > > Nit: I find an empty line after asserts and before the real code starts > nice on the eye. Sure. > > break; > > list_move(&inode->i_io_list, &tmp); > > moved++; > > + spin_lock(&inode->i_lock); > > if (flags & EXPIRE_DIRTY_ATIME) > > - set_bit(__I_DIRTY_TIME_EXPIRED, &inode->i_state); > > + inode->i_state |= I_DIRTY_TIME_EXPIRED; > > + inode->i_state |= I_SYNC_QUEUED; > > + spin_unlock(&inode->i_lock); > > I wonder if the locking changes should go into a prep patch vs the > actual logic changes related to I_SYNC_QUEUED? That would untangle > the patch quite a bit and make it easier to follow. OK, will do. > > #define I_WB_SWITCH (1 << 13) > > #define I_OVL_INUSE (1 << 14) > > #define I_CREATING (1 << 15) > > +#define I_SYNC_QUEUED (1 << 16) > > FYI, this conflicts with the I_DONTCAT addition in mainline now. Yup, I've already found out when rebasing... Thanks for review! Honza -- Jan Kara SUSE Labs, CR