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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 9BD82C433DB for ; Fri, 12 Mar 2021 14:04:39 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53FA264FFD; Fri, 12 Mar 2021 14:04:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53FA264FFD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1lKiP8-0000HQ-RP; Fri, 12 Mar 2021 14:04:38 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKiOz-0000Gs-Em for linux-f2fs-devel@lists.sourceforge.net; Fri, 12 Mar 2021 14:04:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QG6nGkZf4NuFjY4AOpFss6W+gTep3SauFypxHdCIQdw=; b=EfOBAwxOnug3zRaRHuBTtGNbsp 8uLy3GGvXLqy5QaCNYNTnd4wC1p3oBzaTio/g4vcToQvrssCzRvubUVxD2VHLAY+1GIfVvAPAUInA hthe2Jov0qo8chs4yVHLZQmQsenAJyRK2tEdPG9LHOsFBvmCm1XL+yPU94LM0oS++deA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QG6nGkZf4NuFjY4AOpFss6W+gTep3SauFypxHdCIQdw=; b=G8IYLfwjXUN8CJWA15UBOiOKc2 OzUMnOzjCvHGyZuNfkNOyDVpn3lNr32fD445swS99+eQQNz/R+JMPikIcIkzz1dzVe1QSNfDt0SP7 S1vKB0GOYzvy+8DfhOWMYnZa30LgmEgC4cDsBBh2f/iI63XRKwQNHbqlQCbEO5rN8BKA=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lKiOt-005i7P-IN for linux-f2fs-devel@lists.sourceforge.net; Fri, 12 Mar 2021 14:04:29 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7BAD064FFB; Fri, 12 Mar 2021 14:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615557850; bh=Z08KZd6XrMC6qRWdyb9R0p3Owz2c8ouzIqWGshwdS5Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vJE8acp0N06zbLPyerx23BzjyRy1DimyrdB/y9XdHQ+nQR0Jh0dZHJVWPdqJtJR1V fs65+hQUbaUrfleJ/Srfak8oSBFLXeEQ88fm0CdvIET/cI9thvVbsnJbCS93LRoziH YtXwJnQrNVNf4NDU1/Q/CoW5mwovfuLw5apyfsdk= Date: Fri, 12 Mar 2021 15:04:02 +0100 From: Greg KH To: Daeho Jeong Message-ID: References: <20210312122531.2717093-1-daeho43@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1lKiOt-005i7P-IN Subject: Re: [f2fs-dev] [PATCH v4] f2fs: add sysfs nodes to get runtime compression stat X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daeho Jeong , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Fri, Mar 12, 2021 at 10:56:13PM +0900, Daeho Jeong wrote: > Thanks for suggesting me sysfs_emit(). > > For atomic values, actually, those are needed for writer part, not reader. > > +#define add_compr_block_stat(inode, blocks) \ > + do { \ > + struct f2fs_sb_info *sbi = F2FS_I_SB(inode); \ > + int diff = F2FS_I(inode)->i_cluster_size - blocks; \ > + atomic64_add(blocks, &sbi->compr_written_block); \ > + atomic64_add(diff, &sbi->compr_saved_block); \ > + } while (0) > > I needed a protection here, because they might be updated in the race condition. Why? What are you trying to protect from "racing" here? thanks, greg k-h _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel