Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp302400rdb; Fri, 6 Oct 2023 04:12:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcfAvPE1m6Q0t8Z/bdK3zy8qfMGTK4hB0iMkd3KL04gybZ+vQd77KS7dBsXbPKnGu8Rtmh X-Received: by 2002:aca:1019:0:b0:3a7:541c:805c with SMTP id 25-20020aca1019000000b003a7541c805cmr7568523oiq.24.1696590728490; Fri, 06 Oct 2023 04:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696590728; cv=none; d=google.com; s=arc-20160816; b=NJ/6CLbq7YleTybVjnBgtIvs95Sup/t3GlxtGr0PopuCfDHkjssiYYLsUZWiPRinBt +1fN8b9tVhu9e3MCJ7z8Y5cWoEpyL+DAlmoZA2MnoZOVRcabIxBovR0UOMvn67oH2G+L V0G2Bhuj9oby/DiJQAX3iaA8GYHbL9w+79iOg5THu8Y0qEEgx4hqIzwgdIZlIeKUTAip GKKm8y+s+G4Hb7QcXAH048fGtzgU26gEQc29Nhcf1sS+qC7OYcdfyo30aWfVPyMY+I+/ h1Y0prJSovgMsBMC7Osg520ayt0CXZL4mTc3/knrlbIWSuUyLWZdYzmNT3ukSoUZXIjW UWbw== 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=CkZAhzcVv5l/GWGZH+CNEm4JuaJPR9RYctj/ltot25I=; fh=vrFsmwIxqwoky1kWGxQlXjXAaOLMiNRAsn4chd62hLM=; b=cLscVVxM+5mO41vaW39iAFoXCmIomtge1iY0ut6RxeJ+Ik3p+PvaKXV9synN8KUScn PJrYK/7yj0h7iC+Qq0sBjEslYZ1i07tJgmDaGjJPvzpJ/8OsBQYfUWSG3LQEQE9WBLWD beILEblXtfaWympd/EAAeqGA+mPTGlQO0sSrjxNKxtXW5xTJ7M2nKjDF3gluLjf56IR2 X1ilf/nQ3UV8QXjpqtHvK638g4kkb4ahk0ZYQKXkL2/hKzNlYtp2nCj0npTPGUmX6eqM F+3ovy4r275vkTjnQLL2l5MGOFBBOTYPicZQ823y4jq9MU7MvcK43CUMHe2mGAxuzgUB obkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XXfvVbIk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b00573e329b014si3523268pgb.339.2023.10.06.04.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 04:12:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XXfvVbIk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6ACC68149728; Fri, 6 Oct 2023 04:12:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231966AbjJFLLx (ORCPT + 99 others); Fri, 6 Oct 2023 07:11:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231915AbjJFLLv (ORCPT ); Fri, 6 Oct 2023 07:11:51 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 074C5CA for ; Fri, 6 Oct 2023 04:11:50 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1c723f1c80fso15075465ad.1 for ; Fri, 06 Oct 2023 04:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696590710; x=1697195510; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CkZAhzcVv5l/GWGZH+CNEm4JuaJPR9RYctj/ltot25I=; b=XXfvVbIkMcgc+YXpdx0S58v4rH3fLYG/oblijirqG+O2ZES3Fz0J+awMIyypsoSa+y PMe062U4cSeUaB/lAInp/FpT4onFSZVaq8TVGGnvcYOOhNPRngBp0IRLR204z1NBdMLl 3si9j9z40bgLT16iN+x3LSExjehtWFsaHO3uU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696590710; x=1697195510; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CkZAhzcVv5l/GWGZH+CNEm4JuaJPR9RYctj/ltot25I=; b=SEj0GWvXDNI+liMZzi4JH0dOKCVbMA7WARkt2OEf1/vuz5yhyJsOc0ftcVmP6S72k4 Oeoy3CsbokGhkAZOeE1mBxazYhBGcoo1quS16YTth+oaG6J1e2KHm1Pem0s9zqM1V3xH J72itI/ckluB8MMoO9Cjfy8Dl15aFHRhWS6pZyJL1QEQXySKGmIGHyuAv4RcrEQPfVPs mi5zLCjc6lGS3Jl9YSyC8RcHKI9Q2UO4WIAEiSp8HkhjWUj4Mjac8sPmJTxX5zqAxLBT DsMGWVoO9M/Nj+40J7Jp2SOr0jDwEIlvfLV+aGiwzC7OhK0wa17ZXHcgQTq7SVSLHd0X FCkA== X-Gm-Message-State: AOJu0YzEeqJDiH74pmuYSAe4gfjhnUHmYcMT+70b2N17HxD/lVg8nWBM eFIAmZfDIw1UrbqMmnqLsVU09A== X-Received: by 2002:a17:903:24e:b0:1c0:d7a9:1c48 with SMTP id j14-20020a170903024e00b001c0d7a91c48mr9046916plh.49.1696590710250; Fri, 06 Oct 2023 04:11:50 -0700 (PDT) Received: from google.com ([2401:fa00:8f:203:4afa:2f75:6a8f:b6ea]) by smtp.gmail.com with ESMTPSA id c6-20020a170902c1c600b001b9da8b4eb7sm3539523plc.35.2023.10.06.04.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 04:11:49 -0700 (PDT) Date: Fri, 6 Oct 2023 20:11:44 +0900 From: Sergey Senozhatsky To: Mark-PK Tsai Cc: Minchan Kim , Sergey Senozhatsky , Andrew Morton , Matthias Brugger , AngeloGioacchino Del Regno , yj.chiang@mediatek.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] zsmalloc: use copy_page for full page copy Message-ID: <20231006111144.GB17924@google.com> References: <20231006060245.7411-1-mark-pk.tsai@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231006060245.7411-1-mark-pk.tsai@mediatek.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Fri, 06 Oct 2023 04:12:06 -0700 (PDT) X-Spam-Level: ** On (23/10/06 14:02), Mark-PK Tsai wrote: > 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 TIL I've never heard of arm's copy_page() before. Is it really much faster than memcpy()? Reviewed-by: Sergey Senozhatsky > 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); I guess you can also look into patching zram_drv.c, which seem to have at least one PAGE_SIZE memcpy().