Received: by 10.192.165.148 with SMTP id m20csp838957imm; Wed, 25 Apr 2018 08:26:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx487IW4v3Vg7Vlz8Z063C9WUlQA71MGtgKlgMX4Cmhypr8aMwg0PHxJyKqbBkwJcmDBn8OaW X-Received: by 10.101.96.47 with SMTP id p15mr23990661pgu.430.1524670016740; Wed, 25 Apr 2018 08:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524670016; cv=none; d=google.com; s=arc-20160816; b=xLIW/X3gZBWbq2UJSbUoDW8pPVUfArwrAohwcBYSZx2tAuMrImcWwBR1KGw92UOec5 ykYCWYv+65NMm5QyerKyeIVs5jkDboMgx5aO9STHudYzhuL41KOLckzZaATS/I8RX5l1 M75y43QtBmh5LSTm/yxXtgXxDwHu1ffDiCrgoDygsq1OlOhesbwgSLx4mM18hy9Q5mk/ hu8UuxFXbeUr2E3/IY0jKP0eEwXTBoWnBOLD33S2PsiP1fOsLZgpmAsxuo8W5NdFUZNL SZptGPfYL7K1sTxURmAyagIAk22TQCBTg1urT8OQSCBN1Tam8NmlotsF19DMjzW5izJ0 20Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=OexNb6FnUM9zswi83LU3j6AIFZN5daUK5XeDh9l544k=; b=cl1ik0OZFncbHmfXoTBz5FltAwDrgb0pF6ZRuTejaMrUX7Rd/wiu7ncd4yxzXd6SCN UwbIntd11MNKihDowmuf6xKXFOSs3dZuQC1S60gUw47/EBaYDnxi6UM3oLyrJJswIYqA uY0YtXP6sW2/bUXAkXmLdNwHvdSv7x1Ve1yXgeZqB8zgoBsC643y7s/emvnMCs7HV/U+ oP1R3TwPx7pGNbwVpEpWkmeWmouMsojwOhNz6PcuxKQpqvfylBjRq2c8U3NX7O5do46h CWqpSPW2oMtl4EAXs1B6fIeFHUORlem/arz6Z6oPOJv3eVcMC4Aj+tgWbUnaNB27gXY3 g6/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si13637952pgb.281.2018.04.25.08.26.42; Wed, 25 Apr 2018 08:26:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754843AbeDYPZP (ORCPT + 99 others); Wed, 25 Apr 2018 11:25:15 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48454 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754320AbeDYPZM (ORCPT ); Wed, 25 Apr 2018 11:25:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 634904072CF9; Wed, 25 Apr 2018 15:25:11 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBFE2202342F; Wed, 25 Apr 2018 15:25:10 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id w3PFPAqn013519; Wed, 25 Apr 2018 11:25:10 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w3PFP9qV013515; Wed, 25 Apr 2018 11:25:09 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Wed, 25 Apr 2018 11:25:09 -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: <20180425144557.GD17484@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> <20180425144557.GD17484@dhcp22.suse.cz> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 25 Apr 2018 15:25:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 25 Apr 2018 15:25:11 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mpatocka@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Apr 2018, Michal Hocko wrote: > On Wed 25-04-18 08:43:32, Mikulas Patocka wrote: > > > > > > 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: > > > > > > > > > > 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. > > So what is the difference with the current GFP_NOFS? My point is that filesystems should use GFP_NOIO too. If alloc_pages(GFP_NOFS) issues some random I/O to some block device, the I/O may be end up being redirected (via block loop device) to the filesystem that is calling alloc_pages(GFP_NOFS). > > > > 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? > > That the loop driver should make sure it will not recurse. The scope API > doesn't add anything new here. The loop driver doesn't recurse. The loop driver will add the request to a queue and wake up a thread that processes it. But if the request queue is full, __get_request will wait until the loop thread finishes processing some other request. It doesn't recurse, but it waits until the filesystem makes some progress. Mikulas