From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752465AbcAEPfK (ORCPT ); Tue, 5 Jan 2016 10:35:10 -0500 Received: from mail-io0-f176.google.com ([209.85.223.176]:34083 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752346AbcAEPfF (ORCPT ); Tue, 5 Jan 2016 10:35:05 -0500 Date: Tue, 5 Jan 2016 16:35:01 +0100 From: Michal Hocko To: Al Viro Cc: Dave Chinner , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Ming Lei Subject: Re: __vmalloc() vs. GFP_NOIO/GFP_NOFS Message-ID: <20160105153501.GB15594@dhcp22.suse.cz> References: <20160103071246.GK9938@ZenIV.linux.org.uk> <20160103201233.GC6682@dastard> <20160103203514.GN9938@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160103203514.GN9938@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 03-01-16 20:35:14, Al Viro wrote: [...] > BTW, far scarier one is not GFP_NOFS or GFP_IO - there's a weird > caller passing GFP_ATOMIC to __vmalloc(), for no reason I can guess. > > _That_ really couldn't be handled without passing gfp_t to page allocation > primitives, but I very much doubt that it's needed there at all; it's in > alloc_large_system_hash() and I really cannot imagine a situation when > it would be used in e.g. a nonblocking context. Yeah, this is an __init context. The original commit which has added it doesn't explain GFP_ATOMIC at all. It just converted alloc_bootmem to __vmalloc resp. __get_free_pages based on the size. So we can only guess it wanted to (ab)use memory reserves. -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 5 Jan 2016 16:35:01 +0100 From: Michal Hocko To: Al Viro Cc: Dave Chinner , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Ming Lei Subject: Re: __vmalloc() vs. GFP_NOIO/GFP_NOFS Message-ID: <20160105153501.GB15594@dhcp22.suse.cz> References: <20160103071246.GK9938@ZenIV.linux.org.uk> <20160103201233.GC6682@dastard> <20160103203514.GN9938@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160103203514.GN9938@ZenIV.linux.org.uk> Sender: owner-linux-mm@kvack.org List-ID: On Sun 03-01-16 20:35:14, Al Viro wrote: [...] > BTW, far scarier one is not GFP_NOFS or GFP_IO - there's a weird > caller passing GFP_ATOMIC to __vmalloc(), for no reason I can guess. > > _That_ really couldn't be handled without passing gfp_t to page allocation > primitives, but I very much doubt that it's needed there at all; it's in > alloc_large_system_hash() and I really cannot imagine a situation when > it would be used in e.g. a nonblocking context. Yeah, this is an __init context. The original commit which has added it doesn't explain GFP_ATOMIC at all. It just converted alloc_bootmem to __vmalloc resp. __get_free_pages based on the size. So we can only guess it wanted to (ab)use memory reserves. -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org