Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp177356rdb; Thu, 5 Oct 2023 23:03:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFEnYFCEiTEiAW72kJajrDKVkyLqppSMI/WcBjrjsAcq8I2iCcBuApueQ+MlQ9m9SaICVSM X-Received: by 2002:a05:6870:b60e:b0:1db:23f6:283f with SMTP id cm14-20020a056870b60e00b001db23f6283fmr7830074oab.27.1696572200486; Thu, 05 Oct 2023 23:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696572200; cv=none; d=google.com; s=arc-20160816; b=FmkBcSoftUvOQkIfMGtIDndVeMDXEaIGq1amfpU/iDTHfUCntymkXftXQn+kTRJsJ8 SRnbR/nddKsZn3szYjQ5uV48bSfN7vcVTpaUyOsCzdxlriF6CTYTgXaiff+tIf8VHYSL b35VcBhQsp8fi5p5d6fGuv7XwS2cptekFSBlITYzPftnWOsqjOxTDC5NWLnabH+Jgo4y Pta6/9S0ZkdramC7yZDeUKr7z24mLjH2JTaBCNb1CI5XCL0CWoOkkF9Mqhpr7TTIcYgx vM2ol+bO4JlHP4dWJ98lQwjh2RmzxOH1VNFIbZWVAjEX/V9gsRApsCcmW2Woptm8VPeR l86g== 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=G6RcZSK2ZXZNwpAYwk74iwfftVFpwiXwgGnN1wemDVw=; fh=j4xFIrW6O/nfgFC40PNwCGjdHwHpPMcoaWiN0X3mjI8=; b=efA1z3wqd7g+LLqJNTNkToChQPVvPyLYBcSBIL97fr/J86ttWFisv7+hMemFmcsTLI f2vanEZgv8P3B5nT6KNO7PUVKcJOueca49bpxzv+JcuPyFJBnejquZoMgqXQZy6IpaYj eomYm4dgo+mWMpZqeB9CllJUKIKQ04QCYJEEmtPLoCrIYIrIDLUHNF75ADM4FN79q6Xv P44T2smPEvj4NRyKm6E0EKukg7fa359NNEdhd9MnPz72IRoJ8glYJhKU60qauUqdlQq/ h8J57uz7TTs5t1ZFBNsZOaQz/hIB2outlSp+K6sbAA4GIElzy3Tl8Ns6u+csDsRXRWuv Zmcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=syw1zc43; 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m123-20020a632681000000b00573fe48c908si3065875pgm.128.2023.10.05.23.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 23:03:20 -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=syw1zc43; 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 3B47683896FA; Thu, 5 Oct 2023 23:03:19 -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 S230134AbjJFGDL (ORCPT + 99 others); Fri, 6 Oct 2023 02:03:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbjJFGDI (ORCPT ); Fri, 6 Oct 2023 02:03:08 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A921CA for ; Thu, 5 Oct 2023 23:03:01 -0700 (PDT) X-UUID: fbe11006640d11ee8051498923ad61e6-20231006 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=G6RcZSK2ZXZNwpAYwk74iwfftVFpwiXwgGnN1wemDVw=; b=syw1zc431l5KIJZODYIQi5CbSTVuN9t949ZwOquQStJcrQxqfM4dyAyBTlMRx4DHMvK6x1g01oGFVwgYGgkSLRBgQ6jhIsEPNoJ5NFDqVBL2Sggb2CZ+a39x2PZh5SddFk0zTLVqWHwWgBgKZjpdLcu9/UL6yVYa5/aANyBpjvE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:9d930bb0-0d52-4a24-94ad-ecc8885f1e83,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:5f78ec9,CLOUDID:7dc581f0-9a6e-4c39-b73e-f2bc08ca3dc5,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: fbe11006640d11ee8051498923ad61e6-20231006 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 810643480; Fri, 06 Oct 2023 14:02:51 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 6 Oct 2023 14:02:50 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 6 Oct 2023 14:02:50 +0800 From: Mark-PK Tsai To: Minchan Kim , Sergey Senozhatsky , Andrew Morton , Matthias Brugger , AngeloGioacchino Del Regno CC: , Mark-PK Tsai , , , , Subject: [PATCH] zsmalloc: use copy_page for full page copy Date: Fri, 6 Oct 2023 14:02:40 +0800 Message-ID: <20231006060245.7411-1-mark-pk.tsai@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RDNS_NONE,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=no 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]); Thu, 05 Oct 2023 23:03:19 -0700 (PDT) Some architectures have implemented optimized copy_page for full page copying, such as arm. On my arm platform, use the copy_page helper for single page copying is about 10 percent faster than memcpy. Signed-off-by: Mark-PK Tsai --- mm/zsmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index c743ce7a5f49..b1c0dad7f4cf 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1839,7 +1839,7 @@ static int zs_page_migrate(struct page *newpage, struct page *page, * Here, any user cannot access all objects in the zspage so let's move. */ d_addr = kmap_atomic(newpage); - memcpy(d_addr, s_addr, PAGE_SIZE); + copy_page(d_addr, s_addr); kunmap_atomic(d_addr); for (addr = s_addr + offset; addr < s_addr + PAGE_SIZE; -- 2.18.0