Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 10 Aug 2002 01:58:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 10 Aug 2002 01:58:55 -0400 Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:51718 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id ; Sat, 10 Aug 2002 01:58:55 -0400 Message-ID: <3D54AED6.708F247F@zip.com.au> Date: Fri, 09 Aug 2002 23:12:38 -0700 From: Andrew Morton X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.19-rc5 i686) X-Accept-Language: en MIME-Version: 1.0 To: Linus Torvalds CC: lkml Subject: Re: [patch 6/12] hold atomic kmaps across generic_file_read References: <3D548E3D.4F8DC107@zip.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1314 Lines: 33 Linus Torvalds wrote: > > ... > > We'll need need to manually fault in the user page on the > > generic_file_read() path before taking the kmap, because reading > > into an unmapped page is a common case: malloc/read. > > I actually suspect that most reads are fairly small, and the page already > exists. But who knows.. pre-loading is certainly easy (a single > instruction). These things can be measured ;) Across a `make -j6 bzImage' the kernel reads 166,000 pages via file_read_actor(). And 31,000 of those generated a fault in the copy_*_user. (It wrote 14,400 pages and, of course, none of those faulted). And if gcc is getting a fault 20% of the time, some other apps will get many more. Which implies that we must prefault the page in file_read_actor to get full benefit. And if we do that, I'll bet you Victor's dollar that the fixup path is never executed. I'd have to disable the prefault even to be able to test it. What would be nice is a way of formalising the prefault, to pin the mm's pages across the copy_*_user() in some manner, perhaps? - 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/