* Re: [PATCH V2 00/16] Squashfs: compressed read-only filesystem [not found] <E1Kv0C3-0006GU-ES@dylan> @ 2008-10-29 2:29 ` Andrew Morton 2009-01-04 7:55 ` Phillip Lougher 2009-01-05 12:29 ` Pull request for Squashfs Phillip Lougher 0 siblings, 2 replies; 7+ messages in thread From: Andrew Morton @ 2008-10-29 2:29 UTC (permalink / raw) To: Phillip Lougher Cc: linux-embedded, linux-fsdevel, linux-kernel, tim.bird, linux-next On Wed, 29 Oct 2008 01:49:55 +0000 Phillip Lougher <phillip@lougher.demon.co.uk> wrote: > Hi, > > This a respin of the Squashfs patches incorporating the review comments > received. Thanks to everyone who have sent comments. > > Summary of changes in patch respin: > > 1. Functions changed to return 0 on success and -ESOMETHING on error > 2. Header files moved from include/linux to fs/squashfs > 3. Variables changed to use sb and inode > 4. Number of squashfs_read_metadata() parameters reduced > 5. Xattr placeholder code tweaked > 6. TRACE and ERROR macros fixed to use pr_debug and pr_warning > 7. Some obsolete macros in squashfs_fs.h removed > 8. A number of gotos to return statements replaced with direct returns > 9. Sparse with endian checking (make C=2 CHECKFLAGS="-D__CHECK_ENDIAN__") > errors fixed > 10. get_dir_index_using_name() misaligned access fixed > 11. Fix a couple of printk warnings on PPC64 > 12. Shorten a number of variable names - what are the limitations of squashfs (please add this to the changelog of patch #1 or something). Does it support nfsd? (yes, it does!) xatrs and acls? File size limits, entries-per-directory, etc, etc? What is on the todo list? - Please check that all non-static identifiers really did need global scope. I saw some which surprised me a bit. - Please check that all global identifiers have suitable names. For example "get_fragment_location" is a poor choice for a kernel-wide identifier. It could clash with other subsystems, mainly. Plus it is hardly self-identifying. I see quite a few such cases. - The fs uses vmalloc() rather a lot. I'd suggest that this be explained and justified in the design/implementation overview, wherever that is. This should include a means by which we can estimate (or at least understand) the amount of memory which will be allocated in this way. Because vmalloc() is unreliable. It is a fixed-size resource on each machine. Some machines will run out much much earlier than others. It will set an upper limit on the number of filesystems which can be concurrently mounted, and presumably upon the size of those filesystems. One a per-machine basis, which is worse. It also exposes users to vmalloc arena fragmentation. eg: mount ten 1G filesystems, then unmount every second one, then try to mount a 2G filesystem and you find you have no contiguous vmalloc space (simplified example). See, this vmalloc thing is a fairly big deal. What's up with all of this?? - The fs uses brelse() in quite a few places where the bh is known to be non-zero. Suggest that these be converted to the more efficient and modern put_bh(). - this: +/* + * Blocks in Squashfs are compressed. To avoid repeatedly decompressing + * recently accessed data Squashfs uses two small metadata and fragment caches. + * + * This file implements a generic cache implementation used for both caches, + * plus functions layered ontop of the generic cache implementation to + * access the metadata and fragment caches. + */ confuses me. Why not just decompress these blocks into pagecache and let the VFS handle the caching?? The real bug here is that this rather obvious question wasn't answered anywhere in the patch submission (afaict). How to fix that? Methinks we need a squashfs.txt which covers these things. - I suspect that squashfs_cache_put() has races around the handling of cache->waiting. Does it assume that another CPU wrote that flag prior to adding itself to the waitqueue? How can the other task do that atomically? What about memory ordering issues? Suggest that cache->lock coverage be extended to clear all this up. - Quite a few places do kzalloc(a * b, ...). Please convert to kcalloc() which has checks for multiplicative overflows. > There is now a public git repository on kernel.org. Pull/clone from > git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-2.6.git Generally looks OK to me. Please prepare a tree for linx-next inclusion and unless serious problems are pointed out I'd suggest shooting for a 2.6.29 merge. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2 00/16] Squashfs: compressed read-only filesystem 2008-10-29 2:29 ` [PATCH V2 00/16] Squashfs: compressed read-only filesystem Andrew Morton @ 2009-01-04 7:55 ` Phillip Lougher 2009-01-04 19:04 ` Leon Woestenberg 2009-01-05 12:29 ` Pull request for Squashfs Phillip Lougher 1 sibling, 1 reply; 7+ messages in thread From: Phillip Lougher @ 2009-01-04 7:55 UTC (permalink / raw) To: Andrew Morton Cc: linux-embedded, linux-fsdevel, linux-kernel, tim.bird, linux-next, sfr Andrew Morton wrote a couple of months ago (sadly how time flies): > - what are the limitations of squashfs (please add this to the > changelog of patch #1 or something). Does it support nfsd? (yes, it > does!) xatrs and acls? File size limits, entries-per-directory, > etc, etc? Xattrs and acls are not supported, this is a todo. Filesize limits are in theory 2^64. In practice about 2 TiB. No limits on the entries per directory. > > What is on the todo list? > Xattrs and ACLs. The above information has been added to a squashfs.txt file. > - Please check that all non-static identifiers really did need global > scope. I saw some which surprised me a bit. > > - Please check that all global identifiers have suitable names. For > example "get_fragment_location" is a poor choice for a kernel-wide > identifier. It could clash with other subsystems, mainly. Plus it > is hardly self-identifying. I see quite a few such cases. Done and fixed. > > - The fs uses vmalloc() rather a lot. I'd suggest that this be > explained and justified in the design/implementation overview, > wherever that is. This should include a means by which we can > estimate (or at least understand) the amount of memory which will be > allocated in this way. > > Because vmalloc() is unreliable. It is a fixed-size resource on > each machine. Some machines will run out much much earlier than > others. It will set an upper limit on the number of filesystems > which can be concurrently mounted, and presumably upon the size of > those filesystems. One a per-machine basis, which is worse. > > It also exposes users to vmalloc arena fragmentation. eg: mount > ten 1G filesystems, then unmount every second one, then try to mount > a 2G filesystem and you find you have no contiguous vmalloc space > (simplified example). > > See, this vmalloc thing is a fairly big deal. What's up with all > of this?? Vmalloc was used to allocate block data (128 Kib by default). I've removed all vmallocs from Squashfs. All buffers are now kmalloced in PAGE_CACHE_SIZEd chunks. > > - The fs uses brelse() in quite a few places where the bh is known to > be non-zero. Suggest that these be converted to the more efficient > and modern put_bh(). > Fixed. > - this: > > +/* > + * Blocks in Squashfs are compressed. To avoid repeatedly decompressing > + * recently accessed data Squashfs uses two small metadata and fragment caches. > + * > + * This file implements a generic cache implementation used for both caches, > + * plus functions layered ontop of the generic cache implementation to > + * access the metadata and fragment caches. > + */ > > confuses me. Why not just decompress these blocks into pagecache > and let the VFS handle the caching?? > The cache is not used for file datablocks, these are decompressed and cached in the page-cache in the normal way. The cache is only used to temporarily cache fragment and metadata blocks which have been read as as a result of a metadata (i.e. inode or directory) or fragment access. Because metadata and fragments are packed together into blocks (to gain greater compression) the read of a particular piece of metadata or fragment will retrieve other metadata/fragments which have been packed with it, these because of locality-of-reference may be read in the near future. Temporarily caching them ensures they are available for near future access without requiring an additional read and decompress. The cache is deliberately kept small to only cache the last couple of blocks read. The total overhead is 3 x block_size (128 KiB) for fragments and 8 x 8 KiB for metadata blocks, or a total of 448 KiB. If you think this is too large I can reduce the number of fragments and metadata blocks cached. Because these blocks are greater than PAGE_CACHE_SIZE is not easy to use the page cache. As Joern said "there really isn't any infrastructure to deal with such cases yet. Bufferheads deal with blocks smaller than a page, not the other way around." Storing these in the page cache introduces a lot more complexity in terms of locking and associated race conditions. As previously mentioned I have rewritten the cache implementation to avoid vmalloc and to use PAGE_CACHE_SIZE blocks. This eliminates the vmalloc fragment issues, and is a first step in moving the implementation over to using the page cache in the future. > The real bug here is that this rather obvious question wasn't > answered anywhere in the patch submission (afaict). How to fix that? > > Methinks we need a squashfs.txt which covers these things. Added to a new squashfs.txt file. > > - I suspect that squashfs_cache_put() has races around the handling > of cache->waiting. Does it assume that another CPU wrote that flag > prior to adding itself to the waitqueue? How can the other task do > that atomically? What about memory ordering issues? > > Suggest that cache->lock coverage be extended to clear all this up. > Fixed. > - Quite a few places do kzalloc(a * b, ...). Please convert to > kcalloc() which has checks for multiplicative overflows. Fixed. > >> There is now a public git repository on kernel.org. Pull/clone from >> git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-2.6.git > > Generally looks OK to me. Please prepare a tree for linx-next > inclusion and unless serious problems are pointed out I'd suggest > shooting for a 2.6.29 merge. > Ok. I'll re-spin the patches against 2.6.28 tomorrow (Sunday), and I'll prepare a tree for linux-next. Thanks Phillip ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2 00/16] Squashfs: compressed read-only filesystem 2009-01-04 7:55 ` Phillip Lougher @ 2009-01-04 19:04 ` Leon Woestenberg 0 siblings, 0 replies; 7+ messages in thread From: Leon Woestenberg @ 2009-01-04 19:04 UTC (permalink / raw) To: Phillip Lougher Cc: Andrew Morton, linux-embedded, linux-fsdevel, linux-kernel, tim.bird, linux-next, sfr Hello, On Sun, Jan 4, 2009 at 8:55 AM, Phillip Lougher <phillip@lougher.demon.co.uk> wrote: >> - what are the limitations of squashfs (please add this to the >> changelog of patch #1 or something). Does it support nfsd? (yes, it >> does!) xatrs and acls? File size limits, entries-per-directory, >> etc, etc? > > Xattrs and acls are not supported, this is a todo. > Filesize limits are in theory 2^64. In practice about 2 TiB. > ... > > Ok. I'll re-spin the patches against 2.6.28 tomorrow (Sunday), and I'll > prepare a tree for linux-next. > For use cases such as embedded firmware, the limitations are non-interesting, and the compression savings are very interesting. Especially where the resulting filesystem has to creep through slow wires such as half duplex serial links etc. Have been using squashfs 2.2 up to 3.4 without problems for years, for distribution of Linux based firmwares into embedded devices. Many thanks for your continued efforts on mainlining squashfs, Regards, -- Leon ^ permalink raw reply [flat|nested] 7+ messages in thread
* Pull request for Squashfs 2008-10-29 2:29 ` [PATCH V2 00/16] Squashfs: compressed read-only filesystem Andrew Morton 2009-01-04 7:55 ` Phillip Lougher @ 2009-01-05 12:29 ` Phillip Lougher 2009-01-05 12:52 ` Stephen Rothwell 2009-01-05 13:37 ` Stephen Rothwell 1 sibling, 2 replies; 7+ messages in thread From: Phillip Lougher @ 2009-01-05 12:29 UTC (permalink / raw) To: sfr; +Cc: Andrew Morton, linux-next Andrew Morton wrote: > Generally looks OK to me. Please prepare a tree for linux-next > inclusion and unless serious problems are pointed out I'd suggest > shooting for a 2.6.29 merge. Hi Stephen, Can you try pulling the master branch of: git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next.git into linux-next please? The Squashfs patches have been tested. Thanks Phillip ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Pull request for Squashfs 2009-01-05 12:29 ` Pull request for Squashfs Phillip Lougher @ 2009-01-05 12:52 ` Stephen Rothwell 2009-01-05 13:03 ` Phillip Lougher 2009-01-05 13:37 ` Stephen Rothwell 1 sibling, 1 reply; 7+ messages in thread From: Stephen Rothwell @ 2009-01-05 12:52 UTC (permalink / raw) To: Phillip Lougher; +Cc: Andrew Morton, linux-next [-- Attachment #1: Type: text/plain, Size: 737 bytes --] Hi Phillip, Andrew, On Mon, 05 Jan 2009 12:29:00 +0000 Phillip Lougher <phillip@lougher.demon.co.uk> wrote: > > Andrew Morton wrote: > > > Generally looks OK to me. Please prepare a tree for linux-next > > inclusion and unless serious problems are pointed out I'd suggest > > shooting for a 2.6.29 merge. > > Can you try pulling the master branch of: > > git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next.git > > into linux-next please? > > The Squashfs patches have been tested. Is this intended for 2.6.29 (even this late) or should I wait until after -rc1 to add this to linux-next? -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Pull request for Squashfs 2009-01-05 12:52 ` Stephen Rothwell @ 2009-01-05 13:03 ` Phillip Lougher 0 siblings, 0 replies; 7+ messages in thread From: Phillip Lougher @ 2009-01-05 13:03 UTC (permalink / raw) To: Stephen Rothwell; +Cc: Andrew Morton, linux-next Stephen Rothwell wrote: > Hi Phillip, Andrew, > > On Mon, 05 Jan 2009 12:29:00 +0000 Phillip Lougher <phillip@lougher.demon.co.uk> wrote: >> Andrew Morton wrote: >> >>> Generally looks OK to me. Please prepare a tree for linux-next >>> inclusion and unless serious problems are pointed out I'd suggest >>> shooting for a 2.6.29 merge. >> Can you try pulling the master branch of: >> >> git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next.git >> >> into linux-next please? >> >> The Squashfs patches have been tested. > > Is this intended for 2.6.29 (even this late) or should I wait until after > -rc1 to add this to linux-next? > Hmm, I didn't realise it was late for 2.6.29 :-( I'd prefer it to be for 2.6.29 if possible. But the decision isn't probably up to me... Thanks Phillip ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Pull request for Squashfs 2009-01-05 12:29 ` Pull request for Squashfs Phillip Lougher 2009-01-05 12:52 ` Stephen Rothwell @ 2009-01-05 13:37 ` Stephen Rothwell 1 sibling, 0 replies; 7+ messages in thread From: Stephen Rothwell @ 2009-01-05 13:37 UTC (permalink / raw) To: Phillip Lougher; +Cc: Andrew Morton, linux-next [-- Attachment #1: Type: text/plain, Size: 1255 bytes --] Hi Phillip, On Mon, 05 Jan 2009 12:29:00 +0000 Phillip Lougher <phillip@lougher.demon.co.uk> wrote: > > Can you try pulling the master branch of: > > git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next.git I fetched this to have a look and it is based on next-20090105. You cannot base any git tree that is to be included into linux-next on linux-next itself. You should base it on Linus' latest tree (except for very special cases where your code actually depends on something that is only in thelinux-next tree). Once it is set up like that, you don't need to keep rebasing it and only need to merge Linus' tree into it if there are more than trivial conflicts (which there shouldn't be given it touches very little outside fs/squashfs). I also expected it to be a series of commits to match (more or less) what you have been posting for review. I fetched your squashfs-linus.git instead and that looks exactly like what I need. I also just noticed Andrew's comment about aiming for a 2.6.29 merge (I should read my mail better), so I will add your squashfs-linus.git tree to linux-next tomorrow. -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-01-05 13:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <E1Kv0C3-0006GU-ES@dylan>
2008-10-29 2:29 ` [PATCH V2 00/16] Squashfs: compressed read-only filesystem Andrew Morton
2009-01-04 7:55 ` Phillip Lougher
2009-01-04 19:04 ` Leon Woestenberg
2009-01-05 12:29 ` Pull request for Squashfs Phillip Lougher
2009-01-05 12:52 ` Stephen Rothwell
2009-01-05 13:03 ` Phillip Lougher
2009-01-05 13:37 ` Stephen Rothwell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox