Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26482608rwd; Mon, 3 Jul 2023 10:14:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlHdYGwo0YME4nGcSNA8PDKyB6QPw3WQbi6NM+Q++XYSdrkus/TeLZAdkyID3ng3ycUlcctT X-Received: by 2002:a05:6808:f16:b0:3a3:8e77:ddfd with SMTP id m22-20020a0568080f1600b003a38e77ddfdmr9109302oiw.8.1688404452085; Mon, 03 Jul 2023 10:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688404452; cv=none; d=google.com; s=arc-20160816; b=Fp63+KFo7hDmyuUx8Smmnt/bVn20TrzkNJ9iMHUC1U9VcfC/lpPdFinJTu5Zzs8aiu ZijIA3g27VrFfaIM7yce4Aud6AbI7PTPXorHB+cCSf/BMdhx86/P94BcgeX2v/QyGD/9 Miz+5kPddWYaZcPZJ0yMzXz94SwT+5Ve5Q03RWolNISgGCRMPF2Xau0GNSwXoLzCGwAG KnYII65GNEo0850SAuSteI4h28zbPY5GfL1mhEydB3Cm0Tq+OHDWXMuiM2LXtp4Kqshp 2oJkRzPrtTMixosAgwuLxd81xO6ocqF0I6u0EHom+TvwfPcXcPk845E67UFQf000zLe5 yLKQ== 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=CxxA5KPOlxZoqVBuLA7u+rs+PuFzIjExMLh3T2z3dig=; fh=tR8etD8FjDpmak3hDI4F1Uee7VHXHtfQdkIkXgd7GoU=; b=nFEagup+kl6P6GuqbbJHFNh9Adlkv1yT8y2uHkNh/sBZ5d7d6nb/KnSD6v5O1lZxRe HxYMiSAB3lCFg5/p2C+Snd9dGXMLgF2vI1GISPHPX/JlvrmmBruak4EaxuzT3bBgyD5N 6ZYMRCD4z7wg2hfUSHoJ6owRfL6Dc39X3UuTdH4F2uaqOrCV/6Qy6Cfypi7W1idW7cz3 8D5fvb/6CwI9JcjXvxXI39V3bp6fw2G23+tVtm1HyIez+c5iUp/B+EKfxSBsiNa74WaX v6lnbrGl+LsZWukFKRoFE1qT753enxrcpNPuasjsbHrHIEBAb08DJFnQClDxxev9geqV yA2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=WwkmG+qa; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 mi1-20020a17090b4b4100b0025027e0ad3dsi7336485pjb.81.2023.07.03.10.13.51; Mon, 03 Jul 2023 10:14:12 -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=WwkmG+qa; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 S230467AbjGCRBU (ORCPT + 99 others); Mon, 3 Jul 2023 13:01:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230465AbjGCRBT (ORCPT ); Mon, 3 Jul 2023 13:01:19 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC79EE58; Mon, 3 Jul 2023 10:01:18 -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-out1.suse.de (Postfix) with ESMTPS id A906621ACE; Mon, 3 Jul 2023 17:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688403676; 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=CxxA5KPOlxZoqVBuLA7u+rs+PuFzIjExMLh3T2z3dig=; b=WwkmG+qaXYNQ/vu9q4F7pEj9wrt2bBvW6aP9mlVUwydMkr7hS3xU7fSguhVECWbugKFVwD nFfsMv+fh+VCYPr0mUXkIt6MUoHAY0tHWAVVhgoa1E0ZsN/9yuDPQzhSeKss/q3dJUw1Ta kHoy5ufRYv9txFxyUyUCkLRfw+3UDts= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688403676; 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=CxxA5KPOlxZoqVBuLA7u+rs+PuFzIjExMLh3T2z3dig=; b=RCvYdmMDKz+U+kgLqNfhNNngHIe4nuoTf2Nywg7oLIDSHSzTvjaJ7eJOx50qEZOlN3bDcL q6LZq+rMlUQWdcBQ== 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 995451358E; Mon, 3 Jul 2023 17:01:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id tSFmJdz+omSOEQAAMHmgww (envelope-from ); Mon, 03 Jul 2023 17:01:16 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 2DC8AA0722; Mon, 3 Jul 2023 19:01:16 +0200 (CEST) Date: Mon, 3 Jul 2023 19:01:16 +0200 From: Jan Kara To: Baokun Li Cc: jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [PATCH v3 0/5] quota: fix race condition between dqput() and dquot_mark_dquot_dirty() Message-ID: <20230703170116.xikrectpzdc5dmux@quack3> References: <20230630110822.3881712-1-libaokun1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230630110822.3881712-1-libaokun1@huawei.com> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL,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 Hello! On Fri 30-06-23 19:08:17, Baokun Li wrote: > Hello Honza, > > This is a solution that uses dquot_srcu to avoid race condition between > dqput() and dquot_mark_dquot_dirty(). I performed a 12+h fault injection > stress test (6 VMs, 4 test threads per VM) and have not found any problems. > And I tested the performance based on the next branch (5c875096d590), this > patch set didn't degrade performance, but rather had a ~5% improvement. > > V1->V2: > Modify the solution to use dquot_srcu. > V2->V3: > Merge some patches, optimize descriptions. > Simplify solutions, and fix some spelling errors. > Thanks! I've added the patches to my tree. Honza > Baokun Li (5): > quota: factor out dquot_write_dquot() > quota: rename dquot_active() to inode_quota_active() > quota: add new helper dquot_active() > quota: fix dqput() to follow the guarantees dquot_srcu should provide > quota: simplify drop_dquot_ref() > > fs/quota/dquot.c | 244 ++++++++++++++++++++++++----------------------- > 1 file changed, 125 insertions(+), 119 deletions(-) > > -- > 2.31.1 > -- Jan Kara SUSE Labs, CR