public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH 2/2] s/jffs2_erase_pending_trigger/jffs2_garbage_collect_trigger/
Date: Wed, 17 Feb 2010 09:18:23 +0200	[thread overview]
Message-ID: <1266391103.11659.356.camel@localhost> (raw)
In-Reply-To: <OFACBFB4CF.DBE14C44-ONC12576CC.004F427F-C12576CC.004F68EA@transmode.se>

On Tue, 2010-02-16 at 15:27 +0100, Joakim Tjernlund wrote:
> Artem Bityutskiy <dedekind1@gmail.com> wrote on 2010/02/16 09:59:49:
> >
> > On Mon, 2010-02-15 at 17:03 +0100, Joakim Tjernlund wrote:
> > > Since erasing is done in GC now, trigger GC instead.
> > > jffs2_erase_pending_trigger() renamed to jffs2_dirty_trigger() and
> > > used by wbuf. Remove call jffs2_garbage_collect_trigger() in
> > > write_super()
> > >
> > > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > > ---
> > >  fs/jffs2/erase.c    |    4 +---
> > >  fs/jffs2/gc.c       |    2 +-
> > >  fs/jffs2/nodemgmt.c |    4 ++--
> > >  fs/jffs2/os-linux.h |    2 +-
> > >  fs/jffs2/scan.c     |    2 +-
> > >  fs/jffs2/super.c    |    1 -
> > >  fs/jffs2/wbuf.c     |    8 ++++----
> > >  7 files changed, 10 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
> > > index 1ca2559..fdf9418 100644
> > > --- a/fs/jffs2/erase.c
> > > +++ b/fs/jffs2/erase.c
> > > @@ -172,8 +172,6 @@ static void jffs2_erase_succeeded(struct jffs2_sb_info
> > *c, struct jffs2_eraseblo
> > >     list_move_tail(&jeb->list, &c->erase_complete_list);
> > >     spin_unlock(&c->erase_completion_lock);
> > >     mutex_unlock(&c->erase_free_sem);
> > > -   /* Ensure that kupdated calls us again to mark them clean */
> > > -   jffs2_erase_pending_trigger(c);
> > >  }
> > >
> > >  static void jffs2_erase_failed(struct jffs2_sb_info *c, struct
> > jffs2_eraseblock *jeb, uint32_t bad_offset)
> > > @@ -492,7 +490,7 @@ filebad:
> > >
> > >  refile:
> > >     /* Stick it back on the list from whence it came and come back later */
> > > -   jffs2_erase_pending_trigger(c);
> > > +   jffs2_garbage_collect_trigger(c);
> >
> > But then you make the code more confusing. Indeed, readability becomes
> > worse.
> >
> > I would just change 'jffs2_erase_pending_trigger()' and make it wake up
> > the GC thread, just like 'jffs2_garbage_collect_trigger()'...
> 
> Here we go then:
> 
> From 96a4a9dc054f2dbd57e180e202f69c9645536e0d Mon Sep 17 00:00:00 2001
> From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> Date: Tue, 16 Feb 2010 15:18:31 +0100
> Subject: [PATCH] jffs2: Make jffs2_erase_pending_trigger() initiate GC.
> 
> Since erasing is now in the GC thread, erases should trigger
> the GC task instead.
> wbuf.c still wants to flush its buffer via write_super so
> invent jffs2_dirty_trigger() and use that in wbuf.
> Remove surplus call to jffs2_erase_pending_trigger() in erase.c
> and remove jffs2_garbage_collect_trigger() from write_super as
> of now write_super() should only commit dirty data to disk.
> 
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
>  fs/jffs2/erase.c    |    2 --
>  fs/jffs2/os-linux.h |    9 +++++++--
>  fs/jffs2/super.c    |    1 -
>  fs/jffs2/wbuf.c     |    2 +-
>  4 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
> index 1ca2559..5616658 100644
> --- a/fs/jffs2/erase.c
> +++ b/fs/jffs2/erase.c
> @@ -172,8 +172,6 @@ static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblo
>  	list_move_tail(&jeb->list, &c->erase_complete_list);
>  	spin_unlock(&c->erase_completion_lock);
>  	mutex_unlock(&c->erase_free_sem);
> -	/* Ensure that kupdated calls us again to mark them clean */
> -	jffs2_erase_pending_trigger(c);
>  }

Looks like BGT should be triggered from here in order to write the clean
marker.

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

  reply	other threads:[~2010-02-17  7:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15 16:03 [PATCH 1/2] jffs:2 Move erasing from write_super to GC Joakim Tjernlund
2010-02-15 16:03 ` [PATCH 2/2] s/jffs2_erase_pending_trigger/jffs2_garbage_collect_trigger/ Joakim Tjernlund
2010-02-16  8:59   ` Artem Bityutskiy
2010-02-16  9:32     ` Joakim Tjernlund
2010-02-16 14:27     ` Joakim Tjernlund
2010-02-17  7:18       ` Artem Bityutskiy [this message]
2010-02-17  7:35         ` Joakim Tjernlund
2010-02-17  7:48           ` Artem Bityutskiy
2010-02-17  7:55             ` Joakim Tjernlund
2010-02-17  8:07               ` Artem Bityutskiy
2010-02-17  8:19                 ` Joakim Tjernlund
2010-02-16  8:57 ` [PATCH 1/2] jffs:2 Move erasing from write_super to GC Artem Bityutskiy
2010-02-16  9:18   ` Joakim Tjernlund
2010-02-16  9:45     ` Artem Bityutskiy
2010-02-16 11:49       ` Joakim Tjernlund
2010-02-16 11:59         ` 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=1266391103.11659.356.camel@localhost \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox