Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp391250rdh; Tue, 13 Feb 2024 23:04:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVcFESLf17cEaPUp3AWyGRE7TpF9PLkTQixAwBPc2rP1FD/QilI4/5dFJX9DG4aqUeZbVcjykVlzFweMpNjb/zB2FxYJv5yfjmRfGaUXg== X-Google-Smtp-Source: AGHT+IEFeHaw/PT6F/agolK4rDlGowFfBzhwVigxy62+FFtpeVo5YxJ5YW+jBtOW7GFI/Jkb5tNX X-Received: by 2002:aa7:df0e:0:b0:561:d42b:e9b6 with SMTP id c14-20020aa7df0e000000b00561d42be9b6mr1195851edy.14.1707894255628; Tue, 13 Feb 2024 23:04:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707894255; cv=pass; d=google.com; s=arc-20160816; b=i0YCrHaPLnWM/fFoapH2IbSHEpelgeIV8rytKHxXnh4E94DjBGjlSr70Ha8qDRk6AY WhTgg+gfFFfYF3HmzhnDsetlW+fdsxEyCYS/KCbG3j97feHEjsW7o2nKZrg9VFnMsV4j P5lr/jWiQbgrVPRrckRiOF6GCtzY/a8I1zUR2eRNh/BlSDs6xg9pCqGEIXqr811RgsI1 JGvZgT9KA3IA+jTdm2EbN+yhPJtBd/TMzDAHtFJs1kIJqn5r5Kku/BHsJBykI15DTtzr HI9MqxDvlXhKb4nCIVNZombGye7dvFYAhUmRwUKO9RvMgd3yrBoB9PCqhon8E77h8nea rApw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=4vd+mtJ0l3WUpTERdyjKbKOw7hhg9weB54kH0ZgtkjA=; fh=SNt1tpulzyD8nRPxl5v8GhOUjtK3jZZCVfV8ViviZww=; b=wwxkRJs89UhZRbfAfqOeYQRcPkl3UgtS83fyVfuGu0i/vrKCuh6RYPttaxFCH+0HiH btvuq9ZAxVIS5TP/YKUQVV/CAkXpC0AWdmAH9DJ0RWJoYJBC25sgTg60KJvI2oCw6AFv rvtkqUC2MQdNBqNqT4xDraEsLrkHiK8VBnK+Ib3s+n52zvoiRNrKgp4UKg4GbRbaG8ah gU25lGvGk+BZFmFm54aQ+sDTlLCSjoiNfNav5kLsDYw18iTZppVa9g54LqAlS4qjfjEz hkTLdFrkHn/JeZBaCCyZahS/mQ/W/Gf5Rl+KOf7udNLDUiOIk7LJQrZlWieR/GEmAcsK LfZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=E+J278Xi; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-64816-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64816-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCV13ReL+2/4pV5Ede9jCuLvy+yBu1wgiaWPw56Z1Cc1+9ke+tiAJnbiEtvk/USEHkk0bWqMrxrI/wLut+eiRbYnwdSQwQb/68i9MJpLJw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g15-20020a0564021ecf00b0056310f01e32si347162edg.113.2024.02.13.23.04.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 23:04:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64816-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=E+J278Xi; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-64816-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64816-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 366DE1F28544 for ; Wed, 14 Feb 2024 07:04:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A3981170F; Wed, 14 Feb 2024 07:04:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="E+J278Xi" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC6BC111A2; Wed, 14 Feb 2024 07:04:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707894244; cv=none; b=VJPEL8IfkZXFOu1Q6KvgN7avnna/jVnRGLWOo0FRJzKQngIhoGE/a8LLVxBWwmhikfDolmK5d1R4cU6jPbvYVPguPQtPrEQH8ItRyGEDdWd3neoHNPMJ8VVQEpiif+k56OdCpqCMD/MiHxivq+K8190FQIVjZiHb355TV5ir2Fg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707894244; c=relaxed/simple; bh=SxDMitXrZdgJSRPQljG5vzYJ75Md+aT0vs0nRf2RU24=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=liSjJYAIxwfB8EPKUJZuKQ7UmR0wEIG9xGyU4U6RUiakjxGjg9PRHxDXpPD7UQkV8fpjpv1JfpmbCtpBUWdIT/JroJT/tQnHBMQraSuYQx4f1Gjq4UO9raLX4K/3lcM3sQa5cV6MdrnacYmR1gNxNZjXJBcImODo0LnBXb4f2jw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=E+J278Xi; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41E6qF7t009288; Wed, 14 Feb 2024 07:03:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=4vd+mtJ0l3WUpTERdyjKbKOw7hhg9weB54kH0ZgtkjA=; b=E+ J278XiRzH08ZcigLN/fLyi4G1gSJ4q5igY6h6Xj70c+IKzxREymoZSoIiaVKY4wF h5N0M96bDghF+aY51v+nZyDTBVuBDsXbEUBYEQqO0wuof2DxpfvDdOoQd3u+XVJh yJ5iVrDzK7Fw7sr75uo/vECffdW9uOnEDpkVWwvU+1DH8k3P7XFXE7PMQta4Ux7w da8nGaPkFPG4c+eictBfkSDSLeuzZZ7J/aibA34uRO4xT/3tea1JXWdd0KwC0P8S b0rr0EdIfEFb7+BSmlX7Dz2GKTsiy0M+bJOLuXepDSGtHn2wSe2lURWtdJs7dqwf pNTRp7D8gOvLeV81iDng== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w8k9aggb0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Feb 2024 07:03:40 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41E73dJ6026441 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Feb 2024 07:03:39 GMT Received: from [10.216.25.21] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 13 Feb 2024 23:03:32 -0800 Message-ID: Date: Wed, 14 Feb 2024 12:33:29 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.0 Subject: Re: [PATCH] PM: hibernate: Support to select compression algorithm Content-Language: en-US To: Randy Dunlap , Pavel Machek , "Len Brown" , Jonathan Corbet , "Rafael J. Wysocki" CC: "Paul E. McKenney" , Tejun Heo , Yan-Jie Wang , Peter Zijlstra , "Steven Rostedt (Google)" , Catalin Marinas , , , , , , , , , References: <3776355f920c1af44490e076072f93bafdf128cc.1707740870.git.quic_nprakash@quicinc.com> <1d12e130-d3db-4eb5-a1d0-bc994c97a175@infradead.org> From: Nikhil V In-Reply-To: <1d12e130-d3db-4eb5-a1d0-bc994c97a175@infradead.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: YMqGurqrgxzdDzqU0XAo_MHM1vPhjtDF X-Proofpoint-GUID: YMqGurqrgxzdDzqU0XAo_MHM1vPhjtDF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-13_16,2024-02-12_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 mlxlogscore=999 mlxscore=0 spamscore=0 malwarescore=0 phishscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402140054 On 2/13/2024 12:34 AM, Randy Dunlap wrote: > > > On 2/12/24 04:32, Nikhil V wrote: >> Currently the default compression algorithm is selected based on >> compile time options. Introduce a module parameter "hibernate.compressor" >> to override this behaviour. >> >> Different compression algorithms have different characteristics and >> hibernation may benefit when it uses any of these algorithms, especially >> when a secondary algorithm(LZ4) offers better decompression speeds over a >> default algorithm(LZO), which in turn reduces hibernation image restore >> time. >> >> Users can override the default algorithm in two ways: >> 1) Passing "hibernate.compressor" as kernel command line parameter. >> Usage: >> LZO: hibernate.compressor=lzo >> LZ4: hibernate.compressor=lz4 >> >> 2) Specifying the algorithm at runtime. >> Usage: >> LZO: echo lzo > /sys/module/hibernate/parameters/compressor >> LZ4: echo lz4 > /sys/module/hibernate/parameters/compressor >> >> Currently LZO and LZ4 are the supported algorithms. LZO is the default >> compression algorithm used with hibernation. >> >> Signed-off-by: Nikhil V >> --- >> This patch is dependent on the patch series, [1] (patches 1/4 to 3/4). >> This is picked in linux-next, [2]. >> [1] https://lore.kernel.org/all/cover.1705927916.git.quic_nprakash@quicinc.com/ >> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/kernel/power?h=next-20240212 >> >> .../admin-guide/kernel-parameters.txt | 10 ++++ >> kernel/power/hibernate.c | 57 ++++++++++++++++++- >> 2 files changed, 64 insertions(+), 3 deletions(-) >> >> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt >> index 31b3a25680d0..522155056645 100644 >> --- a/Documentation/admin-guide/kernel-parameters.txt >> +++ b/Documentation/admin-guide/kernel-parameters.txt >> @@ -1748,6 +1748,16 @@ >> (that will set all pages holding image data >> during restoration read-only). >> > > Hi, > Please add something like: > > >> + hibernate.compressor= [HIBERNATION] Compression algorithm to be >> + used with hibernation. >> + Format: { lzo | lz4 } > Default: lzo >> + >> + lzo: Select LZO compression algorithm to >> + compress/decompress hibernation image. >> + >> + lz4: Select LZ4 compression algorithm to >> + compress/decompress hibernation image. >> + >> highmem=nn[KMG] [KNL,BOOT] forces the highmem zone to have an exact >> size of . This works even on boxes that have no >> highmem otherwise. This also works to reduce highmem > > > thanks. Hi @Randy, Will update the documentation as mentioned and send the patch for review. Thanks, Nikhil V