Received: by 10.192.165.148 with SMTP id m20csp4983840imm; Tue, 24 Apr 2018 11:37:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx49EGCpmyytbF2ztBXzXDj9f86MR5PJqq4DxlM1wvsePxhPG46XA+lc6P+Zh3zvIAaDTUGsl X-Received: by 10.98.87.84 with SMTP id l81mr7532359pfb.56.1524595059008; Tue, 24 Apr 2018 11:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524595058; cv=none; d=google.com; s=arc-20160816; b=jmBfoHa/bujWCya1eRHVcR7GSsVUrrLn2XMQRi+X580pAc33KVTI8lgTms00EkVPL9 p/bfcgAuX6QJQE3IhHyDCJuEoCvARQSdP5V0oZFQvICNHT35rJVk66gzzUscliImUIEZ JatRRU1HQcNoBHhdbqMaT0IYbh0fm7vP4mzKk5h3xUDDHFy3qY53NHOe4pmvffNLUk1a HhnUBt3NOEaTGQ0rZYGgX6iGC/VdNOt+8UtXCJS9FZXO65r9AmvVZiRG2NSwccZSIpqX y/HHFmiu/TXuUb5bb8SGTMP4bNfUKGwXEiPgSDVcc15Z5YAoNoeDQD2wKXY1HCcLyxVa k1Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=1ACozVCOzwG4ZZz8BSoLIuQmqw1Xm4d77uo/T1KLgtY=; b=eaMVWrpv+NR0PbtNI5f/Ku56oSJujYhmDYC4L+Z7x988DDXeGp4luLAgVOAoiTnYH2 7WU/jqI4ECSZbIL1kfkeufXVHeE9aB/m0MvDG/la6TDftxcNrJR4/f+WbfWEnSyOKpOu n+Do3GuxyQGf0xw2G88pIN86cXcQUCBmxXoTWijLKgYrlW3OGKMRKLC3T4VqwySmnRVh pb6T4TNSYZjNSPdf45+Ib7BRx3PqeRJ8kU99zqsbANZcnWPkOz86LdmGPVlZn1QJhsON xtJTC6RUUSc9PVJf85VOrUKEGo3THcAXZivjMlZY2SMC5UkGlKWaFGG97Cyo3xjCfbut WfmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=IBiq5tLO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q127si11878648pga.326.2018.04.24.11.37.24; Tue, 24 Apr 2018 11:37:38 -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; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=IBiq5tLO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751561AbeDXSgD (ORCPT + 99 others); Tue, 24 Apr 2018 14:36:03 -0400 Received: from imap.thunk.org ([74.207.234.97]:52818 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295AbeDXSf7 (ORCPT ); Tue, 24 Apr 2018 14:35:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1ACozVCOzwG4ZZz8BSoLIuQmqw1Xm4d77uo/T1KLgtY=; b=IBiq5tLO4wLcuj+sF4b5ctJaq/ 4E7M589McYadOHy0gc+ZNEl1V3hXQcAUkR/aiPx/EKCvECOcPPXL4i9Efc7Zz5aHxN3/H+vlvcq8n tPIZW717hO0n731NwBbrBitv+7/Kg+7XQ+a8OpuuMPPsi8aS+aw6OVxCjG6SQtXYT29Y=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1fB2mv-0007op-Pv; Tue, 24 Apr 2018 18:35:37 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 4D4477A4557; Tue, 24 Apr 2018 14:35:36 -0400 (EDT) Date: Tue, 24 Apr 2018 14:35:36 -0400 From: "Theodore Y. Ts'o" To: Michal Hocko Cc: LKML , Artem Bityutskiy , Richard Weinberger , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Cyrille Pitchen , Andreas Dilger , Steven Whitehouse , Bob Peterson , Trond Myklebust , Anna Schumaker , Adrian Hunter , Philippe Ombredanne , Kate Stewart , Mikulas Patocka , 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 Message-ID: <20180424183536.GF30619@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Michal Hocko , LKML , Artem Bityutskiy , Richard Weinberger , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Cyrille Pitchen , Andreas Dilger , Steven Whitehouse , Bob Peterson , Trond Myklebust , Anna Schumaker , Adrian Hunter , Philippe Ombredanne , Kate Stewart , Mikulas Patocka , linux-mtd@lists.infradead.org, linux-ext4@vger.kernel.org, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, linux-mm@kvack.org References: <20180424162712.GL17484@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180424162712.GL17484@dhcp22.suse.cz> User-Agent: Mutt/1.9.5 (2018-04-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 24, 2018 at 10:27:12AM -0600, Michal Hocko wrote: > fs/ext4/xattr.c > > What to do about this? Well, there are two things. Firstly, it would be > really great to double check whether the GFP_NOFS is really needed. I > cannot judge that because I am not familiar with the code. *Most* of the time it's not needed, but there are times when it is. We could be more smart about sending down GFP_NOFS only when it is needed. If we are sending too many GFP_NOFS's allocations such that it's causing heartburn, we could fix this. (xattr commands are rare enough that I dind't think it was worth it to modulate the GFP flags for this particular case, but we could make it be smarter if it would help.) > If the use is really valid then we have a way to do the vmalloc > allocation properly. We have memalloc_nofs_{save,restore} scope api. How > does that work? You simply call memalloc_nofs_save when the reclaim > recursion critical section starts (e.g. when you take a lock which is > then used in the reclaim path - e.g. shrinker) and memalloc_nofs_restore > when the critical section ends. _All_ allocations within that scope > will get GFP_NOFS semantic automagically. If you are not sure about the > scope itself then the easiest workaround is to wrap the vmalloc itself > with a big fat comment that this should be revisited. This is something we could do in ext4. It hadn't been high priority, because we've been rather overloaded. As a suggestion, could you take documentation about how to convert to the memalloc_nofs_{save,restore} scope api (which I think you've written about e-mails at length before), and put that into a file in Documentation/core-api? The question I was trying to figure out which triggered the above request is how/whether to gradually convert to that scope API. Is it safe to add the memalloc_nofs_{save,restore} to code and keep the GFP_NOFS flags until we're sure we got it all right, for all of the code paths, and then drop the GFP_NOFS? Thanks, - Ted