public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: Nielsen David Marqvar <David.Nielsen@frequentis.com>
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH][JFFS2] Reschedule during scan of partly empty eraseblock
Date: Thu, 29 May 2008 12:46:32 +0300	[thread overview]
Message-ID: <1212054392.31023.66.camel@sauron> (raw)
In-Reply-To: <B80D0E83691CB840ACE9714151F863850157100C@VIECLEX01.frequentis.frq>

On Thu, 2008-05-29 at 11:29 +0200, Nielsen David Marqvar wrote:
> This patch adds rescheduling to the loop that scans an empty area of an
> eraseblock.
> 
> Rationale:
> When scanning the an empty area of an eraseblock no scheduling occurs. But
> this scan may take significantly long to complete depending on the size of 
> the empty space within the eraseblock and the speed of the flash (on my
> system
> it could theoretically be up to 100 ms).
> The patch will add a call to cond_resched() for each 2 KiB scanned (while the
> first check may be done before 2 KiB the code is simple and fast).
> 
> The patch has been tested and running on our systems for a month now.
...
>                                 }
> 
> +                               /* check for resched - searching an
> eraseblock may take several ms */
> +                               if ( (ofs & 0x7ff /* for each 2KiB */) == 0)
> +                                       cond_resched();
> +
>                                 inbuf_ofs+=4;
>                                 ofs += 4;
>                         }

I would rather add cond_resched() to jffs2_fill_scan_buf()
unconditionally. Conditional cond_resched() really looks bad.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

  reply	other threads:[~2008-05-29  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29  9:29 [PATCH][JFFS2] Reschedule during scan of partly empty eraseblock Nielsen David Marqvar
2008-05-29  9:46 ` Artem Bityutskiy [this message]
2008-05-29 11:40   ` [PATCH][JFFS2] Reschedule during scan of partly emptyeraseblock Nielsen David Marqvar
2008-05-29 11:49     ` 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=1212054392.31023.66.camel@sauron \
    --to=dedekind@infradead.org \
    --cc=David.Nielsen@frequentis.com \
    --cc=dwmw2@infradead.org \
    --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