Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755508AbcC1XPw (ORCPT ); Mon, 28 Mar 2016 19:15:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58263 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753317AbcC1XPu (ORCPT ); Mon, 28 Mar 2016 19:15:50 -0400 Date: Mon, 28 Mar 2016 16:15:49 -0700 From: Andrew Morton To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org, David Rientjes , Roman Peniaev , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm/vmap: Add a notifier for when we run out of vmap address space Message-Id: <20160328161549.c77046847a8ae791cb436aff@linux-foundation.org> In-Reply-To: <20160317134156.GX14143@nuc-i3427.alporthouse.com> References: <1458215982-13405-1-git-send-email-chris@chris-wilson.co.uk> <1458221699-13734-1-git-send-email-chris@chris-wilson.co.uk> <20160317134156.GX14143@nuc-i3427.alporthouse.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1880 Lines: 47 On Thu, 17 Mar 2016 13:41:56 +0000 Chris Wilson wrote: > On Thu, Mar 17, 2016 at 01:34:59PM +0000, Chris Wilson wrote: > > vmaps are temporary kernel mappings that may be of long duration. > > Reusing a vmap on an object is preferrable for a driver as the cost of > > setting up the vmap can otherwise dominate the operation on the object. > > However, the vmap address space is rather limited on 32bit systems and > > so we add a notification for vmap pressure in order for the driver to > > release any cached vmappings. > > > > The interface is styled after the oom-notifier where the callees are > > passed a pointer to an unsigned long counter for them to indicate if they > > have freed any space. > > > > v2: Guard the blocking notifier call with gfpflags_allow_blocking() > > > > Signed-off-by: Chris Wilson > > Cc: Andrew Morton > > Cc: David Rientjes > > Cc: Roman Peniaev > > Cc: Mel Gorman > > Cc: linux-mm@kvack.org > > Cc: linux-kernel@vger.kernel.org > > --- > > include/linux/vmalloc.h | 4 ++++ > > mm/vmalloc.c | 27 +++++++++++++++++++++++++++ > > 2 files changed, 31 insertions(+) > > > > diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h > > index d1f1d338af20..edd676b8e112 100644 > > --- a/include/linux/vmalloc.h > > +++ b/include/linux/vmalloc.h > > @@ -187,4 +187,8 @@ pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms) > > #define VMALLOC_TOTAL 0UL > > #endif > > > > +struct notitifer_block; > Omg. /o\ Hah. Please move the forward declaration to top-of-file. This prevents people from later adding the same thing at line 100 - this has happened before. Apart from that, all looks OK to me - please merge it via the DRM tree if that is more convenient.