Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp520946lqb; Wed, 29 May 2024 02:57:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQIQVDwW9obxxhhg1RG1ATInME8vZa/bp9uC6lsdQ0gAZZcz/34KGgwUpC36HZHmHjkXpBJX8/1yvRNfYA6nurcavscSlo58Qo52LMtQ== X-Google-Smtp-Source: AGHT+IH5v6yNULT+7MhDJKnXvW018LZpxDzD47FyQ2NjaPJwiMHT0Z8aGJzknixT6rnT7C71RJLH X-Received: by 2002:a05:6358:2802:b0:199:48cf:99df with SMTP id e5c5f4694b2df-19948cfa405mr15055655d.31.1716976661314; Wed, 29 May 2024 02:57:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716976661; cv=pass; d=google.com; s=arc-20160816; b=WDpg8RK8Qv/DuE4lKIeA0b0dvVVyVS9Bglt9wvP8jHoCnVYGe06/KrgDnNJIKC3j+O VttSzkdRyOIFlYSITPb5eB4T1d9JZHcZsWRwf3U77wcfiM3cdRMgwYLbDCUamMH+OCv1 ehBJx4otV46CCWp8K4KhIaHSIVQYRwD9ca2FOXjwdXWsiE1NKDuYYVJgQBfxoROTrjBX ZbZM4BglRNjEMwRoVspcy3YaJhQpq0RAzB5YDhLIdzWqH5UIeItoD3AJmMTxUBNjwZ1Q /ilUkB/ai5beTwxENYSWhf4TLubddk8BBLm1SYk4EDgP7BA6dcnzScefOHWa/QvFJL3y o5sA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=4dULGHIJA2ySiW/+NDqhJaTVkfHHpiB74jz924iY4K0=; fh=Y5STH6ZohoUrWzNjspW3lGmQG8T+8musvCTlET9qHxc=; b=v8wjbM4DMukM9hq6xluhByiHl1S2lUOrR2XxAd61vFHYQmjgyTlXy3oJmKKkcBWvC/ pcrp3qun0Jv8FvozC+2fJPlocTvjnw8WkabHGh/YXfZ9O2yRLlf9O9WG0MiD0k5lN6Zl pOweJJjc+aLDlYeqh0s5mX4uME2NYmB+1nfOifWxe0UIovxUz27GIfPueqQ3LqZCKcsf 7N14AF/Uae/82OrytTlI3LAiCxeKWMvEkthawFuy2sjn5PUCtArT6IgK7rZmTM6qL6vv 7Fzk9q3CPAWOOk19JqXhtVlIrq3D/Px9B5BoJrQA6zx3v7gG/NsY39Qw1ZhtmeEVnxUZ R++w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SVhPXxqk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-193898-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193898-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-68222ea6347si9803166a12.247.2024.05.29.02.57.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 02:57:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193898-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SVhPXxqk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-193898-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193898-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DFDDF284FCB for ; Wed, 29 May 2024 09:57:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BFD8C16EBE7; Wed, 29 May 2024 09:57:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SVhPXxqk" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC9FC16A360 for ; Wed, 29 May 2024 09:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716976655; cv=none; b=dGGStKPTmUA3VVpBjJEro4SUlJ2EZWbwBvL0Q9Io/YSiH1X0L+pCZSXqJU6UrfdyjA4eiwgN6kXTy/fFNef/tFRudylhB60ANJ8vsfmVAhJ9M610F84nT9/vMKpHaZU2cVEJZQ1SLjHRJ0CtqLYdcdJw3eZJjbtLoHykwZCf3nY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716976655; c=relaxed/simple; bh=6XgEyPsEN2NFoJlrtqnjT0UAsnXAycD0xgXGpmhOtc0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=vCBpo0YjfrbdNQ38MaeY70btbShbhbYC8Qt7bWSBenbcZRZ7ZmRtCIzCDApElSqRF6cO9deOCuK1GFQKyGy29HmYFI3zYEfKtI8neSq51GI8Fluk+663K3qX/e+Q9HFdaXKTtpjSmwBUcmoGxhyzJVROGM3P6jLvXQWOoaNHJVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SVhPXxqk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE548C32786; Wed, 29 May 2024 09:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716976654; bh=6XgEyPsEN2NFoJlrtqnjT0UAsnXAycD0xgXGpmhOtc0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SVhPXxqkJ5iR85XHhjMyba0+veN+xlnvqZa+qCAzsIptXQyKKftc9Y65yuALp0f81 I63nHeQrHyNb8jqIgbfNtleyQHR3S2IT12R8N2cmJ34u2bve/jKSB/F1tjOu/6lPHU 5zaI5Owq88NkMMTglLDHon/Ftk/8zaIetimTAL506CD6L8US8qAEoGTuMzxtPxyH7s ZCYrOlnOrOM7MVwFjBFdiP+gVZQnOsED36Mt7GmZ7kk8ibouRzfHTzoXVlJaBKl/qx lGSXtZbzWGd9Ma56jSnm1eN69DZeUqefSU3NKaIQxhxLR1n0lf/9amdjkYgT2TQV8H Ns3vQOWIGQZCw== Message-ID: <19f53d36-0415-4b34-9b6b-e28ea19a44f0@kernel.org> Date: Wed, 29 May 2024 17:57:30 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] f2fs: fix to avoid use SSR allocate when do defragment To: Zhiguo Niu , jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, niuzhiguo84@gmail.com, ke.wang@unisoc.com, Hao_hao.Wang@unisoc.com References: <1716976020-28757-1-git-send-email-zhiguo.niu@unisoc.com> Content-Language: en-US From: Chao Yu In-Reply-To: <1716976020-28757-1-git-send-email-zhiguo.niu@unisoc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/5/29 17:47, Zhiguo Niu wrote: > SSR allocate mode will be used when doing file defragment > if ATGC is working at the same time, that is because > set_page_private_gcing may make CURSEG_ALL_DATA_ATGC segment > type got in f2fs_allocate_data_block when defragment page > is writeback, which may cause file fragmentation is worse. > > A file with 2 fragmentations is changed as following after defragment: > > ----------------file info------------------- > sensorsdata : > -------------------------------------------- > dev [254:48] > ino [0x 3029 : 12329] > mode [0x 81b0 : 33200] > nlink [0x 1 : 1] > uid [0x 27e6 : 10214] > gid [0x 27e6 : 10214] > size [0x 242000 : 2367488] > blksize [0x 1000 : 4096] > blocks [0x 1210 : 4624] > -------------------------------------------- > > file_pos start_blk end_blk blks > 0 11361121 11361207 87 > 356352 11361215 11361216 2 > 364544 11361218 11361218 1 > 368640 11361220 11361221 2 > 376832 11361224 11361225 2 > 385024 11361227 11361238 12 > 434176 11361240 11361252 13 > 487424 11361254 11361254 1 > 491520 11361271 11361279 9 > 528384 3681794 3681795 2 > 536576 3681797 3681797 1 > 540672 3681799 3681799 1 > 544768 3681803 3681803 1 > 548864 3681805 3681805 1 > 552960 3681807 3681807 1 > 557056 3681809 3681809 1 > > Signed-off-by: Zhiguo Niu Reviewed-by: Chao Yu Thanks,