From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andi Kleen" Subject: Re: [PATCH V2 1/3] lib: introduce some memory copy macros and functions Date: Wed, 8 Sep 2010 14:19:25 +0200 (CEST) Message-ID: <46238.91.60.152.217.1283948365.squirrel@www.firstfloor.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: "Andi Kleen" , "Peter Zijlstra" , "Ingo Molnar" , "Andrew Morton" , "Theodore Ts'o" , "Linux Kernel" , "Linux Ext4" , "Linux Btrfs" To: miaox@cn.fujitsu.com Return-path: List-ID: > According to the data, the length of the most copies is >=128. Thanks for the data. Large is easier to optimize than small, that's good. Could you also measure how many memsets need the backwards copy? (should be easy to add) If the number is small that needs backwards then the easiest fix would be to simply call the normal memcpy in the forward case. That is for backward could also use a string instruction copy of course, just have to set the direction flag. That would be a very small code change. -Andi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758673Ab0IHMTa (ORCPT ); Wed, 8 Sep 2010 08:19:30 -0400 Received: from one.firstfloor.org ([213.235.205.2]:58467 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755900Ab0IHMT3 (ORCPT ); Wed, 8 Sep 2010 08:19:29 -0400 Message-ID: <46238.91.60.152.217.1283948365.squirrel@www.firstfloor.org> Date: Wed, 8 Sep 2010 14:19:25 +0200 (CEST) Subject: Re: [PATCH V2 1/3] lib: introduce some memory copy macros and functions From: "Andi Kleen" To: miaox@cn.fujitsu.com Cc: "Andi Kleen" , "Peter Zijlstra" , "Ingo Molnar" , "Andrew Morton" , "Theodore Ts'o" , "Linux Kernel" , "Linux Ext4" , "Linux Btrfs" User-Agent: SquirrelMail/1.4.11 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Priority: 3 (Normal) Importance: Normal Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > According to the data, the length of the most copies is >=128. Thanks for the data. Large is easier to optimize than small, that's good. Could you also measure how many memsets need the backwards copy? (should be easy to add) If the number is small that needs backwards then the easiest fix would be to simply call the normal memcpy in the forward case. That is for backward could also use a string instruction copy of course, just have to set the direction flag. That would be a very small code change. -Andi