public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: Alexander Schmidt <alexs@linux.vnet.ibm.com>
Cc: Artem.Bityutskiy@nokia.com,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [RFC] [PATCH] UBI: refine wear leveling logic
Date: Thu, 29 Mar 2007 13:36:31 +0300	[thread overview]
Message-ID: <1175164591.19966.20.camel@sauron> (raw)
In-Reply-To: <200703281547.18851.alexs@linux.vnet.ibm.com>

Hi Alexander,

On Wed, 2007-03-28 at 15:47 +0200, Alexander Schmidt wrote:
> This patch addresses the handling of blocks that are put by the user
> while they are moved by the wear leveling thread. The schedule_erase
> function is now called by put_peb() itself instead of notifying the wear
> leveling thread.

May I ask you for more explanation why you think your code is correct?

> +
> +	if (in_wl_tree(e, &ubi->used))
> +		used_tree_del(ubi, e);
> +	else if (unlikely(in_wl_tree(e, &ubi->scrub)))
> +		scrub_tree_del(ubi, e);
> +	else if (!in_wl_tree(e, &ubi->free))
> +		prot_tree_del(ubi, e->pnum);
>  	spin_unlock(&ubi->wl_lock);
>  
>  	err = schedule_erase(ubi, e, torture);

Fine, you schedule this eraseblock for erasure. At the same time the the
WL worker moves data in there. The copy_leb() function will notice that
the LEB is unmapped, and won't do copy. Then the WL worker will insert
the eraseblock to a tree. At the same time the erase worker will insert
the same wl_entry to the free tree. One of the trees will be screwed-up.

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

  reply	other threads:[~2007-03-29 10:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-28 13:47 [RFC] [PATCH] UBI: refine wear leveling logic Alexander Schmidt
2007-03-29 10:36 ` Artem Bityutskiy [this message]
2007-03-29 11:59   ` Alexander Schmidt
2007-03-30 12:23     ` Artem Bityutskiy
2007-03-30 14:40       ` Alexander Schmidt
2007-04-02 10:53         ` 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=1175164591.19966.20.camel@sauron \
    --to=dedekind@infradead.org \
    --cc=Artem.Bityutskiy@nokia.com \
    --cc=alexs@linux.vnet.ibm.com \
    --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