[to-be-updated] zstd-move-params-structure-to-global-variable-to-reduce-stack-usage.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: crypto/zstd.c: move params structure to global variable to reduce stack usage
has been removed from the -mm tree.  Its filename was
     zstd-move-params-structure-to-global-variable-to-reduce-stack-usage.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Maninder Singh <maninder1.s@xxxxxxxxxxx>
Subject: crypto/zstd.c: move params structure to global variable to reduce stack usage

As params structure remains same for lifetime, just initialise it
at init time and make it global variable.

Link: http://lkml.kernel.org/r/1559552526-4317-4-git-send-email-maninder1.s@xxxxxxxxxxx
Signed-off-by: Maninder Singh <maninder1.s@xxxxxxxxxxx>
Signed-off-by: Vaneet Narang <v.narang@xxxxxxxxxxx>
Cc: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Cc: David S. Miller <davem@xxxxxxxxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
Cc: Joe Perches <joe@xxxxxxxxxxx>
Cc: Amit Sahrawat <a.sahrawat@xxxxxxxxxxx>
Cc: <pankaj.m@xxxxxxxxxxx>
Cc: Vaneet Narang <v.narang@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 crypto/zstd.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/crypto/zstd.c~zstd-move-params-structure-to-global-variable-to-reduce-stack-usage
+++ a/crypto/zstd.c
@@ -24,6 +24,8 @@ struct zstd_ctx {
 	void *dwksp;
 };
 
+static ZSTD_parameters params;
+
 static ZSTD_parameters zstd_params(void)
 {
 	return ZSTD_getParams(ZSTD_DEF_LEVEL, 0, 0);
@@ -32,8 +34,10 @@ static ZSTD_parameters zstd_params(void)
 static int zstd_comp_init(struct zstd_ctx *ctx)
 {
 	int ret = 0;
-	const ZSTD_parameters params = zstd_params();
-	const size_t wksp_size = ZSTD_CCtxWorkspaceBound(params.cParams);
+	size_t wksp_size;
+
+	params = zstd_params();
+	wksp_size = ZSTD_CCtxWorkspaceBound(params.cParams);
 
 	ctx->cwksp = vzalloc(wksp_size);
 	if (!ctx->cwksp) {
@@ -152,7 +156,6 @@ static int __zstd_compress(const u8 *src
 {
 	size_t out_len;
 	struct zstd_ctx *zctx = ctx;
-	const ZSTD_parameters params = zstd_params();
 
 	out_len = ZSTD_compressCCtx(zctx->cctx, dst, *dlen, src, slen, &params);
 	if (ZSTD_isError(out_len))
_

Patches currently in -mm which might be from maninder1.s@xxxxxxxxxxx are

zstd-pass-pointer-rathen-than-structure-to-functions.patch
zstd-change-structure-variable-from-int-to-char.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux