From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753051AbeDYMnp (ORCPT ); Wed, 25 Apr 2018 08:43:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38342 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751525AbeDYMnh (ORCPT ); Wed, 25 Apr 2018 08:43:37 -0400 Date: Wed, 25 Apr 2018 08:43:32 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Michal Hocko cc: Richard Weinberger , LKML , Artem Bityutskiy , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Cyrille Pitchen , "Theodore Ts'o" , Andreas Dilger , Steven Whitehouse , Bob Peterson , Trond Myklebust , Anna Schumaker , Adrian Hunter , Philippe Ombredanne , Kate Stewart , linux-mtd@lists.infradead.org, linux-ext4@vger.kernel.org, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: vmalloc with GFP_NOFS In-Reply-To: <20180424232517.GC17484@dhcp22.suse.cz> Message-ID: References: <20180424162712.GL17484@dhcp22.suse.cz> <3732370.1623zxSvNg@blindfold> <20180424192803.GT17484@dhcp22.suse.cz> <3894056.cxOY6eVYVp@blindfold> <20180424230943.GY17484@dhcp22.suse.cz> <20180424232517.GC17484@dhcp22.suse.cz> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Apr 2018, Michal Hocko wrote: > On Tue 24-04-18 19:17:12, Mikulas Patocka wrote: > > > > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > On Wed 25-04-18 00:18:40, Richard Weinberger wrote: > > > > Am Dienstag, 24. April 2018, 21:28:03 CEST schrieb Michal Hocko: > > > > > > Also only for debugging. > > > > > > Getting rid of vmalloc with GFP_NOFS in UBIFS is no big problem. > > > > > > I can prepare a patch. > > > > > > > > > > Cool! > > > > > > > > > > Anyway, if UBIFS has some reclaim recursion critical sections in general > > > > > it would be really great to have them documented and that is where the > > > > > scope api is really handy. Just add the scope and document what is the > > > > > recursion issue. This will help people reading the code as well. Ideally > > > > > there shouldn't be any explicit GFP_NOFS in the code. > > > > > > > > So in a perfect world a filesystem calls memalloc_nofs_save/restore and > > > > always uses GFP_KERNEL for kmalloc/vmalloc? > > > > > > Exactly! And in a dream world those memalloc_nofs_save act as a > > > documentation of the reclaim recursion documentation ;) > > > -- > > > Michal Hocko > > > SUSE Labs > > > > BTW. should memalloc_nofs_save and memalloc_noio_save be merged into just > > one that prevents both I/O and FS recursion? > > Why should FS usage stop IO altogether? Because the IO may reach loop and loop may redirect it to the same filesystem that is running under memalloc_nofs_save and deadlock. > > memalloc_nofs_save allows submitting bios to I/O stack and the bios > > created under memalloc_nofs_save could be sent to the loop device and the > > loop device calls the filesystem... > > Don't those use NOIO context? What do you mean? Mikulas From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mikulas Patocka Subject: Re: vmalloc with GFP_NOFS Date: Wed, 25 Apr 2018 08:43:32 -0400 (EDT) Message-ID: References: <20180424162712.GL17484@dhcp22.suse.cz> <3732370.1623zxSvNg@blindfold> <20180424192803.GT17484@dhcp22.suse.cz> <3894056.cxOY6eVYVp@blindfold> <20180424230943.GY17484@dhcp22.suse.cz> <20180424232517.GC17484@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Kate Stewart , Trond Myklebust , LKML , linux-mm@kvack.org, Andreas Dilger , Boris Brezillon , Richard Weinberger , cluster-devel@redhat.com, Marek Vasut , linux-ext4@vger.kernel.org, Cyrille Pitchen , linux-nfs@vger.kernel.org, Theodore Ts'o , Artem Bityutskiy , Adrian Hunter , Philippe Ombredanne , linux-mtd@lists.infradead.org, Brian Norris , David Woodhouse , Anna Schumaker To: Michal Hocko Return-path: In-Reply-To: <20180424232517.GC17484@dhcp22.suse.cz> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: cluster-devel-bounces@redhat.com Errors-To: cluster-devel-bounces@redhat.com List-Id: linux-ext4.vger.kernel.org On Tue, 24 Apr 2018, Michal Hocko wrote: > On Tue 24-04-18 19:17:12, Mikulas Patocka wrote: > > > > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > On Wed 25-04-18 00:18:40, Richard Weinberger wrote: > > > > Am Dienstag, 24. April 2018, 21:28:03 CEST schrieb Michal Hocko: > > > > > > Also only for debugging. > > > > > > Getting rid of vmalloc with GFP_NOFS in UBIFS is no big problem. > > > > > > I can prepare a patch. > > > > > > > > > > Cool! > > > > > > > > > > Anyway, if UBIFS has some reclaim recursion critical sections in general > > > > > it would be really great to have them documented and that is where the > > > > > scope api is really handy. Just add the scope and document what is the > > > > > recursion issue. This will help people reading the code as well. Ideally > > > > > there shouldn't be any explicit GFP_NOFS in the code. > > > > > > > > So in a perfect world a filesystem calls memalloc_nofs_save/restore and > > > > always uses GFP_KERNEL for kmalloc/vmalloc? > > > > > > Exactly! And in a dream world those memalloc_nofs_save act as a > > > documentation of the reclaim recursion documentation ;) > > > -- > > > Michal Hocko > > > SUSE Labs > > > > BTW. should memalloc_nofs_save and memalloc_noio_save be merged into just > > one that prevents both I/O and FS recursion? > > Why should FS usage stop IO altogether? Because the IO may reach loop and loop may redirect it to the same filesystem that is running under memalloc_nofs_save and deadlock. > > memalloc_nofs_save allows submitting bios to I/O stack and the bios > > created under memalloc_nofs_save could be sent to the loop device and the > > loop device calls the filesystem... > > Don't those use NOIO context? What do you mean? Mikulas From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mikulas Patocka Date: Wed, 25 Apr 2018 08:43:32 -0400 (EDT) Subject: [Cluster-devel] vmalloc with GFP_NOFS In-Reply-To: <20180424232517.GC17484@dhcp22.suse.cz> References: <20180424162712.GL17484@dhcp22.suse.cz> <3732370.1623zxSvNg@blindfold> <20180424192803.GT17484@dhcp22.suse.cz> <3894056.cxOY6eVYVp@blindfold> <20180424230943.GY17484@dhcp22.suse.cz> <20180424232517.GC17484@dhcp22.suse.cz> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Tue, 24 Apr 2018, Michal Hocko wrote: > On Tue 24-04-18 19:17:12, Mikulas Patocka wrote: > > > > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > On Wed 25-04-18 00:18:40, Richard Weinberger wrote: > > > > Am Dienstag, 24. April 2018, 21:28:03 CEST schrieb Michal Hocko: > > > > > > Also only for debugging. > > > > > > Getting rid of vmalloc with GFP_NOFS in UBIFS is no big problem. > > > > > > I can prepare a patch. > > > > > > > > > > Cool! > > > > > > > > > > Anyway, if UBIFS has some reclaim recursion critical sections in general > > > > > it would be really great to have them documented and that is where the > > > > > scope api is really handy. Just add the scope and document what is the > > > > > recursion issue. This will help people reading the code as well. Ideally > > > > > there shouldn't be any explicit GFP_NOFS in the code. > > > > > > > > So in a perfect world a filesystem calls memalloc_nofs_save/restore and > > > > always uses GFP_KERNEL for kmalloc/vmalloc? > > > > > > Exactly! And in a dream world those memalloc_nofs_save act as a > > > documentation of the reclaim recursion documentation ;) > > > -- > > > Michal Hocko > > > SUSE Labs > > > > BTW. should memalloc_nofs_save and memalloc_noio_save be merged into just > > one that prevents both I/O and FS recursion? > > Why should FS usage stop IO altogether? Because the IO may reach loop and loop may redirect it to the same filesystem that is running under memalloc_nofs_save and deadlock. > > memalloc_nofs_save allows submitting bios to I/O stack and the bios > > created under memalloc_nofs_save could be sent to the loop device and the > > loop device calls the filesystem... > > Don't those use NOIO context? What do you mean? Mikulas