From patchwork Sat Oct 7 07:05:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFyay1QSyBUc2FpICjolKHmspvliZsp?= X-Patchwork-Id: 149517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp785614vqo; Sat, 7 Oct 2023 00:07:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGTXnG9IivYms8MtVVGoyBs4jnJZfc62IIU8j4JIC/kXFTSwhlmlQpgCO4vdZ+WdBReS+2 X-Received: by 2002:a05:6e02:1aae:b0:351:5acb:281 with SMTP id l14-20020a056e021aae00b003515acb0281mr11319929ilv.31.1696662431496; Sat, 07 Oct 2023 00:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696662431; cv=none; d=google.com; s=arc-20160816; b=Q+3oXFR7ERGEFsh2MS3brsWpat9hYfZOGXNcHAAF8Bp4SNczrJriilaPqxFAIlcAXj IRsXDMWmO2Q1Vd1FWyjyg51I5Ej7Rmc9QBgSgKPYKD2+D7C8VU4TyKlkP8UpUmFdI1Nb kOWm41DrSVe1Pu4/GYGVA4OL/W/DKEDG4hrpayfpio0j5Emihi9gbC0tj0pfCp06EBoF 3t0m/F6ABh4zvHMlqPf7dVyiNKBelh9AcR3KL96ShU6YRkkxAQQJaB+LkziBTF/WVI92 WQn1jD5cJFo9VZPTmaQc912reN2+gU5hcNywj+mu/NhMdd8YPex4bw+0MDa++ZQ8Te7A HW2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=Le2uEJkChO2HUGa5K2hUsEoIn2/h+RuIAwUyZABd/Fg=; fh=jj8zmoIRlph5y4buxvmZRp3No1PeGdZG1GoQpiCkfpc=; b=TftAI0M/ClG9XTZ9UmsbqduKX0aHiKg3Hu2YYmQT8XxfbAwj3Iel70aUXEpokUimpO B/pkII5VjrbDIV0YqYUECLNEmqvfR1scGD1cQY3t/L7GZJmzSfNOHtMSkwEjWC5xKKS6 L+AStv0AKxtf1N+Vb4BV5ZIrcytkIJyfkfDR/TnT+vsO2OaUoub7CrVkbkHMiSJDYJrT MPG+Fs7udCmUshVBUR5eFrMzxqgbR/5Qzb7dO3MxONVHxW6GJ7Tok7v+2BOebnT45W/B whk1J27N8hjhGYoWHCY96GWOaJMnL1yvkmiKBu4009uqSRm5cGuKNMKkpFawhp8sna5s Cf+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=WVvFhP66; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bv3-20020a632e03000000b0057745d87b50si2945134pgb.139.2023.10.07.00.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 00:07:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=WVvFhP66; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1A76C807593B; Sat, 7 Oct 2023 00:06:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343628AbjJGHGK (ORCPT + 18 others); Sat, 7 Oct 2023 03:06:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343618AbjJGHGI (ORCPT ); Sat, 7 Oct 2023 03:06:08 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC1DABF; Sat, 7 Oct 2023 00:06:03 -0700 (PDT) X-UUID: f6f2e95264df11eea33bb35ae8d461a2-20231007 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=Le2uEJkChO2HUGa5K2hUsEoIn2/h+RuIAwUyZABd/Fg=; b=WVvFhP66Bn09GC4ehoj3v7McO/7dAlm7FQtEoYyJGpz57+kyy9HntBI3tFKbr9fnXXhC1UXvcRpauw3fk464H9v2p/QJFmM8Dxl/x0bxWCdg0ITbuKVXbJHJePBNUML7jWG5UHG4IdQFhdcrph3qE7k7wvireaH3EL6hWmeQ4uE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:9a829602-2bb3-4276-9fbe-0017bbb17f19,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5f78ec9,CLOUDID:cd89c814-4929-4845-9571-38c601e9c3c9,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: f6f2e95264df11eea33bb35ae8d461a2-20231007 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1482502868; Sat, 07 Oct 2023 15:05:57 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Sat, 7 Oct 2023 15:05:56 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Sat, 7 Oct 2023 15:05:56 +0800 From: Mark-PK Tsai To: Minchan Kim , Sergey Senozhatsky , Jens Axboe , Matthias Brugger , AngeloGioacchino Del Regno CC: , Mark-PK Tsai , , , , Subject: [PATCH] zram: use copy_page for full page copy Date: Sat, 7 Oct 2023 15:05:53 +0800 Message-ID: <20231007070554.8657-1-mark-pk.tsai@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--5.565200-8.000000 X-TMASE-MatchedRID: 7599MfAx46VCTeJ8Ii+TOrhzZI/dfrdOQl/FdRYkUZLfUZT83lbkECpJ 3T68EJKPEwte8QHPZve6/wFvLeWXhqYpNU5HIIOKngIgpj8eDcBpkajQR5gb3savT21DsLD/UEh Wy9W70AEgBwKKRHe+r7RUJtZc0bvVaYlP96BGyA9Gf+arKp5f1G0XrKRZbupyMWoRxFL7SRo= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.565200-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: C9F30F95FEA5B0A71375788D323ADC74DC144382AC8BD65FBB276596CD102A452000:8 X-MTK: N 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_PASS,T_SPF_TEMPERROR,UNPARSEABLE_RELAY 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 (snail.vger.email [0.0.0.0]); Sat, 07 Oct 2023 00:06:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779079505681059030 X-GMAIL-MSGID: 1779079505681059030 Some architectures, such as arm, have implemented optimized copy_page for full page copying. Replace the full page memcpy with copy_page to take advantage of the optimization. Signed-off-by: Mark-PK Tsai Reviewed-by: Sergey Senozhatsky Reviewed-by: Sergey Senozhatsky --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index d77d3664ca08..58700dd73d1d 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1338,7 +1338,7 @@ static int zram_read_from_zspool(struct zram *zram, struct page *page, src = zs_map_object(zram->mem_pool, handle, ZS_MM_RO); if (size == PAGE_SIZE) { dst = kmap_atomic(page); - memcpy(dst, src, PAGE_SIZE); + copy_page(dst, src); kunmap_atomic(dst); ret = 0; } else {