From patchwork Thu Oct 7 07:49:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 67001 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from canuck.infradead.org (canuck.infradead.org [134.117.69.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 56C00B70AF for ; Thu, 7 Oct 2010 18:53:57 +1100 (EST) Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1P3lEd-0004iu-2c; Thu, 07 Oct 2010 07:49:51 +0000 Received: from gw1.transmode.se ([213.115.205.20]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1P3lEZ-0004iK-BC for linux-mtd@lists.infradead.org; Thu, 07 Oct 2010 07:49:48 +0000 Received: from sesr04.transmode.se (sesr04.transmode.se [192.168.201.15]) by gw1.transmode.se (Postfix) with ESMTP id E40752597D9 for ; Thu, 7 Oct 2010 09:49:44 +0200 (CEST) In-Reply-To: References: Subject: Re: JFFS2 very slow when erasing X-KeepSent: 2426448C:2DD5559B-C12577B5:002AC992; type=4; name=$KeepSent Cc: linux-mtd@lists.infradead.org X-Mailer: Lotus Notes Release 8.5.2 August 10, 2010 Message-ID: From: Joakim Tjernlund Date: Thu, 7 Oct 2010 09:49:44 +0200 X-MIMETrack: Serialize by Router on sesr04/Transmode(Release 8.5.2 HF23|September 01, 2010) at 2010-10-07 09:49:45 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20101007_034947_539365_E719CE4F X-CRM114-Status: GOOD ( 15.32 ) X-Spam-Score: 1.2 (+) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 1.2 MISSING_HEADERS Missing To: header X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org > With 2.6.35 JFFS2 takes a very long time cp files while it erases: > cp big_file test > rm test > cp big_file test > The last cp op. takes several times longer because JFFS2 is erasing. > Revering the patches I helped out with make JFFS2 go fast again: > jffs2: Stop triggering block erases from jffs2_write_super() > jffs2: Rename jffs2_erase_pending_trigger() to jffs2_dirty_trigger() > jffs2: Use jffs2_garbage_collect_trigger() to trigger pending erases > jffs2: Require jffs2_garbage_collect_trigger() to be called with lock held > jffs2: Wake GC thread when there are blocks to be erased > jffs2: Erase pending blocks in GC pass, avoid invalid -EIO return > > The final patches were somewhat different than the ones I originally wrote > and I THINK those didn't make JFFS2 go this slow. > > I suspect there is a locking problem somewhere. Commenting out this makes JFFS2 fast again: Seems to me that jffs2_garbage_collect_pass() is trying too much. David? Jocke diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index f5e96bd..bce3a30 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c @@ -213,7 +213,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) mutex_unlock(&c->alloc_sem); return ret; } - +#if 0 /* If there are any blocks which need erasing, erase them now */ if (!list_empty(&c->erase_complete_list) || !list_empty(&c->erase_pending_list)) { @@ -226,7 +226,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) D1(printk(KERN_DEBUG "No progress from erasing blocks; doing GC anyway\n")); spin_lock(&c->erase_completion_lock); } - +#endif /* First, work out which block we're garbage-collecting */ jeb = c->gcblock;