Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936053AbcCQNVs (ORCPT ); Thu, 17 Mar 2016 09:21:48 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36130 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932614AbcCQNVm (ORCPT ); Thu, 17 Mar 2016 09:21:42 -0400 MIME-Version: 1.0 In-Reply-To: <20160317125736.GT14143@nuc-i3427.alporthouse.com> References: <1458215982-13405-1-git-send-email-chris@chris-wilson.co.uk> <20160317125736.GT14143@nuc-i3427.alporthouse.com> Date: Thu, 17 Mar 2016 14:21:40 +0100 Message-ID: Subject: Re: [PATCH 1/2] mm/vmap: Add a notifier for when we run out of vmap address space From: Roman Peniaev To: Chris Wilson , Roman Peniaev , intel-gfx@lists.freedesktop.org, Andrew Morton , David Rientjes , Mel Gorman , linux-mm@kvack.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 773 Lines: 19 On Thu, Mar 17, 2016 at 1:57 PM, Chris Wilson wrote: > On Thu, Mar 17, 2016 at 01:37:06PM +0100, Roman Peniaev wrote: >> > + freed = 0; >> > + blocking_notifier_call_chain(&vmap_notify_list, 0, &freed); >> >> It seems to me that alloc_vmap_area() was designed not to sleep, >> at least on GFP_NOWAIT path (__GFP_DIRECT_RECLAIM is not set). >> >> But blocking_notifier_call_chain() might sleep. > > Indeed, I had not anticipated anybody using GFP_ATOMIC or equivalently > restrictive gfp_t for vmap and yes there are such callers. > > Would guarding the notifier with gfp & __GFP_DIRECT_RECLAIM and > !(gfp & __GFP_NORETRY) == be sufficient? Is that enough for GFP_NOFS? I would use gfpflags_allow_blocking() for that purpose. Roman