From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9532 invoked by alias); 19 Dec 2014 05:49:41 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19593 Received: (qmail 20477 invoked from network); 19 Dec 2014 05:49:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Date: Fri, 19 Dec 2014 06:24:16 +0100 From: meino.cramer@gmx.de To: zsh-users@zsh.org Subject: ZSH "killing" sdcard/flash memory... Message-ID: <20141219052416.GA4570@solfire> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: mutt-ng/devel-r804 (Linux) X-Provags-ID: V03:K0:a69MKN/BASKs/L22KD6cEUxXJ65D1Hk/2bfH/G3hrPBVJg10Vw9 mPZwFRGXCulHgFACONim75unRQwlWDASC7DtG4KjUGH/8eDG46ppkdkpDRZlR8sPwkmPyOn luIeOtlQwN9Osqj6sSepoZbVVUQOoad+p7XOvVfCU9qD509wcOW3135FzdyachX4/Dofgms OLHfmIPMVqt1986l/zxug== X-UI-Out-Filterresults: notjunk:1; Hi, I setup an embedded system (http://www.acmesystems.it/arietta) with Gentoo Linux and zsh (of course! :). The "harddisk" of this system is a sdcard (flash memory). The amount of write cycles to a flash memory is limited. Therefore one is interested in reducing unneccessary writes to the filesystem. I use ext4 (with journaling) with my Arietta G25 board, because powerfailure is more likely (battery powered) than with other systems. BUT: Logging /sys/fs/ext4/mmcblk0p2/session_write_kbytes shows that there were a greater amount of writes, even if the system was totally idle (I was logged in though, but doesn't touch the keyboard). I took me quite some time to figure out that the process "guilty" ;) for that was....zsh! Or better: The history mechanism of zsh. I temporarily switched off history writing and...no writes to the fs anymore. I think (read: I dont know for sure...:)) what happens is this: The actual process, which do the physical updates to the filesystem on the flash is call jbd2, which is the journal handling process of the kernel. Everytime something is happen to the filesystem this process keeps the journals up to date. The process, which triggers jbd2 "to do something" is the history mechanism of zsh. But I _NEED_ the history mechanism...I will get lost of it...or I have to write a ***lot*** more scripts...so switching it off is not a real alternative. Long story...short questions: What is it, what makes the history mechanism of zsh constantly "doing something" (closing/opening, writing, time stamping, etc...anything what is filesystem related) with the filesystem, even if there is no commandline to record? How can I switch that off without lossing the history mechanism itsselg? If it is "inside zsh" I would like to propose to make zsh more embedded-system-friendly by takeing flash memories in account. What do you think? Best regards, Meino