All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jann Horn <jannh@google.com>
To: Zhaoxiu Zeng <zengzhaoxiu@163.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	kernel list <linux-kernel@vger.kernel.org>,
	Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
Subject: Re: [PATCH 2/3] lib: zlib_inflate: improves decompression performance
Date: Thu, 12 Nov 2020 01:06:32 +0100	[thread overview]
Message-ID: <CAG48ez1O-mVnkFdbt5To7XucyFSVtJO0prv6DLjQuwfZDzGz3A@mail.gmail.com> (raw)
In-Reply-To: <2442c8fb-ff36-41ce-9349-d162639d5c3b@163.com>

On Wed, Nov 11, 2020 at 5:06 PM Zhaoxiu Zeng <zengzhaoxiu@163.com> wrote:
> 在 2020/11/11 11:46, Jann Horn 写道:
> > On Mon, Nov 9, 2020 at 8:27 PM <zengzhaoxiu@163.com> wrote:
> >> This patch does:
> >> 1. Cleanup code and reduce branches
> >> 2. Use copy_from_back to copy the matched bytes from the back output buffer
> >
> > What exactly is copy_from_back()? Is it like memmove()? If yes, have
> > you tried using memmove() instead of the code added in patch 1/3?
> >
>
> If use memcpy(or memmove), the code will be like this:
>         while (dist < len) {
>                 memcpy(out, out - dist, dist);
>                 out += dist;
>                 len -= dist;
>         }
>         memcpy(out, out - dist, len);

Ah, thanks. So basically it means: "repeatedly copy a pattern of
length `dist` from `out-dist` to `out` until `len` bytes have been
written"

  reply	other threads:[~2020-11-12  1:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 19:16 [PATCH 1/3] lib: Introduce copy_from_back() zengzhaoxiu
2020-11-09 19:25 ` [PATCH 2/3] lib: zlib_inflate: improves decompression performance zengzhaoxiu
2020-11-11  3:46   ` Jann Horn
2020-11-11 16:06     ` Zhaoxiu Zeng
2020-11-12  0:06       ` Jann Horn [this message]
2020-11-12  6:45   ` [lib] 6ee736dc92: BUG:unable_to_handle_page_fault_for_address kernel test robot
2020-11-16 17:32     ` Zhaoxiu Zeng
2020-11-09 19:28 ` [PATCH 3/3] lib: lzo: Improves decompression performance zengzhaoxiu
2020-11-16 16:35 ` [PATCH 1/3] lib: Introduce copy_from_back() Christoph Hellwig
2020-11-16 17:22   ` Zhaoxiu Zeng
2020-11-16 17:24     ` Christoph Hellwig
2020-11-18 15:10       ` Zhaoxiu Zeng

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=CAG48ez1O-mVnkFdbt5To7XucyFSVtJO0prv6DLjQuwfZDzGz3A@mail.gmail.com \
    --to=jannh@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zengzhaoxiu@163.com \
    --cc=zhaoxiu.zeng@gmail.com \
    /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.