Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1554607pxb; Fri, 10 Sep 2021 08:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/Ikqn8MO1hGCMQicKsliUwGYHf/EiKJeV20RAANBlcxXdTf6QKDXMBrL70pHQO6L3oM1B X-Received: by 2002:a05:6638:cd:: with SMTP id w13mr5051513jao.42.1631287550169; Fri, 10 Sep 2021 08:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631287550; cv=none; d=google.com; s=arc-20160816; b=Iwg1Bfxdk3uuqUXBpYubiAI7/tzHTAtl9vBa7QcJqdfjNPBq4oDuH9bPnfU/2/YvYr LLIXSL93DNmX00OeFElWlBl2F9W0b2CVdpMpuLGCC8EInHy7o+fUGC2IpPgP80qayBr6 Ya/CnNWkZdwtaHGhh0M4Rm7kMuoALW4j7r2TLCd9FNBgEpkBoTl3AuEamdXqTHZWNVfF TJkVVMOnxoR0g1IYu07ZGDE1DiHQBuRFaFT+ePzlBxbpsyDmmOmXOloDIo16RPSdJ45z we8Pyu5B0Pzum7jHn8/kJG0UdAHExf+U3NHoIUrlCtE/Nu+3fJ8Lj6ViBQcaI17oye0I zKvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HZjKxxJhljDYpS5pxLUIvBKfKDGClyt9lfbrixdEiN4=; b=vm1LYXUYVZbbrDbnqBy7tbXv3SlS9GfrzAvL73c4g147kxFqlFeoFlLBQv1RaCap7K zl7j8cogkDkGnZOOZf3uAtR9krFBvIE/GeAdBeIezs9DT5h7AXv2RP/IdNvBj8936GNt 6lEa9t12aDg739q2PRzpbnfgj/2vZTL+IXdvwxNRl3KNOqK3G/LQU5jeoqTrovSP7yJ/ eP431pNweYF3dc5UNepQp8jPhTf38PvARuSEQF3yS82KE7rngkUXwHDWw4qVaUjUB78F IwWo9wTsnjsJMx3PXvMdAyMqwV6gn3iNYnkAu64Gd+DtISYAmCMSEXiAHZbhrkoN/gaT halw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CZk4eHjR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si4800601jaa.15.2021.09.10.08.25.37; Fri, 10 Sep 2021 08:25:50 -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=@gmail.com header.s=20210112 header.b=CZk4eHjR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234312AbhIJP0H (ORCPT + 99 others); Fri, 10 Sep 2021 11:26:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234130AbhIJP0G (ORCPT ); Fri, 10 Sep 2021 11:26:06 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A09F6C061574 for ; Fri, 10 Sep 2021 08:24:55 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id p15so3789247ljn.3 for ; Fri, 10 Sep 2021 08:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HZjKxxJhljDYpS5pxLUIvBKfKDGClyt9lfbrixdEiN4=; b=CZk4eHjRRB0S9IDx1rrvd74xMZaLkjNkabIbLnVpAD5dYl1SUSxOxZs+Yyz4LS2dMj 6Lfmu9lfrmJ+1/KsSIOPy5baFmFjfnMjUK+pW3Mi5+0/ifGafMfzw8iWZ/WSyX1DhB41 XNMftHbTzzlwa1mAJUW0m1RgL52Kcjg4K6MfALvHsiOUBVwDxbAXLzVR0/79zrqh9PGv 54UeGbiPKNYtvbZOzCcNhQYfxyJnFjO63aikC+ijKSjptGbD8qM2w6rU11pGccdhHaj+ zO+zDBFqNNMGU/T8DfCmQgXhNUVggWpq6+GIpAWQRJbh9zZlVom1NUGPKUp7hmWqYJUu f94Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HZjKxxJhljDYpS5pxLUIvBKfKDGClyt9lfbrixdEiN4=; b=4fTpjFY1cutriv2dzSkjfV75rkghdgGzpRW1in6JywFLLxg6bKDlKzenhLxwyYM0fm 2y6T2W8JrQb6MeWI3HupqvxShmmj8OFMfLW8mTahZP+r/RbpdHHzWO+MVcMzKXn0w1Wd 6gv6JOLE0MiWhFNihcCDpaQWk8Nxrwbe14DRD/qmD/oK5H7ayEEwLsVVLv/JpjDP3Adc Fi9B9MhNObB1n58bdxzwgMpYu6JoDBfmFIJflmvoWydLTDoA0q7uQHRDS3P3nYEyTwO5 kC41jt+nKL/XbvJu0Ruwx6v5CzL9V2vJjLwtJ8CCwRZTubm/UUVZWy3pLHpMSZ+0z80o O4Vw== X-Gm-Message-State: AOAM530dC3rA8TSgqvn+FFbKCF3vm2Pj5x+3fp5WOxg64hz1WePx43pb 3yls6PIX2bed6MNYTbFmU9a6GgSb+R8vB+j1PW4= X-Received: by 2002:a05:651c:88e:: with SMTP id d14mr4541154ljq.472.1631287493966; Fri, 10 Sep 2021 08:24:53 -0700 (PDT) MIME-Version: 1.0 References: <20210902172404.3517626-1-daeho43@gmail.com> <9ab17089-accc-c3a3-a5dc-007fc4eeaa20@kernel.org> <8f8e4695-4062-60c4-0f91-2a1f6a5b0a11@kernel.org> In-Reply-To: From: Daeho Jeong Date: Fri, 10 Sep 2021 08:24:42 -0700 Message-ID: Subject: Re: [f2fs-dev] [PATCH v4] f2fs: introduce fragment allocation mode mount option To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021 at 7:34 AM Daeho Jeong wrote: > > On Thu, Sep 9, 2021 at 4:50 PM Chao Yu wrote: > > > > On 2021/9/8 2:12, Daeho Jeong wrote: > > > On Fri, Sep 3, 2021 at 11:45 PM Chao Yu wrote: > > >> > > >> On 2021/9/4 12:40, Daeho Jeong wrote: > > >>>> As a per curseg field. > > >>>> > > >>>>> Maybe, we run into the same race condition issue you told before for > > >>>>> fragment_remained_chunk. > > >>>>> Could you clarify this more? > > >>>> > > >>>> e.g. > > >>>> > > >>>> F2FS_OPTION(sbi).fs_mode = FS_MODE_FRAGMENT_FIXED_BLK > > >>>> fragment_chunk_size = 384 > > >>>> fragment_hole_size = 384 > > >>>> > > >>>> When creating hole: > > >>>> > > >>>> - f2fs_allocate_data_block > > >>>> - __refresh_next_blkoff > > >>>> chunk locates in [0, 383] of current segment > > >>>> seg->next_blkoff = 384 > > >>>> sbi->fragment_remained_chunk = 0 > > >>>> then we will reset sbi->fragment_remained_chunk to 384 > > >>>> and move seg->next_blkoff forward to 768 (384 + 384) > > >>>> - __has_curseg_space() returns false > > >>>> - allocate_segment() allocates new current segment > > >>>> > > >>>> So, for such case that hole may cross two segments, hole size may be truncated > > >>>> to left size of previous segment. > > >>> > > >>> First, sbi->fragment_remained_chunk should be seg->fragment_remained_chunk. > > >> > > >> Oh, correct. > > >> > > >>> I understand what you mean, so you mean we need to take the leftover > > >>> "hole" size over to the next segment? > > >>> In the example, the leftover hole size will be (384 - (512-384)). Do > > >>> you want to take this over to the next segment? > > >> > > >> Yes, the left 256 block-sized hole should be created before next chunk > > >> in next opened segment. > > >> > > > > > > Chao, > > > > > > Do you have any decent idea to pass the left hole size to the next > > > segment which will be allocated? > > > > Daeho, > > > > I guess we can record left hole size in seg->fragment_remained_hole. > > > > I understand we need a new fragment_remained_hole variable in segment structure. > But, I mean.. How can we pass over the left hole size from the > previous segment to the next segment? > I mean we don't know which segment will be the next segment, do we? > Thanks, > > > Thanks, > > > > > > > > Thanks, > > > > > >> Thanks, > > >> > > >>>