Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1265482pxf; Fri, 12 Mar 2021 06:05:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5wUWQhg3JpeqsMvxIT6I2DKpfHG/hwbdc1Fr7D7YqRpemHqMqSoWdtPatbIyD5lefZJ3D X-Received: by 2002:a5d:6a86:: with SMTP id s6mr14723357wru.307.1615557949151; Fri, 12 Mar 2021 06:05:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615557949; cv=none; d=google.com; s=arc-20160816; b=BWMAIf59b4tx3obBC4m+NDFIL/p69HmA6dlS05zAADenVYiPvndaZAKr5elePfPo15 p1W7y9CJ/+TLTLDVW9bDfL7Eiocf3ORDjd6rZ07EK+WYMd+/fE/FuOjXZKR5jJYa8mIT FIDaqQJPhQorIIc5JTGLGoT9X9iiFkutgf2q8GqwvS8BI7Rbo/KRsHSEt/+vI8q1XAGU krTxRHE2qpQflwd6NH0pBVBkcrcn6Q0aT55Dc49Zzy7z0Q82F7J/KvojZUTZc7vvzyo5 g5TWFJwX0iT3B2lhe9gFuZg3y5I7LdHoS4dE0wME50EM6qOdvc4Nqp7EMYVRyIxEoBRs CGew== 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; bh=QG6nGkZf4NuFjY4AOpFss6W+gTep3SauFypxHdCIQdw=; b=cmnjpeX83L0tNgV5HBhuiLOebdQKqUUh+yMt1hJZdaBkd8aMQhLFFAptVONiTiFH/b VGeXLdw8h37TMVMb7fLefAzKm7Wwhs55Fh5dgBiM+qnfezE3GGZ1oste3OaVnENzMW0o 5jSjjhC+6QJ+OwgOmMZIpJxESKNcZrE/qNk0NyXDEtQf+wOsfX6LmOFoAihBiVDp0GgD kPvz/P8VarXofirXNmSLG5XK7VU1f+GMrt8/DkMRiaaD6BMDAsuHJ6M/+RnFbzFlGCaf amsjfF/DwkG9ddpaGNY1z2AE0x35Y3MqAZKa4Jvi5Vk2U6C4BWcRrB6ppK6jZiGLszFR YxJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vJE8acp0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j20si4150438ejs.411.2021.03.12.06.05.17; Fri, 12 Mar 2021 06:05:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vJE8acp0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231519AbhCLOEU (ORCPT + 99 others); Fri, 12 Mar 2021 09:04:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:55806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbhCLOEK (ORCPT ); Fri, 12 Mar 2021 09:04:10 -0500 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 Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [PATCH v4] f2fs: add sysfs nodes to get runtime compression stat Message-ID: References: <20210312122531.2717093-1-daeho43@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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