Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1807853rdb; Tue, 3 Oct 2023 01:13:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEliZM92PetC4R6NwV70Rt8GtGbfiETpCYtzcYTkspgHMpI1bHaJC2F5MmMVo9RP3SPsRKj X-Received: by 2002:a05:6a20:549a:b0:133:8784:15f7 with SMTP id i26-20020a056a20549a00b00133878415f7mr3116088pzk.14.1696320811807; Tue, 03 Oct 2023 01:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696320811; cv=none; d=google.com; s=arc-20160816; b=xfB+Ea/hhQ4x6ZML+IIum8ba5i4HzS1npWOGFMpwff2+jmtEKYEVoACQ5eBXqTfOPi UJtQ7VKRd9NeGGxVmVWuhbpQAO2OPLZLXdySccAdubQLKbhFAgsD63rTQeQnylWmzTi9 U2aLL7wlpWbKbcCC5HMNvHUiTRKKRM3dz61hGZLnDdg2Ty3mnO4Ax0JKrwLXdUg6qTYN 0ULmJPY/ivsGAW9sF9eAjLQIFAmWkDXgk5THlLpge6xtXR+JndBf5qEy1cHMpyk1YHL7 P3r2p9SkOIOH2GxHh0N7u05DXTeVe9cB2X03XjyJFznIYoki8LDLo+HWZosUg7uJG8Sm wL4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5n3qb3b+RTOFdY1QjE2GxrPwNaTfoq/sfZG5D1vc39g=; fh=OE7zQBGyiR7KOI/Pj1e5N36lEgGjWrcfTGTL3E5GX0M=; b=s5l1n+Z0E3W9BesBIp7yWgQvR5SlKjcgOjLrQM0EuLcMek6FCuA5jTKqiqVL5kWfAm eznBU2RTw5axUK+2L+TwnwyuGR6/N3hBv43jFj2+eD5j2BwmX4ouWst+mquyAr5yp+ee CitdOpeWwAe80U8r081np3DVfbgCUiGQ17kQXJsqXKzJCkpEn9wpsdKmLUjiXES5+Sds icgJEYbs26xM59NjDMNjPMFCERohZ27SKPu82KQf8WTt+ORrwBxXYpfwEK5g3nUCvZVX LbXPSHYmY5+xnjrnNuQ5u2x9u9Lna/Clo1INViKLLWgzxz9reNXNMZgXLAGTX75VgAEH b2lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ICv1ljB6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id az1-20020a056a02004100b00578d1b590b0si959890pgb.699.2023.10.03.01.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 01:13:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ICv1ljB6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BCC84802617F; Tue, 3 Oct 2023 01:13:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231425AbjJCINW (ORCPT + 99 others); Tue, 3 Oct 2023 04:13:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239290AbjJCINO (ORCPT ); Tue, 3 Oct 2023 04:13:14 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A14E43581; Tue, 3 Oct 2023 01:11:06 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39388sFc005589; Tue, 3 Oct 2023 08:09:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=5n3qb3b+RTOFdY1QjE2GxrPwNaTfoq/sfZG5D1vc39g=; b=ICv1ljB6s5z/V4FB9lKlOgu3FFQEiCeMkfbLXhhWYfHUlLQ4YipXe6BXBBXtbC9EY4EL HjpWMtUgUakUnbslHqvn/XsO4BGJD37jrimJ4LrbDPWQ5JmDk86dia5z9OC6V3JJpC0v dCnU/dyw3fg0OeEL4xFDbWtu0M8ZgXabxb/zHD3BpJxKdzi06msBtPO2NrmQa/lleweh n5XxXhLWlDDK4TEOj6b1JTtTuBDKVeGVAqoBJRF6Ypseb845kC7WV2L0HXunIatl4qsh ur9hW0fjNA3P0oopCY+f3qmqKaVak+dUDqyG/nGKPofRynoj5lOaD7E8wUw4//tVzYD9 Bg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tgaw5gfd2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Oct 2023 08:09:57 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39389tKw000532 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Oct 2023 08:09:55 GMT Received: from hu-pkondeti-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Tue, 3 Oct 2023 01:09:49 -0700 Date: Tue, 3 Oct 2023 13:39:46 +0530 From: Pavan Kondeti To: Nikhil V CC: Pavel Machek , Len Brown , "Rafael J. Wysocki" , Jonathan Corbet , "Catalin Marinas" , Randy Dunlap , Peter Zijlstra , "Steven Rostedt (Google)" , "Paul E. McKenney" , Tejun Heo , , , , , , , , , Subject: Re: [RFC PATCH 0/4] PM: hibernate: LZ4 compression support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 5QWevzHVVa8fa4jX_ruVFYCOq2kxzCxw X-Proofpoint-GUID: 5QWevzHVVa8fa4jX_ruVFYCOq2kxzCxw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-03_04,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 phishscore=0 priorityscore=1501 clxscore=1011 impostorscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310030056 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 01:13:31 -0700 (PDT) On Tue, Sep 26, 2023 at 02:27:10PM +0530, Nikhil V wrote: > This patch series covers the following: > 1. Renaming lzo* to generic names, except for lzo_xxx() APIs. This is > used in the next patch where we move to crypto based APIs for > compression. There are no functional changes introduced by this > approach. > > > 2. Replace LZO library calls with crypto generic APIs > > Currently for hibernation, LZO is the only compression algorithm > available and uses the existing LZO library calls. However, there > is no flexibility to switch to other algorithms which provides better > results. The main idea is that different compression algorithms have > different characteristics and hibernation may benefit when it uses > alternate algorithms. > > By moving to crypto based APIs, it lays a foundation to use other > compression algorithms for hibernation. > > > 3. LZ4 compression > Extend the support for LZ4 compression to be used with hibernation. > The main idea is that different compression algorithms > have different characteristics and hibernation may benefit when it uses > any of these algorithms: a default algorithm, having higher > compression rate but is slower(compression/decompression) and a > secondary algorithm, that is faster(compression/decompression) but has > lower compression rate. > > LZ4 algorithm has better decompression speeds over LZO. This reduces > the hibernation image restore time. > As per test results: > LZO LZ4 > Size before Compression(bytes) 682696704 682393600 > Size after Compression(bytes) 146502402 155993547 > Decompression Rate 335.02 MB/s 501.05 MB/s > Restore time 4.4s 3.8s > > LZO is the default compression algorithm used for hibernation. Enable > CONFIG_HIBERNATION_DEF_COMP_LZ4 to set the default compressor as LZ4. > > Compression Benchmarks: https://github.com/lz4/lz4 > > 4. Support to select compression algorithm > > Currently the default compression algorithm is selected based on Kconfig. > Introduce a kernel command line parameter "hib_compression" to > override this behaviour. > > Users can set "hib_compression" command line parameter to specify > the algorithm. > Usage: > LZO: hib_compression=lzo > LZ4: hib_compression=lz4 > LZO is the default compression algorithm used with hibernation. > > Nikhil V (4): > PM: hibernate: Rename lzo* to make it generic > PM: hibernate: Move to crypto APIs for LZO compression > PM: hibernate: Add support for LZ4 compression for hibernation > PM: hibernate: Support to select compression algorithm > > .../admin-guide/kernel-parameters.txt | 6 + > kernel/power/Kconfig | 25 ++- > kernel/power/hibernate.c | 83 +++++++- > kernel/power/power.h | 19 ++ > kernel/power/swap.c | 189 +++++++++++------- > 5 files changed, 248 insertions(+), 74 deletions(-) > I have tested this series on x86 QEMU with v6.6-rc3 (plus another patch from pm-next tree i.e "PM: hibernate: use __get_safe_page() rather than touching the list"). It works as advertised. Thanks, Pavan