Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1807469pxb; Fri, 20 Aug 2021 14:44:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIqilEcuIl5e34JP96k5Ovv0SX+nYdWZS+65MXckYlNpPAobULNVUd0ke/7QYFMUIePuJu X-Received: by 2002:a17:907:2458:: with SMTP id yw24mr5886832ejb.326.1629495888176; Fri, 20 Aug 2021 14:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629495888; cv=none; d=google.com; s=arc-20160816; b=XqAlu2qiqs3YbmG25Z7UMof6LjVcOTsKa0azZsK4xTFYT64Li4DN0zSko6yYY64Vv2 5Y6CDkRTf5gj5fTgyLKj4hkLH1xF92SqKYSJ8/4SJitoT73wGe1+3lC5krfThmtb7mVV DJbC4fmH6Ja09UnNedlLriyOJoYeTL15B0Ahc+FDo8r9YLtx3EQCBd+U3HGydcq5yjRp icyr0Czbeb18BVqESjKqm7mk4Rp/KrqW+vYKwUqJ0Z+8ClsFRcbbcvWMiCWc9o/2x33J nDI+skeJlhi326sjHq02IkxhRiTchuB5TJq9kHVJui3hYWcPk3o7ToOMX9l3hbg89lch pehw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=f57ZfxUqHV3Q/9Rbgs+TIOZPYVclQWWPt+ChFjdVNxc=; b=oiMmc5iu06lnxU2gXYrzd7sK8dMaIZI0nwHQpeazTAWH4qrbHZCgA/HE/TElb7w1V5 7LqzfLZG3AAX/nDgXMKd11RrpQx7iqzyZPEvH0kx3n/mT6MYB8Pc2ob1ePd6ipqRhw12 B4CVw3f96GH9HlVdSpQaaN69YdKem0zhVh7TKuWrbPnkwfLE+6WsvNHXmPYZOZBLvuBV U6nPFZW2YT3rHKwARHK8lYjbKfPthS/EFYcFHm0zkFruTYRa+UwyWMgAG3uvAIQVr2+v 9PSyc20G7Wky/mk39R6agZ4I9Uj7JsNEq/xQ/B8T43BGMU13rzndKbdKz55V0p/dSwaP 4kOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YKxJxyEK; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si873442edd.226.2021.08.20.14.44.23; Fri, 20 Aug 2021 14:44:48 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=YKxJxyEK; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231450AbhHTVmS (ORCPT + 99 others); Fri, 20 Aug 2021 17:42:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:33536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbhHTVmR (ORCPT ); Fri, 20 Aug 2021 17:42:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5EFBE6115A; Fri, 20 Aug 2021 21:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629495699; bh=Hcyczx0dUv6OOPsK53/cEFLZyL+VYmXz7Ndl9CnAKy0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=YKxJxyEKRrHb/B3gpyM+AT6e+2qO6u2bTONGLcP4ZizlmXZ0MqbDuMVEECgT9VD2y p7p4d1hu5PZrSB87avSQ2kGofxgkt5vLjs3hjdyCMy5pycJJoj0yLWbdZyqXNaeBtd lqVlodVvm/czeHtMrXdyrmQSwGDPiBHcrvwLkkIsJFwt4aUyKwzHVj0QpCgnJKo9XQ 4Q4wtyjDXvcoPaxxKkQmGRiuLig9OfT6c0eiCasAFaR1yGBthXFe68bF0VHgpFvuFk ibHyfPhxMVRFRAnfdn/DNWN2VLeODJ6O3N7wHkWQjIeclfx1PI1fBeiBX6JtpAdBo8 q5aB9Vd5qELNw== Subject: Re: [f2fs-dev] [PATCH v4 2/2] f2fs: introduce periodic iostat io latency traces To: Daeho Jeong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong References: <20210820035229.216975-1-daeho43@gmail.com> <20210820035229.216975-2-daeho43@gmail.com> <48725f58-1a48-73f3-80cf-a0c5efc3b470@kernel.org> From: Chao Yu Message-ID: Date: Sat, 21 Aug 2021 05:41:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/8/20 23:23, Daeho Jeong wrote: > On Fri, Aug 20, 2021 at 3:50 AM Chao Yu wrote: >> >> On 2021/8/20 11:52, Daeho Jeong wrote: >>> +void iostat_update_and_unbind_ctx(struct bio *bio, int rw) >>> +{ >>> + struct bio_iostat_ctx *iostat_ctx = bio->bi_private; >>> + int sync_type = bio->bi_opf & REQ_SYNC ? 0 : 1; >> >> int sync_type = bio->bi_opf & REQ_SYNC ? 1 : 0; >> >> Right? > > This means just type, not boolean number. So, I set type 0 is sync and > type 1 is async. How about changing this to is_sync or similar name of bool type variable? > >> >>> int f2fs_init_iostat(struct f2fs_sb_info *sbi) >>> { >>> /* init iostat info */ >>> spin_lock_init(&sbi->iostat_lock); >>> + spin_lock_init(&sbi->iostat_lat_lock); >>> sbi->iostat_enable = false; >>> sbi->iostat_period_ms = DEFAULT_IOSTAT_PERIOD_MS; >>> + sbi->iostat_io_lat = f2fs_kzalloc(sbi, sizeof(struct iostat_lat_info), >>> + GFP_KERNEL); >>> + if (!sbi->iostat_io_lat) >>> + return -ENOMEM; >> >> What do you think of just embedding iostat_io_lat structure into f2fs_sb_info >> structure? it's minor thing though. >> > > I also wanted to do that, but if we embed this type, we need to define > that structure in f2fs.h file. > Is it okay with you? Oh, correct, it will be more appropriate to define the structure in iostat.h. Is it fine to just use memset(io_lat, 0, sizeof(struct iostat_lat_info)) to reset all fields in f2fs_reset_iostat()? Thanks, > >> Thanks,