From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753800AbcADNlN (ORCPT ); Mon, 4 Jan 2016 08:41:13 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:51036 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753238AbcADNlK (ORCPT ); Mon, 4 Jan 2016 08:41:10 -0500 Subject: Re: __vmalloc() vs. GFP_NOIO/GFP_NOFS To: Al Viro , linux-mm@kvack.org References: <20160103071246.GK9938@ZenIV.linux.org.uk> Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Dave Chinner , Ming Lei From: Tetsuo Handa Message-ID: <568A7663.80407@I-love.SAKURA.ne.jp> Date: Mon, 4 Jan 2016 22:40:51 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160103071246.GK9938@ZenIV.linux.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/01/03 16:12, Al Viro wrote: > Those, AFAICS, are such callers with GFP_NOIO; however, there's a shitload > of GFP_NOFS ones. XFS uses memalloc_noio_save(), but a _lot_ of other > callers do not. For example, all call chains leading to ceph_kvmalloc() > pass GFP_NOFS and none of them is under memalloc_noio_save(). The same > goes for GFS2 __vmalloc() callers, etc. Again, quite a few of those probably > do not need GFP_NOFS at all, but those that do would appear to have > hard-to-trigger deadlocks. > > Why do we do that in callers, though? I.e. why not do something like this: This problem is not specific to vmalloc(). It is difficult for non-fs developers to determine whether they need to use GFP_NOFS than GFP_KERNEL in their code. Can't we annotate GFP_NOFS/GFP_NOIO sections like http://marc.info/?l=linux-mm&m=142797559822655 ?