Received: by 2002:a89:2d5:0:b0:1ef:f8eb:5d24 with SMTP id d21csp176438lqs; Sun, 17 Mar 2024 16:48:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCtc/cEi1lOP0PSKdAP4XDamV32lrVhVazbHIeViDd/qpO5Y4q74xqC72Gm9zHBS3HSu7Ln1qhwddOaHxZsZ1DD3H3Zi7au5YG/9lCDQ== X-Google-Smtp-Source: AGHT+IGjgmMeEUyfpnakjHVYdAuukb09s0xz/FsF31vJrj5OAYyAuggHczgvZXihwabVjq6TMM++ X-Received: by 2002:a0d:e611:0:b0:60a:68ab:912 with SMTP id p17-20020a0de611000000b0060a68ab0912mr10773550ywe.1.1710719324542; Sun, 17 Mar 2024 16:48:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710719324; cv=pass; d=google.com; s=arc-20160816; b=lnZitXnpkNLgZZXC3KqT9euUVf5xT4mK346Y9bDVNyUBS7BgmRCA3jLZ2hihtT9hpp MZfeOneiaDVv3WR4Hm/y2OZ2vBJmlpYeXPh4cdQevWcDO7Px2HkV11u2cG7KC+7fZSqn 5kU3x0anmj2VmIJkdjdSEHwn3KWujJGn2jrgh71gFj4PaQlZP41Ozeml5RtyG2Kn7xiU OBongB5fNZ5uLQJLhraa0XIILzYTG3FLhKSeWEBol95kNwAQ8CIqh/P+aqSjDuUEIE7j 70tKE+LZ+rui6TkJkWaOWvisjOUUMCiQlH5ybnlmxG1N5fAHF95PSuE30Vc5f6jbqkJ5 mBCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=vQpp+74tvU0a57ZrnFOzkp0hvnhi1SaTowYXx4QiuKQ=; fh=7gHPxDJ3k65XWQ0Gvi3EDl7J0iRdgV1ah6u/T4K3Smw=; b=MRFqWX3aEPGC7gmCy+NXNK1opCI5oJfGwSvM4McWJJc/m5EXj91EoKGfrmGh3hWcJA yHeOfd7iqlhcPvMmUBB0rHI0aVZaDVl2gxCWpv6MNfNvklgPMdTGbO58CImtHzZ16r8l zfbP97JQ3Rpvh84pJ64e8BxWrK9vktDnbqsTEQ3fIZQW0O3knlADefpNj+snbTYNKnY+ 10sDrm4pH1TLzRcfoT1MXjBTDExNy/pcTTmk/bDHTKCJ80Be1BUgJzTaX5tDcbkdVIoU +akXu4Vw4YpGY/7wITFJFoxvA4OqYXflzoA6zzBCpnFvldVwx0uoaY5VIH2u4bkADTlU Qf0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OjSOhwpj; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-105595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u7-20020a05622a010700b0042ee3385939si8790831qtw.560.2024.03.17.16.48.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 16:48:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OjSOhwpj; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-105595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CE6ED1C21282 for ; Sun, 17 Mar 2024 23:48:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B878E22091; Sun, 17 Mar 2024 23:48:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OjSOhwpj" Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72A951D530; Sun, 17 Mar 2024 23:48:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710719315; cv=none; b=tZJEB771uIvMwGN6b9tERTIGl9r9zjlUsOTChqcKdW5PLyTVZyRXLT5DhL912t+ZAABqYObRGLbEFaSelUQEPTGWC7t6U02iA78eT2Pu3smracUa5UMDj9OosjdVb8cDjXw06SNZfnhN7HqKdRVQ5veOnhF8w9XzI7BQhYhFdgQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710719315; c=relaxed/simple; bh=ha4B0JyJqZfkmKdYnAOTVN8AviIgf2IXn+5u7lPWhck=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DM65czAQ34ToBeFHtZohaT64t0fF1+bnuLUmD7J+vjNaITaGnBPZmr/CTEV8wAiA8rhOIVp3ozVZr3BIw7xKi57BTygFGfYnhQK13y8wITumhgnpgNmLXH0jRme/9EI7mlMxvqPNq+nNn6nNtQdPk1XeTzMTFkgaHyxQdPvrMj4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OjSOhwpj; arc=none smtp.client-ip=209.85.217.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-4767bf3e2a2so473072137.2; Sun, 17 Mar 2024 16:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710719312; x=1711324112; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vQpp+74tvU0a57ZrnFOzkp0hvnhi1SaTowYXx4QiuKQ=; b=OjSOhwpjqTSYbgY8yBHfhAMPUuLKc5jZJlEodNRFOaKFf1spFH04tGS0ytFHxNUYIq Y0CgJE6uTnDRTMMPX6r81pXVtHt3XXF7s7TZI4MCGDJAbkXOkPuLDmOHdMo4hpAV7UOl ECPjU1DtoPefG9+Vnnv+hyES9ILQhSn+vRd9b0fhzfLYT63g2v9/rOH32LWIVGZU3TuA gJncYGHkR2UDvd/o7kAgaU6No1enQyDHRBTbvaptxhC5KrlZzdDWAhAfoPdwZdkHjLm5 iMcp/y/MIicQOiUBSGmM8mnym/4TZ9vpaQADzvlauFsY3sxdsKiaWJV83+giaxxuyear VTRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710719312; x=1711324112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vQpp+74tvU0a57ZrnFOzkp0hvnhi1SaTowYXx4QiuKQ=; b=wCCjINA7q5Tqaz+INIJdU/6ZFXHdAFGGP6rBJrTuE1N/nKUK+EBU8qxaAS0i1nWXLE 2BkZwMTcaeArXhg3uqPsXpcidoVJnfSXAUAI5LF4K9YlKQ9aAmxmEwMGZ7cZ9CBaq0kz GtwesUKo9xXjeTkuOLehNpktkYhjEwF51TVykXbRLxj0LUIZwJVTWVCvQizE+hFCFZ7m 7Yul4K1hwOtMa+hrYswaftsu6u/e/P6A/PfPWxTQ+vYWmeJUdSV2ikr0W7FXOJUau+fv 8LNWrN1RizueXVEzeNrdRiJFJDChH5ewoE0K0cF82RML/UXxfqwHVySF9wlkDBnZw3nP aWnQ== X-Forwarded-Encrypted: i=1; AJvYcCXTMcaJ8iaN/TVi+y911lEKxkg8o9oq7jZGB4bb8zWCUSZcPWI7ibx5GTNTtGHmTfVtWyb6UDfMJvOsgRJ74wla0jIndCHiP8PV9ddTAZGVH9dSMChbrtXnRDNYPgLz/eLEFG+WKIqi3d6G X-Gm-Message-State: AOJu0YzanAWVjjEp3xgfSV7OAkE5ulCmU8GLfaKAgG3yNC82KZI0BAIS FN6yCKzARV1WdpmWQ2BgsOwvIrzkhi2XhEQb7GZNmWcmCcrKOAKFgPU03vOdaxNLGvU9pZFqybJ v1paAqZXkg01hYBLCK3/Z2unULHs= X-Received: by 2002:a67:f415:0:b0:474:c475:6cf3 with SMTP id p21-20020a67f415000000b00474c4756cf3mr9130062vsn.6.1710719312280; Sun, 17 Mar 2024 16:48:32 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240301192745.14987-1-21cnbao@gmail.com> In-Reply-To: From: Barry Song <21cnbao@gmail.com> Date: Mon, 18 Mar 2024 07:48:19 +0800 Message-ID: Subject: Re: [PATCH v7] crypto: scompress: remove memcpy if sg_nents is 1 and pages are lowmem To: Guenter Roeck 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 , Johannes Weiner , Nhat Pham , Yosry Ahmed , Chengming Zhou Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 18, 2024 at 7:13=E2=80=AFAM Guenter Roeck = wrote: > > 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_re= q *req, int dir) > > ret =3D -ENOSPC; > > goto out; > > } > > - scatterwalk_map_and_copy(scratch->dst, req->dst, 0, req->= dlen, > > - 1); > > + if (dst =3D=3D scratch->dst) { > > + scatterwalk_map_and_copy(scratch->dst, req->dst, = 0, > > + req->dlen, 1); > > + } else { > > + int nr_pages =3D DIV_ROUND_UP(req->dst->offset + = req->dlen, PAGE_SIZE); > > + int i; > > + struct page *dst_page =3D sg_page(req->dst); > > + > > + for (i =3D 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 Hi Guenter, this is a bug of xtensa, could you test the patch: https://lore.kernel.org/all/20240313045036.51065-1-21cnbao@gmail.com/ > > 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 Thanks Barry