From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07460C433EF for ; Fri, 19 Nov 2021 14:10:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3B63C61057 for ; Fri, 19 Nov 2021 14:10:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3B63C61057 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C68576B00A3; Fri, 19 Nov 2021 09:10:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C17726B00A4; Fri, 19 Nov 2021 09:10:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2D886B00A5; Fri, 19 Nov 2021 09:10:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0071.hostedemail.com [216.40.44.71]) by kanga.kvack.org (Postfix) with ESMTP id A42A76B00A3 for ; Fri, 19 Nov 2021 09:10:35 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 65A8318507215 for ; Fri, 19 Nov 2021 14:10:25 +0000 (UTC) X-FDA: 78825864810.15.5B23F8C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf26.hostedemail.com (Postfix) with ESMTP id 0A08C20019F1 for ; Fri, 19 Nov 2021 14:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=94mWcmoxnEKNskCWvbxGNVC/SEQw3zHqxj1V18qgEUY=; b=iBlP9WUwheC0CmIGJ/W8lwcfi/ KV3JTG8aX+Owlufg9SUSewukeU4ZIP4JH7CtMe8aX/m66jcgrSbZfjgMvif9T9S5I7PBxQE/Fix6e MldcBV4zHk+JTJoWsoDNl4PS93qFOPMJL00w4pSli7e0lbprAvOIzMLki1V5jHQdhs9igio2tmh6g uNMq5nsTM7F63o8chHInXMnFHLU1qKUFiEjyco/0tEdD/9qoj1FHvVNjndW9BHOi9WVvN1T7ZtVyl 9LK9FQtedi0Ywe59EaqHqqOh8+UKWcTg/m0+2wbAojZfpubNB3aI4RthpKvQ5ZwPwlf7LqbFo0zru E0CYpMrw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mo4ao-009YSC-QL; Fri, 19 Nov 2021 14:10:19 +0000 Date: Fri, 19 Nov 2021 14:10:18 +0000 From: Matthew Wilcox To: NeilBrown Cc: Andrew Morton , Michal Hocko , Thierry Reding , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MM: discard __GFP_ATOMIC Message-ID: References: <163712397076.13692.4727608274002939094@noble.neil.brown.name> <163727727803.13692.15470049610672496362@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <163727727803.13692.15470049610672496362@noble.neil.brown.name> X-Stat-Signature: g55pic1p3koobspawoqnfjd4kgiwt3q6 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=iBlP9WUw; dmarc=none; spf=none (imf26.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 0A08C20019F1 X-HE-Tag: 1637331023-864087 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Nov 19, 2021 at 10:14:38AM +1100, NeilBrown wrote: > On Thu, 18 Nov 2021, Matthew Wilcox wrote: > > Surely this should be gfpflags_allow_blocking() instead of poking about > > in the innards of gfp flags? > > Possibly. Didn't know about gfpflags_allow_blocking(). From a quick > grep in the kernel, a whole lot of other people don't know about it > either, though clearly some do. > > Maybe we should reaname "__GFP_DIRECT_RECLAIM" to > "__GFP_ALLOW_BLOCKING", because that is what most users seems to care > about. I tend towards the school of thought that the __GFP flags should make sense to the implementation and users should use either GFP_ or functions. When we see users adding or subtracting __GFP flags, that's a problem. > If not, then we probably want a gfpflags_without_block() function that > removes that flag, as lots of code wants to do that - and using the flag > for one, and an inline for the other is not consistent. It's not a _lot_ of code ... block/bio.c drivers/net/ethernet/mellanox/mlx4/icm.c drivers/vhost/net.c fs/btrfs/disk-io.c fs/btrfs/volumes.c fs/erofs/zdata.c fs/fscache/cookie.c fs/fscache/page.c kernel/cgroup/cgroup.c net/core/skbuff.c net/core/sock.c net/netlink/af_netlink.c (excluding mm -- if mm wants to meddle with GFP flags, that's fine) I think a lot of these are probably misguided, eg the filesystems should probably be using GFP_NOFS to prevent recursion.