public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Dave Ellis <DGE@sixnetio.com>
Cc: "'joakim.tjernlund@lumentis.se'" <joakim.tjernlund@lumentis.se>,
	linux-mtd@lists.infradead.org
Subject: Re: Disk blocks for long periods
Date: Wed, 07 Aug 2002 12:11:06 +0100	[thread overview]
Message-ID: <7780.1028718666@redhat.com> (raw)
In-Reply-To: <00512BA4F9D3D311912A009027E9B8F407E474@NT>

DGE@sixnetio.com said:
> The cfi_udelay() call is part of the problem, since it lets other
> processes run, and the one that runs is the erasing process, but it
> can't do anything except slow things down since the flash  is busy
> writing.

The erasing process should be sitting in TASK_UNINTERRUPTIBLE and on the 
chip's wait queue, waiting to be woken when the chip becomes available. Why 
is it running?

> What the erasing process does seem to do (and  I don't understand why)
> is cause current->need_resched to be set for every call to
> cfi_udelay(), so it calls schedule_timeout(1)  and sleeps for a whole
> jiffie. 

Sleeping for a whole jiffie is bad. We should udelay() and yield() as you 
point out; there's no reason to use schedule_timeout() and hence stop 
ourself from being woken immediately if there's not really anything else to 
run. I've committed that change to CVS.

I don't understand why need_resched is being set either, though. 

Adding cfi_udelay() to do_write_oneword() is dangerous. You may trigger a
bug that's actually already there. ISTR there's a time limit on the 'unlock
bypass' mode, and if you schedule() you may find that the chip is no longer 
in that mode when you return.

Another thing you might want to do if you really care about write 
performance is copy the logic for calculating word_write_time from the 
cfi_cmdset_0001 driver.

--
dwmw2

  parent reply	other threads:[~2002-08-07 11:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-06 14:53 Disk blocks for long periods Dave Ellis
2002-08-06 15:09 ` Joakim Tjernlund
2002-08-07 11:11 ` David Woodhouse [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-08-07 16:42 Dave Ellis
2002-08-08  7:08 ` Joakim Tjernlund
2002-08-08  8:08   ` David Woodhouse
2002-08-08  9:15     ` Joakim Tjernlund
2002-08-08  9:18       ` David Woodhouse
2002-08-06 20:16 Dave Ellis
2002-08-06 21:06 ` Joakim Tjernlund
2002-08-05 18:50 Dave Ellis
2002-08-06 10:06 ` Joakim Tjernlund
2002-08-06 12:14   ` David Woodhouse
2002-08-06 13:52     ` Jörn Engel
2002-08-06 13:53       ` David Woodhouse
2002-08-06 16:45     ` Joakim Tjernlund
2002-08-07  9:51       ` David Woodhouse
2002-08-08  7:23         ` Joakim Tjernlund
2002-08-08  8:02           ` David Woodhouse
2002-08-08  8:32             ` Joakim Tjernlund
2002-08-08  8:40               ` David Woodhouse
2002-08-05 10:35 MTD Partition problems David Woodhouse
2002-08-05 13:35 ` Disk blocks for long periods Joakim Tjernlund
2002-08-05 13:44   ` David Woodhouse
2002-08-05 13:59     ` Joakim Tjernlund
2002-08-05 14:12       ` David Woodhouse
2002-08-05 14:32         ` Joakim Tjernlund
2002-08-05 14:42           ` David Woodhouse
2002-08-05 21:45             ` Jasmine Strong

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=7780.1028718666@redhat.com \
    --to=dwmw2@infradead.org \
    --cc=DGE@sixnetio.com \
    --cc=joakim.tjernlund@lumentis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox