aboutsummaryrefslogtreecommitdiff
path: root/fs/squashfs/page_actor.c
Commit message (Collapse)AuthorAgeFilesLines
* ANDROID: Squashfs: fix missing NULL checkDaniel Rosenberg2017-04-111-3/+5
| | | | | | | | | "Squashfs: refactor page_actor" missed a null check within squashfs_bh_to_actor, as that array may now contain null entries Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35257858 Change-Id: Ia6748af980859237a96f509f35903f722a46fd59
* Squashfs: refactor page_actorAdrien Schildknecht2017-04-111-61/+114
| | | | | | | | | | | | | | | | | This patch essentially does 3 things: 1/ Always use an array of page to store the data instead of a mix of buffers and pages. 2/ It is now possible to have 'holes' in a page actor, i.e. NULL pages in the array. When reading a block (default 128K), squashfs tries to grab all the pages covering this block. If a single page is up-to-date or locked, it falls back to using an intermediate buffer to do the read and then copy the pages in the actor. Allowing holes in the page actor remove the need for this intermediate buffer. 3/ Refactor the wrappers to share code that deals with page actors. Signed-off-by: Adrien Schildknecht <adriens@google.com> Change-Id: I73f736611766962857c423320478af8cfab8df38
* Squashfs: Directly decompress into the page cache for file dataPhillip Lougher2017-04-111-0/+100
This introduces an implementation of squashfs_readpage_block() that directly decompresses into the page cache. This uses the previously added page handler abstraction to push down the necessary kmap_atomic/kunmap_atomic operations on the page cache buffers into the decompressors. This enables direct copying into the page cache without using the slow kmap/kunmap calls. The code detects when multiple threads are racing in squashfs_readpage() to decompress the same block, and avoids this regression by falling back to using an intermediate buffer. This patch enhances the performance of Squashfs significantly when multiple processes are accessing the filesystem simultaneously because it not only reduces memcopying, but it more importantly eliminates the lock contention on the intermediate buffer. Using single-thread decompression. dd if=file1 of=/dev/null bs=4096 & dd if=file2 of=/dev/null bs=4096 & dd if=file3 of=/dev/null bs=4096 & dd if=file4 of=/dev/null bs=4096 Before: 629145600 bytes (629 MB) copied, 45.8046 s, 13.7 MB/s After: 629145600 bytes (629 MB) copied, 9.29414 s, 67.7 MB/s Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk> Reviewed-by: Minchan Kim <minchan@kernel.org> Change-Id: I6e53be0b49ef135d633e08effdb51e7354253cf7