Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752414AbWCPQws (ORCPT ); Thu, 16 Mar 2006 11:52:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752415AbWCPQws (ORCPT ); Thu, 16 Mar 2006 11:52:48 -0500 Received: from mx.pathscale.com ([64.160.42.68]:28098 "EHLO mx.pathscale.com") by vger.kernel.org with ESMTP id S1752414AbWCPQwq (ORCPT ); Thu, 16 Mar 2006 11:52:46 -0500 Subject: Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver From: "Bryan O'Sullivan" To: Roland Dreier , Hugh Dickins , Linus Torvalds , Andrew Morton Cc: Linux Kernel Development In-Reply-To: <20060315213813.747b5967.akpm@osdl.org> References: <71644dd19420ddb07a75.1141922823@localhost.localdomain> <1141948516.10693.55.camel@serpentine.pathscale.com> <1141949262.10693.69.camel@serpentine.pathscale.com> <20060309163740.0b589ea4.akpm@osdl.org> <1142470579.6994.78.camel@localhost.localdomain> <1142475069.6994.114.camel@localhost.localdomain> <1142477579.6994.124.camel@localhost.localdomain> <20060315192813.71a5d31a.akpm@osdl.org> <1142485103.25297.13.camel@camp4.serpentine.com> <20060315213813.747b5967.akpm@osdl.org> Content-Type: text/plain Date: Thu, 16 Mar 2006 08:52:30 -0800 Message-Id: <1142527950.25297.101.camel@camp4.serpentine.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 35 On Wed, 2006-03-15 at 21:38 -0800, Andrew Morton wrote: > You need to decide who "owns" these pages. Once that's decided, it tells > you who should release them. OK, I've made some interesting progress here. The driver is now doing all of its allocations of DMAable memory using dma_alloc_coherent. We do a get_page right after the allocation in every case, and a put_page right before the free. In the cases where I'm allocating memory that I know or think might be greater than a page in size, I'm using __GFP_COMP. The nopage handler always does a get_page. We now have a rational-looking set of VM_* flags, instead of a random heap of whatever seemed to work. And we're not touching PG_reserved. And now everything works. I have yet to examine /proc/meminfo in microscopic detail after 100,000 runs to be sure we don't have a leak of some kind, but I no longer get oopses or crashes after 20 repeated runs, where before I didn't survive even one. Whew! What a relief. Hugh, Andrew, Linus and Roland: thanks very much. This has been a tremendous help.