Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp572508pxp; Wed, 9 Mar 2022 08:23:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgvVBCb8Fm81ocrRcCUH8/Ay/fljoPylBnRLv7Jtun/n5+Hc+Jy1csxten/CYL1SDhSfjP X-Received: by 2002:a05:6402:3489:b0:416:9121:6936 with SMTP id v9-20020a056402348900b0041691216936mr198030edc.249.1646843005691; Wed, 09 Mar 2022 08:23:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646843005; cv=none; d=google.com; s=arc-20160816; b=KYCkeSzliV0PS/08EsCAR2GSSmlrPmDf1EGKsMZVOAfR1eUSwF7XZkNV+pudff0JB9 bgcbeRSjfhy3pbBBb+R02TaR0/IjQmQXFeRLFrM0ZuDtLZ3zeI/oX2koFyZvL1eWe5L0 KI1Zx3sLOaWjCvb9ovohXdQ5lTTtxMURCY8hNdGA2PJ5Mfd4SsM9efwiSNFQ7wIsuq2g 2O2fZVscmgmi1MywEKCeY+QBAcHB6p/mUZDBQumgIu4nNUis8nmV4qbnZbynnpduNAjh Qa8rIGq3uRLxX8J8kAG+kNmcaZUgoFcdrw+P8CCdny+laKuO8djMSdfHW4SQTeZTlxcS rF/Q== 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=KzQ2m+w+wM5hzhgWmPch51aqnlv1ZH0RRI+SLiqmKXI=; b=d5g3oxlcC4uxyeuSkagApmIiHfsjds8fs/Sx0sz6CHqtFD+Yr80nSHWC3aSjhOTLYW qeaQmraJaK68tZ2iFt3KUlWYmlNGdVunH5aNL+YP/6viMdex+kLUss0KAVk+xiARbp5W AC3xfLXXgNv6v27UjAX4z2Ga8n3DpWXq4/f64b44A78+4H3SpYIL89FZY92fpxU9SAjG FAtwr83r5xLmNrhTJFz0W43YhlDUcWDhlyj/9zZ/Jy8XcYCM0KhCAWomRNacZmht1A+K 3vSpz2/HLZMvMLDs1PU91Cen97k/4+yDv68cBeBs/u/8YN7pxesKMxOYSGy1EisJxnLR Bevw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=rrm7E5lt; dkim=neutral (no key) header.i=@suse.cz header.b="7Oz/kxYK"; 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 cq1-20020a056402220100b0041330bfd964si1516060edb.494.2022.03.09.08.22.53; Wed, 09 Mar 2022 08:23:25 -0800 (PST) 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=rrm7E5lt; dkim=neutral (no key) header.i=@suse.cz header.b="7Oz/kxYK"; 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 S229518AbiCIKMA (ORCPT + 99 others); Wed, 9 Mar 2022 05:12:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231901AbiCIKL6 (ORCPT ); Wed, 9 Mar 2022 05:11:58 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E61AC16A5BB for ; Wed, 9 Mar 2022 02:10:59 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9C777210EE; Wed, 9 Mar 2022 10:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646820658; 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=KzQ2m+w+wM5hzhgWmPch51aqnlv1ZH0RRI+SLiqmKXI=; b=rrm7E5ltGC0nOWLQR6PF8ctS5+bJUgCs7Vc345936Q4un9d1191g5y7zeWlmOsGz5CbuoL goJvfKQkzdE+yMCQ8CVcIiPK2ELiQ2TviwJt59OCqvJ2ai6npxHBPK6s0DhuxLncvlVkYv Yo6r5oM5LxNnxMaEOpxWAAX5zL16HF8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646820658; 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=KzQ2m+w+wM5hzhgWmPch51aqnlv1ZH0RRI+SLiqmKXI=; b=7Oz/kxYKxCIzs5ypEn+ANi91+OmU1mSoWRKfrrD/LO8KZ0d4XrL7Hw0F7k9r38QstFTtiA R5J7fI7AHwlA3YDA== Received: from quack3.suse.cz (unknown [10.163.43.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 83679A3B9A; Wed, 9 Mar 2022 10:10:58 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id 00B48A060B; Wed, 9 Mar 2022 11:10:57 +0100 (CET) Date: Wed, 9 Mar 2022 11:10:57 +0100 From: Jan Kara To: Harshad Shirwadkar Cc: linux-ext4@vger.kernel.org, riteshh@linux.ibm.com, jack@suse.cz, tytso@mit.edu Subject: Re: [PATCH v2 1/5] ext4: convert i_fc_lock to spinlock Message-ID: <20220309101057.3uuix2gvjinobt3i@quack3.lan> References: <20220308163319.1183625-1-harshads@google.com> <20220308163319.1183625-2-harshads@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220308163319.1183625-2-harshads@google.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 Tue 08-03-22 08:33:15, Harshad Shirwadkar wrote: > From: Harshad Shirwadkar > > Convert ext4_inode_info->i_fc_lock to spinlock to avoid sleeping > in invalid contexts. > > Signed-off-by: Harshad Shirwadkar One comment below... > @@ -972,9 +970,13 @@ static int ext4_fc_wait_inode_data_all(journal_t *journal) > > spin_lock(&sbi->s_fc_lock); > list_for_each_entry_safe(pos, n, &sbi->s_fc_q[FC_Q_MAIN], i_fc_list) { > + spin_lock(&pos->i_fc_lock); > if (!ext4_test_inode_state(&pos->vfs_inode, > - EXT4_STATE_FC_COMMITTING)) > + EXT4_STATE_FC_COMMITTING)) { > + spin_unlock(&pos->i_fc_lock); > continue; > + } > + spin_unlock(&pos->i_fc_lock); > spin_unlock(&sbi->s_fc_lock); Why do you add a lock here in a pure lock-conversion patch? Furthermore I don't think the lock is needed... Honza -- Jan Kara SUSE Labs, CR