Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3899140ybi; Mon, 3 Jun 2019 02:07:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw90BlKH3EgVorCIaj5oRt01+jCbhtAEtqvmiL1eUWonnkQbhA0oIw3vyyB+bRNpsJ4E551 X-Received: by 2002:a17:90a:ba96:: with SMTP id t22mr28437826pjr.143.1559552861317; Mon, 03 Jun 2019 02:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559552861; cv=none; d=google.com; s=arc-20160816; b=zr8zGrjYMQuZfzZpb5PNV/WOLzc7d2NDhoGN6aQ5HqDE2v+EEakRjVQB08jCk72VHB 26RMgOvNR1ZB05PAqBwqt+P91yMm14LRYUAKrXp6bTV1qC7B/HnHden28vujlpVT3cTP 6WYo5gBqFmCGVuTc2wVbSBIgyJ3ajhrVEU0CXG/UwKUJfDN3ouQ1vdcG86GJm6pHD+RX r8VwYsBVKBGAxMPnzk8QfjV6XoWlN77LW5Xp2wtG/cuXdlcySl3MGCGKSu4DeOvD9Uyk pcdJTtFXJyETHGkaYaJMrGDCePGcskfkGXNetrHmKHFQR/q8UJWpyMZM6Cqys+2UYpH1 jIFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=x9TvWZRKI+58saE3CQvcUnn9RCw3ppnUZs9YYIiiZ/I=; b=XkOobcclI0AYfSYgzC/S3kaQvMwLKh1n5NAtCmXdiFQstTrhA2hK28PTKMzZ734PpQ mrhCeYqmg5Wcnt5x3fBmTUgSh/on2FzzMMeQLsqI234TRbF3FVteB3jlt0hXYiO3Dgz4 Vrheddx8Wd4gvt/9ZMqyXo3aHrP8rMMKxap1sNaFBw/ErU9ifGemWWhuFkpqVi5/i+9z yOwhTCv7jFIV2SgCW5YGPaWwqIIvC8n9Ka4wzKA7HolWaQDf/VUe6h/JOXtud2Qlz+0Z 5SN7AYKhHt6c1sgssSHgxHiww/lO6Uc5creAuJ7+YYuRSjp2DEYJNCR06FuYnK4v1dk6 IPXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=oZefJvOl; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d124si20669463pfd.29.2019.06.03.02.07.20; Mon, 03 Jun 2019 02:07:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=oZefJvOl; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726710AbfFCJHB (ORCPT + 99 others); Mon, 3 Jun 2019 05:07:01 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:45270 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbfFCJHB (ORCPT ); Mon, 3 Jun 2019 05:07:01 -0400 Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190603090658epoutp025b42b9494ddb70c38fb85b0aa8da0aff~kpQaA3ns52419024190epoutp02F for ; Mon, 3 Jun 2019 09:06:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190603090658epoutp025b42b9494ddb70c38fb85b0aa8da0aff~kpQaA3ns52419024190epoutp02F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1559552818; bh=x9TvWZRKI+58saE3CQvcUnn9RCw3ppnUZs9YYIiiZ/I=; h=From:To:Cc:Subject:Date:References:From; b=oZefJvOlU8qpcdJ8UNkf5ziPhZ7lXJWL+BQWD1roKRC3tBS4FZbD82qhBAjYCjt+Y E04ke0Bhc669EG7WVABM/qp6lTp6btu1E1n8juZGBlEKmcLc//B10w/Z1BA+1rd6nC XHMDoYRV+Cuw7BCpeeN9l/+WPXiDOI/WB++sQ/8I= Received: from epsmges5p3new.samsung.com (unknown [182.195.40.195]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20190603090656epcas5p2aed2847ba654ce4870bdaecf271597b6~kpQX3QFs-1305313053epcas5p2L; Mon, 3 Jun 2019 09:06:56 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 1A.D9.04067.F23E4FC5; Mon, 3 Jun 2019 18:06:55 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20190603090227epcas5p348327061a3facbb9dfcf662bf2bc196e~kpMePusAL2178021780epcas5p3h; Mon, 3 Jun 2019 09:02:27 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190603090227epsmtrp1e61081ec8c23756baee30b24a93169f1~kpMeO4VwJ1674016740epsmtrp1f; Mon, 3 Jun 2019 09:02:27 +0000 (GMT) X-AuditID: b6c32a4b-7a3ff70000000fe3-ae-5cf4e32fb70b Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 64.FB.03662.322E4FC5; Mon, 3 Jun 2019 18:02:27 +0900 (KST) Received: from localhost.localdomain (unknown [107.109.224.135]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190603090225epsmtip20d2b100d394310406c978ae5d0230e39~kpMcNWAC11650516505epsmtip2l; Mon, 3 Jun 2019 09:02:25 +0000 (GMT) From: Maninder Singh To: akpm@linux-foundation.org, herbert@gondor.apana.org.au, davem@davemloft.net, keescook@chromium.org, gustavo@embeddedor.com Cc: joe@perches.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, a.sahrawat@samsung.com, pankaj.m@samsung.com, v.narang@samsung.com, Maninder Singh Subject: [PATCH 0/4] zstd: reduce stack usage Date: Mon, 3 Jun 2019 14:32:02 +0530 Message-Id: <1559552526-4317-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0gUURj17oyzY7QyrVY3S9kmljBfu9ra9DB7mAwotNWfCMNGvai0Ozvt 7FYGgYUZaWmGYrmWQhQpPU1Dd83HWqRRhpWaFWpaUT4oUyMrqt0do/6d77vn3HPudz8SU+YQ AWQmb0FmnjPQxBz8TltwcFjE8FSSxvZyLdPlQEz5jasEU/4kB2fqGtVM/sgSxjYwjDOP8o3M QP+MjHlmLyeYtopcnOkfq5Mxzo7zYMNc1pbdhbO1VX0y9nqrmr3Tombbz/7A2anqHowtqK0G 7GRNkJ7cZViXgbg0ZFYhPtWUlsmnx9AJO5I3J+uiNdow7WpmFa3iOSOKoeMS9WHxmQZXUFq1 nzNYXS09J4p0xPp1ZpPVglQZJtESQyMhzSBoI4VwkTOKVj49PNVkXKPVaCJ1LuYeQ0b/p3xC aKAOlvy2ZIPLvnnAh4TUSlg1UEzkgTmkknIA+L35KS4VXwC85Wgh3Cwl9RXAnJqQPEB6FO3d yyTOXQDflI3LJc40gDOlWW5MUOGw2t7oucifygawv7sIuAuMagXwXe5F4Gb5UWHQ8euxxwGn 1HDg0XMPVlDxsKD1m0zKFwT7Ok9gbjGk6gn4frzSWzqIg52FTwkJ+8GRB7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Xz2pwRO01qp0JmOOwPWiC7/wul5wMA2cW3obwfnf2mt8WZlfIWnOq+k qkVqMgcKnbVJbG58cPXpPa3Cq6YqbJKNvx9prDnVonWmfnrcUyaHw/bft/C8Wsir7p96gpd/ Bc/jeSb8B25y3hDcdcjt2h9FByWW4oxEQy3mouJEAGzeAMBBAgAA X-CMS-MailID: 20190603090227epcas5p348327061a3facbb9dfcf662bf2bc196e X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190603090227epcas5p348327061a3facbb9dfcf662bf2bc196e References: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch set reduces stack usage for zstd code, because target like ARM has limited 8KB kernel stack, which is getting overflowed due to hight stack usage of zstd code with call flow like: .... .... (FSE_compress_usingCTable) from (HUF_compressWeights_wksp+0x140/0x200) (HUF_compressWeights_wksp) from (HUF_writeCTable_wksp+0xdc/0x1c8) (HUF_writeCTable_wksp) from (HUF_compress4X_repeat+0x214/0x450) (HUF_compress4X_repeat) from (ZSTD_compressBlock_internal+0x228/0x135c) (ZSTD_compressBlock_internal) from (ZSTD_compressContinue_internal+0x1f8/0x3c8) (ZSTD_compressContinue_internal) from (ZSTD_compressCCtx+0xc0/0x1cc) (ZSTD_compressCCtx) from (zstd_compress+0x90/0xa8) (zstd_compress) from (crypto_compress+0x2c/0x34) (crypto_compress) from (zcomp_compress+0x3c/0x44) (zcomp_compress) from (zram_bvec_rw+0x2f8/0xa7c) (zram_bvec_rw) from [] (zram_rw_page+0x104/0x170) (zram_rw_page) from [] (bdev_write_page+0x80/0xb4) (bdev_write_page) from [] (__swap_writepage+0x160/0x29c) (__swap_writepage) from [] (swap_writepage+0x3c/0x58) (swap_writepage) from [] (shrink_page_list+0x788/0xae0) (shrink_page_list) from [] (shrink_inactive_list+0x210/0x4a8) (shrink_inactive_list) from [] (shrink_zone+0x53c/0x7c0) (shrink_zone) from [] (try_to_free_pages+0x2fc/0x7cc) (try_to_free_pages) from [] (__alloc_pages_nodemask+0x534/0x91c) (__alloc_pages_nodemask) from [] (pagecache_get_page+0xe0/0x1d8) .... .... Maninder Singh, Vaneet Narang (4): zstd: pass pointer rathen than structure to functions zstd: use U16 data type for rankPos zstd: move params structure to global variable to reduce stack usage zstd: change structure variable from int to char crypto/zstd.c | 11 ++++--- include/linux/zstd.h | 16 +++++----- lib/zstd/compress.c | 85 +++++++++++++++++++++++++------------------------ lib/zstd/decompress.c | 2 +- lib/zstd/huf_compress.c | 4 +-- 5 files changed, 62 insertions(+), 56 deletions(-) -- 2.7.4