From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756915Ab1LBPpe (ORCPT ); Fri, 2 Dec 2011 10:45:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36239 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754424Ab1LBPpd (ORCPT ); Fri, 2 Dec 2011 10:45:33 -0500 Message-ID: <4ED8F294.1010500@redhat.com> Date: Fri, 02 Dec 2011 09:45:24 -0600 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Kyungmin Park CC: Lukas Czerner , tytso@mit.edu, tm@tao.ma, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Set the initial TRIM information as TRIMMED References: <20111201070052.GA29708@july> <4ED7FA81.9090802@redhat.com> In-Reply-To: X-Enigmail-Version: 1.3.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/1/11 6:01 PM, Kyungmin Park wrote: > On 12/2/11, Eric Sandeen wrote: >> On 12/1/11 1:00 AM, Kyungmin Park wrote: >>> From: Kyungmin Park >>> >>> Now trim information doesn't stored at disk so every boot time. it's >>> cleared. >>> and do the trim all disk groups. >>> But assume that it's already trimmed at previous time so don't need to >>> trim it again. So set the intial state as trimmed. >>> >>> Signed-off-by: Kyungmin Park >>> --- >>> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c >>> index e2d8be8..97ef342 100644 >>> --- a/fs/ext4/mballoc.c >>> +++ b/fs/ext4/mballoc.c >>> @@ -1098,6 +1098,12 @@ int ext4_mb_init_group(struct super_block *sb, >>> ext4_group_t group) >>> goto err; >>> } >>> mark_page_accessed(page); >>> + >>> + /* >>> + * TRIM information is not stored at disk so set the initial >>> + * state as trimmed. Since previous time it's already trimmed all >>> + */ >>> + EXT4_MB_GRP_SET_TRIMMED(this_grp); >> > Hi, > >> Hm, so if there were freed but un-trimmed blocks at this point, we will >> never trim them until we free _another_ block in the group, right? That >> might be a reasonable tradeoff, but it is somewhat surprising behavior. >> >> i.e. say we do: >> >> mount /mnt >> rm -rf /mnt/very_big_file >> umount /mnt >> >> mount /mnt >> fitrim /mnt > another word, you can run fitrim after rm -rf > yes, it's trade-off. > > In my case, phone scenario, no umount system and data partition. it's > burden to trim at boot time. it has still slower boot time. > some daemon or program run fitrm at filesystem. it consumes time and > hurt other boot processes. Why not just do smaller FITRIM commands in the background while the phone is running? Why do you want to trim the whole fs at boot time in the first place? -Eric