Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp871104rwr; Fri, 5 May 2023 06:17:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4s8GA36l/NQdM4ycRTmLMJKU63TAWllLU/RHqExa4VBkI1Kmuz0Pv9hadGmQkgyA3xu9Hg X-Received: by 2002:a05:6a00:ad0:b0:63b:8a91:e641 with SMTP id c16-20020a056a000ad000b0063b8a91e641mr2273504pfl.11.1683292622298; Fri, 05 May 2023 06:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683292622; cv=none; d=google.com; s=arc-20160816; b=Qsc7y7MqksXy/idTne50HRh+8FqkTLNqZjJ1Qac6afiW3EyXfp9t4suYO3MdIbflMK hmnPI4LsXni0XOEN0M+GW/iU4jEQ5YxQBfFzS6DuidlGO2liu85YQjFw2MRQDX35R577 g93yMCMT8bHty30IO85tYK6RhkZe4Cm7hZ8tvneSdKd87gjwlh4ij5Cqk1T+Zolhv5LJ 2pdeQW1qnAudRt/RZHX0q6VHWB5w6f3mFDv7910fWhjr9g3Dfal20cY6ybulKlG4xiEe wQ88KgJP3Qu5g+ZRZNSEMLSYNU3KuCmA2Dz0ziBA71yR1uGaVRiULL56Je/3PBvGHrjl lJQA== 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 :dkim-signature; bh=aP8ucgSKWZ+6oWS8BkWtiN/SKYzsbUY3TVFeTAV3Re8=; b=Wfgo3MAHs6TFXfo1s9a9gTI9Y+qKAbfSM5akeZd0fCql77GCm/CvFIQLujtkTeLrgd 8QjUSCaxoUgFmzAm+zC3BlGjMbtwA0w0SOANDX5c3EgDGX+gy8qzLIREH4/7rPD9U+OF lXoJl90oWqCGLfHr4uw++NZIwCrZzh8kt0NY4mZRX0kJXHTvPgpU/xsYgMQABmTJ0GHw rfwV7XvMsqikrtanz72aRwHeTu9Z7BrtsLgdRLQtFi79TElVza2eJnNE6J836yR5mZ+o cpVGqcdl3IhCSH9LWZRzi9f4oyCDSv6TbZnYkBerbkzuI9XctBg3AQPevIuPJ/FgJ8Pu wxGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=PzuvrXJW; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 o12-20020aa7978c000000b0063b817e3f1esi2056504pfp.166.2023.05.05.06.16.47; Fri, 05 May 2023 06:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@suse.cz header.s=susede2_rsa header.b=PzuvrXJW; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232052AbjEENNE (ORCPT + 99 others); Fri, 5 May 2023 09:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231788AbjEENND (ORCPT ); Fri, 5 May 2023 09:13:03 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74F341D940 for ; Fri, 5 May 2023 06:13:02 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 359C720012; Fri, 5 May 2023 13:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683292381; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aP8ucgSKWZ+6oWS8BkWtiN/SKYzsbUY3TVFeTAV3Re8=; b=PzuvrXJWUGbJJ3+8FPlK56vYENnvJG6H+eOsG1M6KgeCWPCU5vtPEM6pQI5oXehrw0XuOl eEiUjkYnrkPcvwtXnSW6MY4Pd97eofN8uJOhvanxppSQB3DeT5EubYCMwua1549BnZQqA/ XPE8Y0+nwsWQlRTAgl76v9/q0RzmTpk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683292381; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aP8ucgSKWZ+6oWS8BkWtiN/SKYzsbUY3TVFeTAV3Re8=; b=tVilGRBoju5gBhsos03Y77GXsLAuFoE5yerf6uEMcfLpUXXW8uh8xbKs/ntPgj3rqcAbPb UZO8uuLudejZgkAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 24F1913488; Fri, 5 May 2023 13:13:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dc7/CN0AVWQJTgAAMHmgww (envelope-from ); Fri, 05 May 2023 13:13:01 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id A1A4FA0729; Fri, 5 May 2023 15:13:00 +0200 (CEST) Date: Fri, 5 May 2023 15:13:00 +0200 From: Jan Kara To: Zhang Yi Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yi.zhang@huawei.com, yukuai3@huawei.com, chengzhihao1@huawei.com Subject: Re: [PATCH v2 2/3] jbd2: remove t_checkpoint_io_list Message-ID: <20230505131300.57p23wh53m3iabod@quack3> References: <20230505123219.4135141-1-yi.zhang@huaweicloud.com> <20230505123219.4135141-2-yi.zhang@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230505123219.4135141-2-yi.zhang@huaweicloud.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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-ext4@vger.kernel.org On Fri 05-05-23 20:32:18, Zhang Yi wrote: > From: Zhang Yi > > Since t_checkpoint_io_list was stop using in jbd2_log_do_checkpoint() > now, it's time to remove the whole t_checkpoint_io_list logic. > > Signed-off-by: Zhang Yi Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/jbd2/checkpoint.c | 42 ++---------------------------------------- > fs/jbd2/commit.c | 3 +-- > include/linux/jbd2.h | 6 ------ > 3 files changed, 3 insertions(+), 48 deletions(-) > > diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c > index ae1ebfb8bc86..2b62154e9f1e 100644 > --- a/fs/jbd2/checkpoint.c > +++ b/fs/jbd2/checkpoint.c > @@ -27,7 +27,7 @@ > * > * Called with j_list_lock held. > */ > -static inline void __buffer_unlink_first(struct journal_head *jh) > +static inline void __buffer_unlink(struct journal_head *jh) > { > transaction_t *transaction = jh->b_cp_transaction; > > @@ -40,23 +40,6 @@ static inline void __buffer_unlink_first(struct journal_head *jh) > } > } > > -/* > - * Unlink a buffer from a transaction checkpoint(io) list. > - * > - * Called with j_list_lock held. > - */ > -static inline void __buffer_unlink(struct journal_head *jh) > -{ > - transaction_t *transaction = jh->b_cp_transaction; > - > - __buffer_unlink_first(jh); > - if (transaction->t_checkpoint_io_list == jh) { > - transaction->t_checkpoint_io_list = jh->b_cpnext; > - if (transaction->t_checkpoint_io_list == jh) > - transaction->t_checkpoint_io_list = NULL; > - } > -} > - > /* > * Check a checkpoint buffer could be release or not. > * > @@ -499,15 +482,6 @@ unsigned long jbd2_journal_shrink_checkpoint_list(journal_t *journal, > break; > if (need_resched() || spin_needbreak(&journal->j_list_lock)) > break; > - if (released) > - continue; > - > - nr_freed += journal_shrink_one_cp_list(transaction->t_checkpoint_io_list, > - nr_to_scan, &released); > - if (*nr_to_scan == 0) > - break; > - if (need_resched() || spin_needbreak(&journal->j_list_lock)) > - break; > } while (transaction != last_transaction); > > if (transaction != last_transaction) { > @@ -562,17 +536,6 @@ void __jbd2_journal_clean_checkpoint_list(journal_t *journal, bool destroy) > */ > if (need_resched()) > return; > - if (ret) > - continue; > - /* > - * It is essential that we are as careful as in the case of > - * t_checkpoint_list with removing the buffer from the list as > - * we can possibly see not yet submitted buffers on io_list > - */ > - ret = journal_clean_one_cp_list(transaction-> > - t_checkpoint_io_list, destroy); > - if (need_resched()) > - return; > /* > * Stop scanning if we couldn't free the transaction. This > * avoids pointless scanning of transactions which still > @@ -657,7 +620,7 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh) > jbd2_journal_put_journal_head(jh); > > /* Is this transaction empty? */ > - if (transaction->t_checkpoint_list || transaction->t_checkpoint_io_list) > + if (transaction->t_checkpoint_list) > return 0; > > /* > @@ -749,7 +712,6 @@ void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transact > J_ASSERT(transaction->t_forget == NULL); > J_ASSERT(transaction->t_shadow_list == NULL); > J_ASSERT(transaction->t_checkpoint_list == NULL); > - J_ASSERT(transaction->t_checkpoint_io_list == NULL); > J_ASSERT(atomic_read(&transaction->t_updates) == 0); > J_ASSERT(journal->j_committing_transaction != transaction); > J_ASSERT(journal->j_running_transaction != transaction); > diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c > index b33155dd7001..1073259902a6 100644 > --- a/fs/jbd2/commit.c > +++ b/fs/jbd2/commit.c > @@ -1141,8 +1141,7 @@ void jbd2_journal_commit_transaction(journal_t *journal) > spin_lock(&journal->j_list_lock); > commit_transaction->t_state = T_FINISHED; > /* Check if the transaction can be dropped now that we are finished */ > - if (commit_transaction->t_checkpoint_list == NULL && > - commit_transaction->t_checkpoint_io_list == NULL) { > + if (commit_transaction->t_checkpoint_list == NULL) { > __jbd2_journal_drop_transaction(journal, commit_transaction); > jbd2_journal_free_transaction(commit_transaction); > } > diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h > index f619bae1dcc5..91a2cf4bc575 100644 > --- a/include/linux/jbd2.h > +++ b/include/linux/jbd2.h > @@ -622,12 +622,6 @@ struct transaction_s > */ > struct journal_head *t_checkpoint_list; > > - /* > - * Doubly-linked circular list of all buffers submitted for IO while > - * checkpointing. [j_list_lock] > - */ > - struct journal_head *t_checkpoint_io_list; > - > /* > * Doubly-linked circular list of metadata buffers being > * shadowed by log IO. The IO buffers on the iobuf list and > -- > 2.31.1 > -- Jan Kara SUSE Labs, CR