Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760015AbYHAWbU (ORCPT ); Fri, 1 Aug 2008 18:31:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755500AbYHAWbL (ORCPT ); Fri, 1 Aug 2008 18:31:11 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:48100 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754981AbYHAWbK (ORCPT ); Fri, 1 Aug 2008 18:31:10 -0400 Date: Fri, 1 Aug 2008 15:30:26 -0700 (PDT) From: Linus Torvalds To: Vitaly Mayatskikh cc: linux-kernel@vger.kernel.org, Andi Kleen , Ingo Molnar Subject: Re: [PATCH] x86: Optimize tail handling for copy_user In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1349 Lines: 33 On Sat, 2 Aug 2008, Vitaly Mayatskikh wrote: > > Well, I have sanity test for it (at http://people.redhat.com/vmayatsk/copy_user_x8664/), > but unfortunately it shows what I want to see, not the truth. I'm going > to make a large regression testing next week. I was actually thinking more along the lines of actually doing a test-suite with the few most relevant system calls (to catch the few cases that matter), and judicious use of mmap/munmap to make sure to trigger it in-kernel. It probably doesn't really need all that many system calls to trigger all the relevant paths. A "read()" should trigger the "to_user()" case, and a write() to a file should trigger the 'from_user_nocache()" case. And while the "from_user()" case with zeroing migth be harder to see (because all _normal_ users should also look at the error case and return EFAULT), I think there are a few cases where we just depend on the zeroing. Doing a git grep ' copy_from_user(' (that's a tab in that grep thing) shows at least the termios code doing it, for example. But fewer cases than I expected. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/