Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp272336ybz; Fri, 17 Apr 2020 00:33:23 -0700 (PDT) X-Google-Smtp-Source: APiQypJlGjG14TRjpAlPQQMcCk4q1eyU46AbSOYv5AkQ3kAGMqiyLKJLmu3zqTvcgX+iFMS47+QY X-Received: by 2002:a50:e40d:: with SMTP id d13mr1643351edm.122.1587108802789; Fri, 17 Apr 2020 00:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587108802; cv=none; d=google.com; s=arc-20160816; b=DlfvfBUkJafhm8DHlkBkCT84dZGk9XYZnKValb1sE5yidJIn6AYBBb9jPa+c082YbN Ckk4vMNGhdXXwCLUWLRkBqYWDARx5KIKJDG6UzyfOrISZhDI+FKJdLLx6AbfYIeN8dbG rZADuHTtQD5JRhWzv93WxMOsfpfgtQztLxKrivsGEcB8FeJuY+dzasgOFoaoFM/fbv57 sqhgo/M1GhyOgUHS+q0HZyFoSmbV0yb3PQvoB0jnPCGX+fu4BK1tAPaKNT8jUmEBRpRC vmVleRJb+Xj/SvLxLdb0T7u2Is9LE6UPYabMlwV6Eem6KJOuXlY7Q1WZYRd0YkFeAlrr nL2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+AdJjVSPFFgTfj/HyAVB1EqazKksGsV1ZI1hF7Y4UOk=; b=peGc/AI7C2OP2Nyr7ZHtuWeMW+ab/tF/hLR0CIC7aClbG68poFJuluptIX8Twep39r erIsTlnrLtfYodSRKZIRxKTlowOhW+OxpOaOayS0d/+b4+WW/ZRzYhz2L5f5FRGDjJ88 Iu7dyPWbOeygo1z5OJLkGgipBwc7tmmIg3doYvcFtyFQ9xPWskRHrbli6h0SEz30OE9P stoRN624YZUYdveIqngmGsxW64kWacD6XC7KZW6k1rcHhtuxseyRnxeY7TJ7qp4KvvEF glKlH0KpjnJwK7Vve7PtmDnG8DDmSK2tWYkvqtAO9AD63j+7y3apglrtuopRrW72VSTg QT5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tczxyNyN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si14899390edy.69.2020.04.17.00.32.57; Fri, 17 Apr 2020 00:33:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tczxyNyN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728938AbgDQH3h (ORCPT + 99 others); Fri, 17 Apr 2020 03:29:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728419AbgDQH3h (ORCPT ); Fri, 17 Apr 2020 03:29:37 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65D2FC061A0C; Fri, 17 Apr 2020 00:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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; bh=+AdJjVSPFFgTfj/HyAVB1EqazKksGsV1ZI1hF7Y4UOk=; b=tczxyNyNA3+ZMs0GthRHP3fwnP Sct8xH6GNEXuA/a4VryU2imFJknluHl9Vk8EpzrEwJ3/R7HYflWhJkmVNR9Hh9yqIpF9fG7hSgsuY aNc2r0+qGqvQHPHO0ufRaENKrUuRl2fsrR7j+SkAzF/p9LPCM5D7P5bWjt890h/chUXHYtlnlCs8s M1+p2W+QIJ/9TvQB1suAyP7Hlm/eoI7hvPiv4Zcrj52TZ2nEW9jNjv/d68eKfoQ13/olxgngM2gMQ n52SMP4rb2bFzIsl9lgvXSvLDMyXA8Ikw+iNqKL8GoKb9PpOmWh5GaKuMzjhEU52rujNY7XPkbLK6 zb/2AdvA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jPLRL-00008d-3k; Fri, 17 Apr 2020 07:29:31 +0000 Date: Fri, 17 Apr 2020 00:29:31 -0700 From: Christoph Hellwig To: Michal Hocko Cc: "Darrick J. Wong" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, LKML , Dave Chinner Subject: Re: implicit AOP_FLAG_NOFS for grab_cache_page_write_begin Message-ID: <20200417072931.GA20822@infradead.org> References: <20200415070228.GW4629@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200415070228.GW4629@dhcp22.suse.cz> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 15, 2020 at 09:02:28AM +0200, Michal Hocko wrote: > Hi, > I have just received a bug report about memcg OOM [1]. The underlying > issue is memcg specific but the stack trace made me look at the write(2) > patch and I have noticed that iomap_write_begin enforces AOP_FLAG_NOFS > which means that all the page cache that has to be allocated is > GFP_NOFS. What is the reason for this? Do all filesystems really need > the reclaim protection? I was hoping that those filesystems which really > need NOFS context would be using the scope API > (memalloc_nofs_{save,restore}. This comes from the historic XFS code, and this commit from Dave in particular: commit aea1b9532143218f8599ecedbbd6bfbf812385e1 Author: Dave Chinner Date: Tue Jul 20 17:54:12 2010 +1000 xfs: use GFP_NOFS for page cache allocation Avoid a lockdep warning by preventing page cache allocation from recursing back into the filesystem during memory reclaim.