linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Barry Song <song.bao.hua@hisilicon.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, linuxarm@huawei.com,
	"Luis Claudio R . Goncalves" <lgoncalv@redhat.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"David S . Miller" <davem@davemloft.net>,
	Mahipal Challa <mahipalreddy2006@gmail.com>,
	Seth Jennings <sjenning@redhat.com>,
	Dan Streetman <ddstreet@ieee.org>,
	Vitaly Wool <vitaly.wool@konsulko.com>,
	Zhou Wang <wangzhou1@hisilicon.com>,
	Colin Ian King <colin.king@canonical.com>
Subject: Re: [PATCH v3] mm/zswap: move to use crypto_acomp API for hardware acceleration
Date: Fri, 26 Jun 2020 17:20:27 +1000	[thread overview]
Message-ID: <20200626072027.GA6153@gondor.apana.org.au> (raw)
In-Reply-To: <20200626070903.27988-1-song.bao.hua@hisilicon.com>

On Fri, Jun 26, 2020 at 07:09:03PM +1200, Barry Song wrote:
>
> +	mutex_lock(&acomp_ctx->mutex);
> +
> +	src = kmap(page);
> +	dst = acomp_ctx->dstmem;
> +	sg_init_one(&input, src, PAGE_SIZE);
> +	/* zswap_dstmem is of size (PAGE_SIZE * 2). Reflect same in sg_list */
> +	sg_init_one(&output, dst, PAGE_SIZE * 2);
> +	acomp_request_set_params(acomp_ctx->req, &input, &output, PAGE_SIZE, dlen);
> +	ret = crypto_wait_req(crypto_acomp_compress(acomp_ctx->req), &acomp_ctx->wait);
> +	dlen = acomp_ctx->req->dlen;
> +	kunmap(page);

Waiting on an async request like this is just silly.  This defeats
the whole purpose of having a fallback.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


  reply	other threads:[~2020-06-26  7:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  7:09 Barry Song
2020-06-26  7:20 ` Herbert Xu [this message]
2020-06-26  7:54   ` Song Bao Hua (Barry Song)
2020-06-26  8:22   ` Song Bao Hua (Barry Song)

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=20200626072027.GA6153@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=ddstreet@ieee.org \
    --cc=lgoncalv@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxarm@huawei.com \
    --cc=mahipalreddy2006@gmail.com \
    --cc=sjenning@redhat.com \
    --cc=song.bao.hua@hisilicon.com \
    --cc=vitaly.wool@konsulko.com \
    --cc=wangzhou1@hisilicon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox