From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759286Ab1IIPgA (ORCPT ); Fri, 9 Sep 2011 11:36:00 -0400 Received: from am1ehsobe005.messaging.microsoft.com ([213.199.154.208]:59167 "EHLO AM1EHSOBE005.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754958Ab1IIPf7 (ORCPT ); Fri, 9 Sep 2011 11:35:59 -0400 X-SpamScore: 1 X-BigFish: VPS1(zz98dKzz1202h1082kzzz32i668h839h944h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:163.181.249.109;KIP:(null);UIP:(null);IPVD:NLI;H:ausb3twp02.amd.com;RD:none;EFVD:NLI X-WSS-ID: 0LR9HZT-02-B5F-02 X-M-MSG: Date: Fri, 9 Sep 2011 17:35:53 +0200 From: Borislav Petkov To: Linus Torvalds CC: Maarten Lankhorst , Borislav Petkov , "Valdis.Kletnieks@vt.edu" , Ingo Molnar , melwyn lobo , "linux-kernel@vger.kernel.org" , "H. Peter Anvin" , Thomas Gleixner , Peter Zijlstra Subject: Re: x86 memcpy performance Message-ID: <20110909153553.GA12448@gere.osrc.amd.com> References: <20110812195220.GA29051@elte.hu> <20110814095910.GA18809@liondog.tnic> <6296.1313462075@turing-police.cc.vt.edu> <20110816121604.GA29251@aftab> <4E5FA18A.7010205@gmail.com> <20110908083551.GA5646@liondog.tnic> <4E689FC5.8010005@gmail.com> <20110909081407.GA29251@liondog.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: amd.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 09, 2011 at 07:39:18AM -0700, Linus Torvalds wrote: > Kernel memcpy's are basically almost always smaller than a page size, > because that tends to be the fundamental allocation size. Yeah, this is what my trace of a kernel build showed too: Bytes Count ===== ===== ... 224 3 225 3 227 3 244 1 254 5 255 13 256 21708 512 21746 848 12907 1920 36536 2048 21708 OTOH, I keep thinking that copy_*_user might be doing bigger sizes, for example when shuffling network buffers to/from userspace. Converting those to SSE memcpy might not be as easy as memcpy itself, though. > Yes, there are exceptions that copy into big vmalloc'ed buffers, but > they don't tend to matter. Things like module loading etc. Too small a number of repetitions to matter, yes. -- Regards/Gruss, Boris.