Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp789623pxb; Fri, 3 Sep 2021 13:35:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+d4Hw6P45O2BZXNlDV9Sf7yOXo6nfueW6qQM/35dgrKHFp9IgyclO7ZSY8YIUG4KtmCjf X-Received: by 2002:a17:906:3bc1:: with SMTP id v1mr736511ejf.182.1630701318364; Fri, 03 Sep 2021 13:35:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630701318; cv=none; d=google.com; s=arc-20160816; b=NkPbQ8S3WZ1Dmcz55xBtHY2t5Fgq6RFMy12CCuqLIuNf1FUDnU6xidJD2CoZKGu1wd g0JhiFhP1iUBombpelfHpzDkkk49Vteg9vESL9xKKGLHO+5ultLuaHdJwpaOknq5X3aq K0IVBfIZyr7Ie9wvJ+K2N3zyTSTrDojJcOiSxOEBt2P3bWd1Xq8ebmUky+32csakCmJ3 WZ3tq2R5H21M0vcDzBkA4THVONgOBrRITjwVo2mRtQGIFgjxXuW0Bog8x1Ch39QQ5QM8 xeGjdlVeXDmBBn+w5YNI2FxbNWkugEAmEaz1C6AcA0ZZRUcKLNfLcAB4RpeVkbaFLNM4 544Q== 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=vIdOCwskLhI0m4Y2FZRTnOUO+8ZEDMLcxJfUG+PYvsE=; b=baYIX0gHEyu7mICipUXYuWKQm8hPucdFVGu92KzYtTTLCAOVpIpxJlBwtU8Z7VHkJH nzXQ+v+NvU5uxgYaQV5iGzAGxibSa1ABMUhkrqviyDlFrQlqfXaV4JBlS5YX+NCYXF7w 9hvxD3Cfp/sfjdXw3eHPO9IJJFqK80sKLhMFtayGptX4ZNdT39rqEdR+cUzLROIHEvqR 5hPeSXPpcRDHgbIWdWuXOJvqA0uTDT7WN5yuqrcynTBwRy7WvLttp8tEFmMyH9k7qICX XW84cxI+I+jMwQpzQI4qIqBgu/nA8C3KOC2qyYN6vkgWATQRU0Z8ntGrJ6ad8igeA4GQ 7/1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=elj3tFd6; 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 g20si219643ejt.393.2021.09.03.13.34.54; Fri, 03 Sep 2021 13:35:18 -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=elj3tFd6; 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 S236039AbhICUeY (ORCPT + 99 others); Fri, 3 Sep 2021 16:34:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236047AbhICUeY (ORCPT ); Fri, 3 Sep 2021 16:34:24 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA234C061575 for ; Fri, 3 Sep 2021 13:33:23 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id l18so619294lji.12 for ; Fri, 03 Sep 2021 13:33:23 -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=vIdOCwskLhI0m4Y2FZRTnOUO+8ZEDMLcxJfUG+PYvsE=; b=elj3tFd6Azm9vkuRGF+FrmR71fOH2ItuvYsMvpUWC4tTW+kE9P9mmsuv21eqppFMNT OVOeJXFeNwUr1u4luok6uLL6cLGY45GR0Uo54NN8xZs0s2622ASNm0G2rjlW8mGOI5RB bDAq4/XAt2wl3feYfbjdMrARbuXCN3pOs/p3pO5Ju2RIysueURvBes8LXn9z1ogrCv2i 7IuS/nyX5ebUC5BKHYXO1YTTkzTqehPTere1t8wl57nl6YAm0isSNrR+lhanyaUVzWaY cOqSwCiSO3wvalKuTPcXQl4gcVjT9PqmNUgwG0gM0FcJ3t1sX4lW9bHNNuLrsFf2zjTQ n+3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vIdOCwskLhI0m4Y2FZRTnOUO+8ZEDMLcxJfUG+PYvsE=; b=VbZOE4rixaH1SinYjv6/9opI0yTgul6gKmQIoFmxkyFy+jt/qzk0bgBmJwlw+jhism 1Rr7m33PHCRrJXuKepq4n+h3pblcUOSjWrLBLSJww9xv80QzPo3Vjrt73lQ0Q7HC6QuP Q+Ah1iIoDAM0nhvnGt/Nhmg2J4g21Pr7Uk+H1TMHFYmJiT+uAXhcN+kR+VJONh3QuI2+ 1p9vMApu35nPcYj8uLhNYRJsnS6H3QyLNkziG5MY+Hemj2yAb+Y3XM2gQB7cYt2gCeuD tDSZLoiufIGw2vSIzsKW1n5IbIdNlUg4/87w7e5mrjzWIaopaLhqxlPWYUBXJnfVPi8K RSeg== X-Gm-Message-State: AOAM533xe49cSBAUpvilzmVIT1zH2xWDsvsoHLgELSsd3n1Pmf9qHkUk NCTNM/vnQ7BRj/Rmd2YBK1a+oS4w3TX9iuqbUjF6OpSD14PYtA== X-Received: by 2002:a2e:6c09:: with SMTP id h9mr577564ljc.30.1630701202021; Fri, 03 Sep 2021 13:33:22 -0700 (PDT) MIME-Version: 1.0 References: <20210902172404.3517626-1-daeho43@gmail.com> <9ab17089-accc-c3a3-a5dc-007fc4eeaa20@kernel.org> In-Reply-To: <9ab17089-accc-c3a3-a5dc-007fc4eeaa20@kernel.org> From: Daeho Jeong Date: Fri, 3 Sep 2021 13:33:11 -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 > if (f2fs_need_seq_seg(sbi)) > return 0; > > static inline bool f2fs_need_seq_seg(struct f2fs_sb_info *sbi) > { > return F2FS_OPTION(sbi).fs_mode == FS_MODE_FRAGMENT_FIXED_BLK; > } > Do you need this in select_policy(), either? Like, if (f2fs_need_rand_seg(sbi)) p->offset = prandom_u32() % (MAIN_SECS(sbi) * sbi->segs_per_sec); else if (f2fs_need_seq_seg(sbi)) p->offset = 0; > One more concern... we'd better to save fragment_remained_hole as well > as fragment_remained_chunk, otherwise, if fragment_chunk_size + > fragment_hole_size > 512, fragment hole will be truncated to 512 - > fragment_chunk_size due to we won't create hole with enough size as > seg->next_blkoff has crossed end of current segment. > Sorry, I don't get it. You mean making fragment_remained_hole as a global variable? Maybe, we run into the same race condition issue you told before for fragment_remained_chunk. Could you clarify this more? Thanks,