From: Norbert van Bolhuis <nvbolhuis@aimvalley.nl>
To: dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org, joakim.tjernlund@transmode.se
Subject: Re: a UBIFS image makes task pdflush blocked > 120 seconds
Date: Tue, 17 Nov 2009 17:25:42 +0100 [thread overview]
Message-ID: <4B02CE86.5000908@aimvalley.nl> (raw)
In-Reply-To: <1258446318.27437.60.camel@localhost>
I tested all mentioned solutions. It turns out only the "erase-suspend option"
helps.
lowering the UBI BG task priority somehow causes the application to block until
the UBI BG task finishes erasing *all* NOR blocks. I guess the application is blocked
in get_chip and never gets activated by the scheduler.
I do not understand why this happens. How can a lower UBI BG prio make the application
block for so long ?
Maybe I implemented it wrong, I added line 1359.
1354 int ubi_thread(void *u)
1355 {
1356 int failures = 0;
1357 struct ubi_device *ubi = u;
1358
1359 set_user_nice(current, 19);
1360
1361 ubi_msg("background thread \"%s\" started, PID %d",
1362 ubi->bgt_name, task_pid_nr(current));
I did see the ubi_bg prio = 139 (lowest possible prio), it used to be 115.
I also tried 135, same result.
Anyway, this doesn't seem to work.
Using yield() in the UBI BG task doesn't seem to do much. It for sure doesn't cause
the application to become active after a (couple of) erase operations. The log shows:
LE:0197, TIME=0026.276, pid=0918, M(xy=00)=do_erase_oneblock, START
LE:0198, TIME=0026.868, pid=1237, M(xy=04)=commit_semR, make_reservation, Req DOWN 1
LE:0199, TIME=0026.868, pid=1237, M(xy=05)=commit_semR, make_reservation, DOWN 1
LE:0200, TIME=0026.868, pid=1237, M(xy=02)=io_mutex, reserve_space, Req LOCK 1
LE:0201, TIME=0026.868, pid=1237, M(xy=03)=io_mutex, reserve_space, LOCK 1
LE:0202, TIME=0027.104, pid=0918, M(xy=01)=do_erase_oneblock, END
LE:0203, TIME=0027.104, pid=0918, M(xy=0c)=yield
LE:0204, TIME=0027.104, pid=0918, M(xy=00)=do_erase_oneblock, START
LE:0205, TIME=0027.876, pid=0918, M(xy=01)=do_erase_oneblock, END
LE:0206, TIME=0027.876, pid=0918, M(xy=0c)=yield
LE:0207, TIME=0027.876, pid=0918, M(xy=00)=do_erase_oneblock, START
LE:0208, TIME=0028.672, pid=0918, M(xy=01)=do_erase_oneblock, END
LE:0209, TIME=0028.672, pid=0918, M(xy=0c)=yield
<omitted many do_erase_oneblock END/START + yield entries>
LE:0294, TIME=0051.132, pid=0918, M(xy=00)=do_erase_oneblock, START
LE:0295, TIME=0051.944, pid=0918, M(xy=01)=do_erase_oneblock, END
LE:0296, TIME=0051.944, pid=0918, M(xy=0c)=yield
LE:0297, TIME=0051.944, pid=0918, M(xy=00)=do_erase_oneblock, START
LE:0298, TIME=0052.080, pid=0108, M(xy=04)=commit_semR, make_reservation, Req DOWN 1
LE:0299, TIME=0052.080, pid=0108, M(xy=05)=commit_semR, make_reservation, DOWN 1
LE:0300, TIME=0052.080, pid=0108, M(xy=02)=io_mutex, reserve_space, Req LOCK 1
<omitted many do_erase_oneblock END/START + yield entries>
LE:0405, TIME=0080.652, pid=0918, M(xy=00)=do_erase_oneblock, START
LE:0406, TIME=0081.536, pid=0918, M(xy=01)=do_erase_oneblock, END
LE:0407, TIME=0081.536, pid=0918, M(xy=0c)=yield
LE:0408, TIME=0081.536, pid=0918, M(xy=00)=do_erase_oneblock, START
LE:0409, TIME=0082.332, pid=0918, M(xy=01)=do_erase_oneblock, END
LE:0410, TIME=0082.332, pid=0918, M(xy=0c)=yield
LE:0411, TIME=0082.332, pid=1237, M(xy=06)=io_mutex, release_head, Req UNLOCK
LE:0412, TIME=0082.332, pid=0108, M(xy=03)=io_mutex, reserve_space, LOCK 1
LE:0413, TIME=0082.332, pid=0108, M(xy=06)=io_mutex, release_head, Req UNLOCK
LE:0414, TIME=0082.332, pid=0108, M(xy=07)=io_mutex, release_head, UNLOCK
LE:0415, TIME=0082.332, pid=0108, M(xy=08)=commit_semR, finish_reservation, Req UP
LE:0416, TIME=0082.332, pid=0108, M(xy=09)=commit_semR, finish_reservation, UP
As can be seen it still takes ~ 55 seconds before the application (pid=1237) and pdflush
(pid=0108) can continue.
Using the erase-suspend feature works great. The application creates and writes
files without any delay. pdflush isn't delayed either.
The difference is that the UBI BG thread erased only 200 blocks after our application
is completely up and running while this used to be ~ 1000. This is as expected and
a logical consequence of the erase-suspend.
So as far as I'm concerned this problem has been solved. I'm gonna use the
erase-suspend feature in the way Joakim suggested.
I will do a few additional erase-suspend related tests (since it looks like I'm one of the
first users for cmdset_002) and report problems to this list (as usual).
thanks for all help.
Norbert.
next prev parent reply other threads:[~2009-11-17 16:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4B012D0D.4080500@aimvalley.nl>
2009-11-16 12:12 ` a UBIFS image makes task pdflush blocked > 120 seconds Joakim Tjernlund
2009-11-17 8:25 ` Artem Bityutskiy
2009-11-17 16:25 ` Norbert van Bolhuis [this message]
2009-11-18 8:28 ` Artem Bityutskiy
2009-11-18 9:26 ` Norbert van Bolhuis
2009-11-18 9:40 ` Artem Bityutskiy
2009-11-18 10:38 ` Joakim Tjernlund
2009-11-18 10:54 ` Artem Bityutskiy
2009-11-18 10:59 ` Norbert van Bolhuis
2009-11-18 11:01 ` Joakim Tjernlund
[not found] <34637.10.10.0.184.1258202287.squirrel@intranet.aimsys.nl>
2009-11-16 8:13 ` Artem Bityutskiy
2009-11-16 8:53 ` Joakim Tjernlund
2009-11-16 23:22 ` Jamie Lokier
2009-11-17 8:31 ` Joakim Tjernlund
2009-11-17 10:45 ` Norbert van Bolhuis
2009-10-09 13:02 Norbert van Bolhuis
2009-10-11 13:52 ` Artem Bityutskiy
2009-10-12 10:09 ` Norbert van Bolhuis
2009-10-14 8:56 ` Artem Bityutskiy
2009-11-11 15:54 ` Norbert van Bolhuis
2009-11-13 8:20 ` Artem Bityutskiy
2009-11-13 15:09 ` Norbert van Bolhuis
2009-11-13 15:52 ` Artem Bityutskiy
2009-11-13 15:56 ` Artem Bityutskiy
2009-11-13 16:28 ` Joakim Tjernlund
2009-10-11 14:04 ` Artem Bityutskiy
2009-10-11 14:09 ` Artem Bityutskiy
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=4B02CE86.5000908@aimvalley.nl \
--to=nvbolhuis@aimvalley.nl \
--cc=dedekind1@gmail.com \
--cc=joakim.tjernlund@transmode.se \
--cc=linux-mtd@lists.infradead.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.