All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Phillip Lougher <phillip@squashfs.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] Squashfs: Directly decompress into the page cache for file data (V3)
Date: Tue, 19 Nov 2013 17:17:19 +0900	[thread overview]
Message-ID: <20131119081719.GX4407@bbox> (raw)
In-Reply-To: <1384406059-28567-4-git-send-email-phillip@squashfs.org.uk>

On Thu, Nov 14, 2013 at 05:14:18AM +0000, Phillip Lougher wrote:
> 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
> 
> V3:
>   * Kconfig: fix mempcpy typo
>   * squashfs_readpage_block(): Do not zero pages on decompress error
>   * squashfs_read_cache(): free page in caller not here
>   * page_actor.c: add comment regarding sleeping
>   * page_actor.c: optimise code slightly
> 
> Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Reviewed-by: Minchan Kim <minchan@kernel.org>

-- 
Kind regards,
Minchan Kim

  reply	other threads:[~2013-11-19  8:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14  5:14 [PATCH 0/4] Squashfs: performance improvement patches (V3) Phillip Lougher
2013-11-14  5:14 ` [PATCH 1/4] Squashfs: Refactor decompressor interface and code (V3) Phillip Lougher
2013-11-19  8:07   ` Minchan Kim
2013-11-14  5:14 ` [PATCH 2/4] Squashfs: Generalise paging handling in the decompressors (V3) Phillip Lougher
2013-11-19  8:10   ` Minchan Kim
2013-11-14  5:14 ` [PATCH 3/4] Squashfs: Directly decompress into the page cache for file data (V3) Phillip Lougher
2013-11-19  8:17   ` Minchan Kim [this message]
2013-11-14  5:14 ` [PATCH 4/4] Squashfs: Check stream is not NULL in decompressor_multi.c Phillip Lougher
2013-11-19  8:18   ` Minchan Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131119081719.GX4407@bbox \
    --to=minchan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillip@squashfs.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.