#2844 closed enhancement (fixed)

JFFS2: Add IO controls to get filesystem instance information and force a garbage collection

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: fs Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Some applications need to control the garbage collection of the JFFS2 filesystem. For example during bootloader to application transitions with execute in place flashes (XIP).

Change History (11)

comment:1 Changed on Dec 19, 2016 at 9:28:42 PM by Chris Johns

When does JFFS2 garbage collect at the moment?

Does this mean we can mount a JFFS2 disk and not start the garbage collection and defer it to later?

If so does this mean a user needs to enable garage collection at some later time or will the JFFS be configured to start garbage collection automatically?

comment:2 Changed on Dec 20, 2016 at 6:29:55 AM by Sebastian Huber

Garbage collection is done on demand automatically as late as possible. Every operation can result in a garbage collection. We don't have a garbage collection thread like on Linux.

This operation gives you a bit more control when the garbage collection takes place.

comment:3 Changed on Dec 20, 2016 at 7:32:35 AM by Sebastian Huber <sebastian.huber@…>

In 07c833f8f98c665e2f7d7e9adfa5f5503177dbff/rtems:

JFFS2: Add RTEMS_JFFS2_GET_INFO

Add IO control RTEMS_JFFS2_GET_INFO to get some JFFS2 filesystem
instance information.

Update #2844.

comment:4 Changed on Dec 20, 2016 at 7:32:47 AM by Sebastian Huber <sebastian.huber@…>

In ade135d45577263fe2c7b4d885e81c1798a1a79a/rtems:

JFFS2: Add RTEMS_JFFS2_FORCE_GARBAGE_COLLECTION

Add IO control to force a garbage collection.

Update #2844.

comment:5 Changed on Dec 20, 2016 at 7:32:59 AM by Sebastian Huber <sebastian.huber@…>

In ab834d65e4a96bb59901f4349857ffe3e57a3f54/rtems:

JFFS2: RTEMS_JFFS2_ON_DEMAND_GARBAGE_COLLECTION

Update #2844.

comment:6 Changed on Dec 20, 2016 at 7:33:21 AM by Sebastian Huber

Resolution: fixed
Status: newclosed

comment:7 in reply to:  2 ; Changed on Dec 20, 2016 at 7:49:54 AM by Chris Johns

Replying to sebastian.huber:

Garbage collection is done on demand automatically as late as possible. Every operation can result in a garbage collection. We don't have a garbage collection thread like on Linux.

Is there a special reason we do not have a thread?

This operation gives you a bit more control when the garbage collection takes place.

I see it forces a garbage collection so how do you suspend it?

Your original post suggested it could be suspended and this would be good. After a large delete and reboot the start up can hang on the mount. It would be nice to hold this until we have initialised and then let the clean up happen.

comment:8 in reply to:  7 ; Changed on Dec 20, 2016 at 7:54:55 AM by Sebastian Huber

Replying to chrisj:

Replying to sebastian.huber:

Garbage collection is done on demand automatically as late as possible. Every operation can result in a garbage collection. We don't have a garbage collection thread like on Linux.

Is there a special reason we do not have a thread?

Nobody needed it up to now.

This operation gives you a bit more control when the garbage collection takes place.

I see it forces a garbage collection so how do you suspend it?

Your original post suggested it could be suspended and this would be good. After a large delete and reboot the start up can hang on the mount. It would be nice to hold this until we have initialised and then let the clean up happen.

With the RTEMS_JFFS2_ON_DEMAND_GARBAGE_COLLECTION and the rtems_jffs2_control::trigger_garbage_collection you have now the ability to use a garbage collection thread in your application.

comment:9 in reply to:  8 Changed on Dec 20, 2016 at 10:20:07 AM by Chris Johns

Replying to sebastian.huber:

Replying to chrisj:

Replying to sebastian.huber:

Garbage collection is done on demand automatically as late as possible. Every operation can result in a garbage collection. We don't have a garbage collection thread like on Linux.

Is there a special reason we do not have a thread?

Nobody needed it up to now.

Great, that is fine.

This operation gives you a bit more control when the garbage collection takes place.

I see it forces a garbage collection so how do you suspend it?

Your original post suggested it could be suspended and this would be good. After a large delete and reboot the start up can hang on the mount. It would be nice to hold this until we have initialised and then let the clean up happen.

With the RTEMS_JFFS2_ON_DEMAND_GARBAGE_COLLECTION and the rtems_jffs2_control::trigger_garbage_collection you have now the ability to use a garbage collection thread in your application.

OK. I will take a look. It would be good to have an example of doing this or even something a user can pull in.

comment:10 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber

Milestone: 4.124.12.0

comment:11 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.