Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp134866lqs; Thu, 13 Jun 2024 06:13:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX76JPk7C+s2va6/V+lX4ip8pYk4I+dFpZ02a5t3UGeoTY/fJrDamlA208nCHUuRgzA+E0t8teOVGsPikggZjS2jbPdzNCDkG6/zrUT/g== X-Google-Smtp-Source: AGHT+IEhsxKDJpOZTmeHtr53F5ofq+/GXBtORw2iJ2E5Y9onme9DSYWkljhWmeEMcOpM1XHIj9PX X-Received: by 2002:a50:ab1d:0:b0:57c:6463:9960 with SMTP id 4fb4d7f45d1cf-57caaacbb87mr2808627a12.37.1718284398454; Thu, 13 Jun 2024 06:13:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718284398; cv=pass; d=google.com; s=arc-20160816; b=Kp78wffihCqvyJ1gG/DJEwx3zCLBEAOGMZdzS+9soCkjdKiR9fgDT+95a5waKiFBCH PWYsQhp2wrwA8MTvpHr5VNDzlzjH2QPLu8z6OlkUAjBkQMadiK8SNC99eLC9e0OOULXn LdCL8fAqZNvC8Xu7NoOMkm55ljraw38x8y56/UMJDU+5YKCao2OQAXlNcN9NFYmSNLDX lgLOISRuK999oGVgFEbckKRWYJglBiA8UqiZte73b0/mwOF2TVaQfjIfKMmHUQAiyt5F a95XWAD5RnzWjy0C1Xe1FpHA/LJKXcidltFoUMANKOvP9tACUn3wc3L03pq2qTEmyRbI J4Dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hVJMEvyr0O3MHuK52CSpUTQuVSz7ouKNDfaXl3qXsQM=; fh=VkvxYpacEi3IYj4CN6fSy/oyC5z+hMSVZW6Y9sQvvjA=; b=CwYZN0x0PZFMBJiHO5sbM3IHMVzD2UDpcYtc2v6Udb06aide+cXcaLsi2V4bQSDKnR y02PlLOPreaLD2/gn0DDaE8s1xBmcBQv05k0vSfdW1ZxFkHrxJvYtb0ow6JeSHZRt8iu B1F8gr/w0MiqRSI5Mke0Boru8mBDAFyaShlo5d+f74zFUKRzUgOF4JnxsMMaXyCEYAJK RiPNaeeBYQbVOuHiw8DIleBMylP+xdZz/HL4IIg2Nz4rQv9dhqx6MxCRirJrXw2Pe5X3 2eLz+ZMIxZjLoWvKm724QM5z+PmLtvyAuULpbRxqQ74E51OMsUS5xjej5SMf2HSaIUi2 PL/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LZk4d1co; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213258-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213258-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb7479822si705013a12.691.2024.06.13.06.13.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 06:13:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213258-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LZk4d1co; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213258-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213258-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 2F2DD1F21B25 for ; Thu, 13 Jun 2024 13:13:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93E45144316; Thu, 13 Jun 2024 13:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LZk4d1co" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B84DC143C67; Thu, 13 Jun 2024 13:13:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718284385; cv=none; b=t+oAD3M7tmkkV7c2gZLDCtjDOesfHfm+vXD7aHayd4BK8NtAlGHJmRAiZgqDuRF5hZPAe/WxMWLFlT26ncob7lG/UzYrJLkEpsCkd/F+FvE9W0NLpWE6weFNlm3k6N/V0n6KD14WlrcIjePah6JFRW3K/yPZJIT2piMykQ+NMik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718284385; c=relaxed/simple; bh=kNVg6hB3W8Ii/Oj3Os+AjniHpIN6BBnVmAS6GNrz1BY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Y0Ot/XYyQSriOjnnvjj4EIXZpVgpmjOTLaYyjJSDlai/DmR9hfEVu1+cPAwYHhUvCFMHJyJAbUqagvldWWZ79fEgjcThng6AtLDT0eGcoiHp7XJ420Dj+jzOhOEygz8Ugp3428cN6UT6WaXQAyOLJh0wI+9+FTKoPSk4LPvoj2I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LZk4d1co; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2927CC32786; Thu, 13 Jun 2024 13:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718284385; bh=kNVg6hB3W8Ii/Oj3Os+AjniHpIN6BBnVmAS6GNrz1BY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LZk4d1coZpAUddGWJ8gYqQ4YEdJ5gsepRTel61MxdLvcgw3qwxEEdIJHRdHmDr/9t nugkWbCIIjPBu+brQIWXpO7KJZXFEwdJqmKEzpe9ef4dwODRyn2qFIU9Ts79G+5gRd 47YmWMIpaN/AiiyEnRyvzqIsyfzJ4YoeXJo3LXd9ddiw6iMLF8fsBK2y+aB0S5lUCI 0E4SxfZoTYZ/khfuLMiXfIuiQS0cKHoZp9SSIlARy+4xl5HNZqKqmhY74KM9oMUmUd K77T+UYmn0YSRMiYkKFb5ObRzVWn640ZfTju3bpu9I0+8mkEVH8FK4VeioEzEb5zH/ +0kGe434Eqchg== Date: Thu, 13 Jun 2024 20:58:55 +0800 From: Jisheng Zhang To: Sergey Senozhatsky Cc: Minchan Kim , Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH] zram: use copy_page for full page copy Message-ID: References: <20240613000422.1918-1-jszhang@kernel.org> <20240613031731.GB479513@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240613031731.GB479513@google.com> On Thu, Jun 13, 2024 at 12:17:31PM +0900, Sergey Senozhatsky wrote: > On (24/06/13 08:04), Jisheng Zhang wrote: > > commit 42e99bd975fd ("zram: optimize memory operations with > > clear_page()/copy_page()") optimize page copy/clean operations, but > > then commit d72e9a7a93e4 ("zram: do not use copy_page with non-page > > aligned address") removes the optimization because there's memory > > corruption at that time, the reason was well explained. But after > > commit 1f7319c74275 ("zram: partial IO refactoring"), partial IO uses > > alloc_page() instead of kmalloc to allocate a page, so we can bring > > back the optimization. > > > > commit 80ba4caf8ba9 ("zram: use copy_page for full page copy") brings > > back partial optimization, missed one point in zram_write_page(). > > optimize the full page copying in zram_write_page() with copy_page() > > Is copy_page() really more optimal than memcpy(PAGE_SIZE)? I think yes copy_page performs better than memcpy(PAGE_SIZE) commit afb2d666d025 ("zsmalloc: use copy_page for full page copy") also shows the result.