Mercurial > yaffs-ecoscentric-gpl
annotate yaffs_packedtags2.h @ 403:205fa93db422
yaffs New background garbage collector and related tweaks
This commit
- introduces the yaffs background garbage collection feature
- tweaks the foregound garbage collection to do less work
- changes the way auto-checkpointing works
- tweaks the block refreshing logic.
The aim of the background garbage collector is to do at least some of the
garbage collection in the background so that writing operations will not have
to do as much garbage collection which should make writes faster. The amount of
background garbage collection is controlled by the ratio between the amount of
erased space vs the amount of free space:
* If less than quarter of free space is erased, then background gc is frequent.
* Else if less than a half of the free space is erased, then background gc is
still done reasonably frequently.
* else (at least half of the free space is erased) the background gc is done
infrequently.
Background gc is not attempted if the partition is checkpointed since that would
invalidate the checkpoint.
The auto-checkpointing feature has changed slightly. If the yaffs_auto_checkpoint
value is set to 1 or 2 then the auto checkpointing will be blocked if the erased
space is less than half the free space (ie. the auto-checkpointing is blocked to
allow background gc to progress). Oring in 4 into the yaffs_auto_checkpoint will
do a one-shot override, forcing a checkpoint and suspending background gc until
the partition is dirtied by a write, erase etc.
The block refreshing control has been changed. The dev->param.refreshPeriod now
controls how many blocks are garbage collected before another refresh is performed.
Values around 1000 probably make the best sense.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
| author | Charles Manning <cdhmanning@gmail.com> |
|---|---|
| date | Fri, 16 Apr 2010 15:39:16 +1200 |
| parents | 1d1b453d8b57 |
| children | b5309c9b6d7f |
| rev | line source |
|---|---|
| 168 | 1 /* |
|
198
b7f785925166
Cleanup patch - Remove all trailing whitespace and fix a few typos.
wookey <wookey>
parents:
168
diff
changeset
|
2 * YAFFS: Yet another Flash File System . A NAND-flash specific file system. |
| 168 | 3 * |
| 4 * Copyright (C) 2002-2007 Aleph One Ltd. | |
| 5 * for Toby Churchill Ltd and Brightstar Engineering | |
| 6 * | |
| 7 * Created by Charles Manning <charles@aleph1.co.uk> | |
| 8 * | |
| 9 * This program is free software; you can redistribute it and/or modify | |
| 10 * it under the terms of the GNU Lesser General Public License version 2.1 as | |
| 11 * published by the Free Software Foundation. | |
| 12 * | |
| 13 * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. | |
| 14 */ | |
| 15 | |
| 77 | 16 /* This is used to pack YAFFS2 tags, not YAFFS1tags. */ |
| 6 | 17 |
| 18 #ifndef __YAFFS_PACKEDTAGS2_H__ | |
| 19 #define __YAFFS_PACKEDTAGS2_H__ | |
| 20 | |
| 21 #include "yaffs_guts.h" | |
| 22 #include "yaffs_ecc.h" | |
| 23 | |
| 77 | 24 typedef struct { |
| 25 unsigned sequenceNumber; | |
| 26 unsigned objectId; | |
| 27 unsigned chunkId; | |
| 28 unsigned byteCount; | |
| 6 | 29 } yaffs_PackedTags2TagsPart; |
| 30 | |
| 77 | 31 typedef struct { |
| 32 yaffs_PackedTags2TagsPart t; | |
| 33 yaffs_ECCOther ecc; | |
| 6 | 34 } yaffs_PackedTags2; |
| 35 | |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
198
diff
changeset
|
36 /* Full packed tags with ECC, used for oob tags */ |
|
343
1d1b453d8b57
Change parameters to packing/unpacking to fix mkyaffs2image compilation issue
charles <charles>
parents:
300
diff
changeset
|
37 void yaffs_PackTags2(yaffs_PackedTags2 *pt, const yaffs_ExtendedTags *t, int tagsECC); |
|
1d1b453d8b57
Change parameters to packing/unpacking to fix mkyaffs2image compilation issue
charles <charles>
parents:
300
diff
changeset
|
38 void yaffs_UnpackTags2(yaffs_ExtendedTags *t, yaffs_PackedTags2 *pt, int tagsECC); |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
198
diff
changeset
|
39 |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
198
diff
changeset
|
40 /* Only the tags part (no ECC for use with inband tags */ |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
204
diff
changeset
|
41 void yaffs_PackTags2TagsPart(yaffs_PackedTags2TagsPart *pt, const yaffs_ExtendedTags *t); |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
204
diff
changeset
|
42 void yaffs_UnpackTags2TagsPart(yaffs_ExtendedTags *t, yaffs_PackedTags2TagsPart *pt); |
| 6 | 43 #endif |
