All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Barry Song <21cnbao@gmail.com>
Cc: herbert@gondor.apana.org.au, davem@davemloft.net,
	linux-crypto@vger.kernel.org, akpm@linux-foundation.org,
	chrisl@kernel.org, sjenning@redhat.com, vitaly.wool@konsulko.com,
	linux-kernel@vger.kernel.org, Barry Song <v-songbaohua@oppo.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Nhat Pham <nphamcs@gmail.com>,
	Yosry Ahmed <yosryahmed@google.com>,
	Chengming Zhou <zhouchengming@bytedance.com>
Subject: Re: [PATCH v7] crypto: scompress: remove memcpy if sg_nents is 1 and pages are lowmem
Date: Sun, 17 Mar 2024 16:13:47 -0700	[thread overview]
Message-ID: <aaa8b7d7-5abe-47bf-93f6-407942436472@roeck-us.net> (raw)
In-Reply-To: <20240301192745.14987-1-21cnbao@gmail.com>

Hi,

On Sat, Mar 02, 2024 at 08:27:45AM +1300, Barry Song wrote:
[ ... ]
> @@ -152,8 +165,17 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
>  			ret = -ENOSPC;
>  			goto out;
>  		}
> -		scatterwalk_map_and_copy(scratch->dst, req->dst, 0, req->dlen,
> -					 1);
> +		if (dst == scratch->dst) {
> +			scatterwalk_map_and_copy(scratch->dst, req->dst, 0,
> +						 req->dlen, 1);
> +		} else {
> +			int nr_pages = DIV_ROUND_UP(req->dst->offset + req->dlen, PAGE_SIZE);
> +			int i;
> +			struct page *dst_page = sg_page(req->dst);
> +
> +			for (i = 0; i < nr_pages; i++)
> +				flush_dcache_page(dst_page + i);

flush_dcache_page() is an empty macro on some architectures
such as xtensa. This results in

Building xtensa:allmodconfig ... failed
--------------
Error log:
crypto/scompress.c: In function 'scomp_acomp_comp_decomp':
crypto/scompress.c:174:38: error: unused variable 'dst_page'

on the affected architectures.

Guenter

  parent reply	other threads:[~2024-03-17 23:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 19:27 [PATCH v7] crypto: scompress: remove memcpy if sg_nents is 1 and pages are lowmem Barry Song
2024-03-08 11:26 ` Herbert Xu
2024-03-17 23:13 ` Guenter Roeck [this message]
2024-03-17 23:48   ` Barry Song
2024-03-18  0:13     ` Guenter Roeck
2024-03-18  0:21       ` Barry Song
2024-03-18  0:33         ` Guenter Roeck

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=aaa8b7d7-5abe-47bf-93f6-407942436472@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chrisl@kernel.org \
    --cc=davem@davemloft.net \
    --cc=hannes@cmpxchg.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nphamcs@gmail.com \
    --cc=sjenning@redhat.com \
    --cc=v-songbaohua@oppo.com \
    --cc=vitaly.wool@konsulko.com \
    --cc=yosryahmed@google.com \
    --cc=zhouchengming@bytedance.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.