The patch can be applied to a current 2.6.21.1 kernel. I also
tested the patch today on a 2.6.22.5. There is one, very easy to solve,
reject (.rej). So to give it a try:
- Download one of those kernels
- extract
- cd linux-2.6.xxx
- patch -p1 < e2compr2.6.21.1_beta1.patch
- make menuconfig
(and configure the feature: filesystems / ext2 / compression / use bzip res. gzip.)
- make ....
I would be very happy about some expiriences and skilled error
descriptons.
greets Matthias
Major changes:
* completly ported inode->i_mutex
* clever CONFIG_GZ_HACK to reject "uncompressable" files
(according to their extension) early. The IOCTL in ioctl.c
to set the compression on the file already rejects such
extensions now.
* new create_empty_buffers_e2c() was necessary, because the
"extra" pages shouldn't have a valid i_mapping!
* in file.c copied:
ext2_mapping_read from generic_mapping_read() from 2.6.21.1 mm/filemap.c
ext2_file_aio_read from generic_file_aio_read from 2.6.21.1 mm/filemap.c
...with one single change at ext2_mapping_read in label page_ok:
A new Page-Flag (page-flags.h) the so called "PG_compr"-Flag is
checked to assure the corresponding page is not under
compression/decompression. This was necessary because
generic_mapping_read() doesn't lock() the page in ALL cases!!!
Otherwise the generic_mapping_read() would have to lock EVERY page
in the whole system before returning it....
* Fixed HiMem-Support: Balanced ALL kamp/kunmap calls. Unbalanced
functions cause the system to hang at "kmap_himem()" after some
time. Can be seen with magic-sysctrl and "altgr + prtscr + W".
* ext2_decompres_cluster() didn't mark uptodate pages for writeback.
Don't know how this method could have ever worked...
* ext2_compress_cluster() caused an always increasing amount of dirty-pages
(cat /proc/vmstat) which couldn't be wrote back by sync/umount.
I think this was due the ClearPageDirty ath the end of ext2_compress_cluster().
* introduced ext2_get_dcount() to savely determine if a file is really "open"
and to abort compression/decompression in that case.
* Removed gzip completely and not working assembler code. Replaced by the
kernels zlib, which is pretty the same code...
* New kernel configuration interface
* Rollback of some unecessary "fixes"...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I released a new patch which I consider as stable, so far.
It is possible to patch it to the current 2.6.22.6-kernel
and it does all the necessary kernel configuration now by
itself. Get it here:
25 Sep 2007
Matthias Winkler <m.winkler@unicon-ka.de>
* System stalled with a lot of I/O during compression of
USB-Sticks. Seems generic_osync_inode() should not be
called in ext2_compress_cluster. Therefore I replaced
it with ll_rw_block() to write the modified blocks
directly back to disk. This gave also a ~100% better
performance for compression.
9 Sep 2007
Matthias Winkler <m.winkler@unicon-ka.de>
* fixed bdev-bug. this bug appeared primarily when
files contained holes. A page with holes, which
was dirty caused ext2_get_cluster_blocks [ext2_get_block()]
to create ALL blocks of the page, even if there were holes!
These allocated hole-blocks weren't set to 0 anywhere and
therefore contained invalid data. I changed the
code to never allocate these holes.
* ext2_truncate() added again to ext2_compress_cluster for
uncompressed clusters. Fixes filesize errors reported by
"e2fsck -f /dev/..."
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm porting e2compression on kernel 2.6.21.1. The
work is not finished jet... but might be soon.
So I would be happy about some additional feedback
for my changes. You can give the patch a try:
http://www.xeer.de/e2compr2.6.21.1_beta1.patch
The patch can be applied to a current 2.6.21.1 kernel. I also
tested the patch today on a 2.6.22.5. There is one, very easy to solve,
reject (.rej). So to give it a try:
- Download one of those kernels
- extract
- cd linux-2.6.xxx
- patch -p1 < e2compr2.6.21.1_beta1.patch
- make menuconfig
(and configure the feature: filesystems / ext2 / compression / use bzip res. gzip.)
- make ....
I would be very happy about some expiriences and skilled error
descriptons.
greets Matthias
Major changes:
* completly ported inode->i_mutex
* clever CONFIG_GZ_HACK to reject "uncompressable" files
(according to their extension) early. The IOCTL in ioctl.c
to set the compression on the file already rejects such
extensions now.
* new create_empty_buffers_e2c() was necessary, because the
"extra" pages shouldn't have a valid i_mapping!
* proper block initalization (bdev-bug) in:
- create_empty_buffers_e2c()
- ext2_get_cluster_blocks
* in file.c copied:
ext2_mapping_read from generic_mapping_read() from 2.6.21.1 mm/filemap.c
ext2_file_aio_read from generic_file_aio_read from 2.6.21.1 mm/filemap.c
...with one single change at ext2_mapping_read in label page_ok:
A new Page-Flag (page-flags.h) the so called "PG_compr"-Flag is
checked to assure the corresponding page is not under
compression/decompression. This was necessary because
generic_mapping_read() doesn't lock() the page in ALL cases!!!
Otherwise the generic_mapping_read() would have to lock EVERY page
in the whole system before returning it....
* Fixed HiMem-Support: Balanced ALL kamp/kunmap calls. Unbalanced
functions cause the system to hang at "kmap_himem()" after some
time. Can be seen with magic-sysctrl and "altgr + prtscr + W".
* ext2_decompres_cluster() didn't mark uptodate pages for writeback.
Don't know how this method could have ever worked...
* ext2_compress_cluster() caused an always increasing amount of dirty-pages
(cat /proc/vmstat) which couldn't be wrote back by sync/umount.
I think this was due the ClearPageDirty ath the end of ext2_compress_cluster().
* introduced ext2_get_dcount() to savely determine if a file is really "open"
and to abort compression/decompression in that case.
* Removed gzip completely and not working assembler code. Replaced by the
kernels zlib, which is pretty the same code...
* New kernel configuration interface
* Rollback of some unecessary "fixes"...
Hi Everybody!
I released a new patch which I consider as stable, so far.
It is possible to patch it to the current 2.6.22.6-kernel
and it does all the necessary kernel configuration now by
itself. Get it here:
http://www.xeer.de/e2compr2.6.22.5.patch.gz
I also did fix up the remaining errors:
25 Sep 2007
Matthias Winkler <m.winkler@unicon-ka.de>
* System stalled with a lot of I/O during compression of
USB-Sticks. Seems generic_osync_inode() should not be
called in ext2_compress_cluster. Therefore I replaced
it with ll_rw_block() to write the modified blocks
directly back to disk. This gave also a ~100% better
performance for compression.
9 Sep 2007
Matthias Winkler <m.winkler@unicon-ka.de>
* fixed bdev-bug. this bug appeared primarily when
files contained holes. A page with holes, which
was dirty caused ext2_get_cluster_blocks [ext2_get_block()]
to create ALL blocks of the page, even if there were holes!
These allocated hole-blocks weren't set to 0 anywhere and
therefore contained invalid data. I changed the
code to never allocate these holes.
* ext2_truncate() added again to ext2_compress_cluster for
uncompressed clusters. Fixes filesize errors reported by
"e2fsck -f /dev/..."