From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751052AbWFXTVr (ORCPT ); Sat, 24 Jun 2006 15:21:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751055AbWFXTVr (ORCPT ); Sat, 24 Jun 2006 15:21:47 -0400 Received: from smtp.osdl.org ([65.172.181.4]:706 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1751051AbWFXTVq (ORCPT ); Sat, 24 Jun 2006 15:21:46 -0400 Date: Sat, 24 Jun 2006 12:21:36 -0700 (PDT) From: Linus Torvalds To: Arjan van de Ven cc: Linux Kernel Mailing List , akpm@osdl.org Subject: Re: [PATCH] x86: cache pollution aware __copy_from_user_ll() In-Reply-To: <1151160152.3181.59.camel@laptopd505.fenrus.org> Message-ID: References: <200606231501.k5NF1B79002899@hera.kernel.org> <1151160152.3181.59.camel@laptopd505.fenrus.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 24 Jun 2006, Arjan van de Ven wrote: > > while this patch will reduce the number of cycles spent in the kernel, > it's just pushing the cache miss to userspace (by virtue of doing a > cache flush effectively)... is this really the right thing? The total > memory bandwidth will actually increase with this patch if you're > unlucky (eg if userspace decides to write to this memory eventually).... No. It's for copying _from_ user space, ie a "write()" system call. So what it does is to effectively try to use non-temporal stores to the page cache - since the page cache is usually not read directly afterwards (at least not soon enough for L1 caches to help). I don't generally like cache tricks either (caches tend to be better than humans, or at least get there fairly soon), but this one does seem very valid. Linus