From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ey0-f177.google.com ([209.85.215.177]) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1P8Yk8-0000V2-Kp for linux-mtd@lists.infradead.org; Wed, 20 Oct 2010 13:30:13 +0000 Received: by eyf18 with SMTP id 18so525646eyf.36 for ; Wed, 20 Oct 2010 06:30:09 -0700 (PDT) Subject: Re: ubifs: sync() causes writes even if nothing is changed From: Artem Bityutskiy To: "Hans J. Koch" In-Reply-To: <20101013163005.GB1889@silverbox.local> References: <20101013163005.GB1889@silverbox.local> Content-Type: text/plain; charset="UTF-8" Date: Wed, 20 Oct 2010 16:26:58 +0300 Message-ID: <1287581218.9272.67.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Sebastian Andrzej Siewior , linux-mtd@lists.infradead.org, Adrian Hunter Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2010-10-13 at 18:30 +0200, Hans J. Koch wrote: > Running this command: > > # while true ; do sync; sleep 1; done > > causes two eraseblocks being erased every second, although there > are no writes to the ubifs filesystem. I hacked some printks into > my NAND driver that print page_address and column for each erase. > With that, I get this output every second: > > ... > [ 63.701765] erase p=0x0000ae40 c=0xffffffff > [ 63.706534] erase p=0xffffffff c=0xffffffff > [ 63.725492] erase p=0x0000ae80 c=0xffffffff > [ 63.730260] erase p=0xffffffff c=0xffffffff > ... > > From a quick glance at the ubifs code, this might come out of the > garbage collector that is triggered on every sync() and writes > something even if nothing has changed. > > Is that really needed? I briefly looked, and UBIFS is doing a lot of I/O in that case, which is unnecessary and should not be done, I'll need to investigate this. -- Best Regards, Artem Bityutskiy (Артём Битюцкий)