zsh-users
 help / color / mirror / code / Atom feed
From: meino.cramer@gmx.de
To: zsh-users@zsh.org
Subject: ZSH "killing" sdcard/flash memory...
Date: Fri, 19 Dec 2014 06:24:16 +0100	[thread overview]
Message-ID: <20141219052416.GA4570@solfire> (raw)

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





             reply	other threads:[~2014-12-19  5:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19  5:24 meino.cramer [this message]
2014-12-19  6:15 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141219052416.GA4570@solfire \
    --to=meino.cramer@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).