Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932432AbVLIWMk (ORCPT ); Fri, 9 Dec 2005 17:12:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932456AbVLIWMk (ORCPT ); Fri, 9 Dec 2005 17:12:40 -0500 Received: from gold.veritas.com ([143.127.12.110]:22839 "EHLO gold.veritas.com") by vger.kernel.org with ESMTP id S932432AbVLIWMj (ORCPT ); Fri, 9 Dec 2005 17:12:39 -0500 Date: Fri, 9 Dec 2005 22:12:24 +0000 (GMT) From: Hugh Dickins X-X-Sender: hugh@goblin.wat.veritas.com To: Mark Rustad cc: Dave Hansen , Linux Kernel Mailing List Subject: Re: [PATCH 2.6.15-rc5] hugetlb: make make_huge_pte global and fix coding style In-Reply-To: Message-ID: References: <1134148609.30856.22.camel@localhost> <1134151696.3278.2.camel@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 09 Dec 2005 22:12:34.0678 (UTC) FILETIME=[A81CA960:01C5FD0D] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2623 Lines: 51 On Fri, 9 Dec 2005, Mark Rustad wrote: > On Dec 9, 2005, at 2:37 PM, Hugh Dickins wrote: > > > > You're not the only one to have trouble with recent remap_pfn_range > > changes. > > Would you let us know what you were doing, that you can no longer do? > > Some of the change may need to be reverted. > > Well, our driver had been allocating two 320MB and one 128MB range of memory, > each of the three being contiguous. These were allocated by allocating lots of > 1MB groups of pages until we got a contiguous range, then the unneeded pages > were freed. I can understand that you might be dissatisfied with that. > These areas were then mapped into the application with remap_pfn_range. We > have been running on a SuSE kernel derived from 2.6.5 for a long time where > this worked fine, even for gdb to access during debugging. Now that we are > moving to a more current kernel, changes were needed mainly to allow gdb to > access these shared memory areas. Okay, I think I get the picture. 2.6.15-rc5 would work if you used three adjacent mmaps, but that would involve changes to your driver and to your userspace, so you thought better to do it another way anyway. > I had messed with simply taking the large memory by restricting the kernel's > memory range with mem=, but gdb still can't get to the pages because it > believes that they are for I/O (there would be no struct page in that case). > > Given the situation, using hugepages seemed more attractive anyway, so I just > decided to go that way and specify hugepages=192 on the kernel command line. > > We also have a single page shared between our processes and the driver, but we > now use the new insert_single_page call for that, which works nicely. It > seemed to me that calling that for the each of the single pages in our 768M of > shared memory was silly, so I went the hugepage route, and that proved to be > less trouble than I had expected. I feel like things now are really where they > should have been all along. Hmm. Well, I share the doubts Dave and Adam have expressed. Out-of-tree drivers making up their own page tables are likely to break and be broken, and the more so once you get into hugepages. You'll be much more portable from release to release if you stick with lots of vm_insert_pages, silly as all that does seem, yes. Sorry, I don't have a better answer to hand. Hugh - 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/