From patchwork Thu Nov 9 21:15:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13451750 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31B04C4167D for ; Thu, 9 Nov 2023 21:15:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A77904401AA; Thu, 9 Nov 2023 16:15:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A26BF440183; Thu, 9 Nov 2023 16:15:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C7C14401AA; Thu, 9 Nov 2023 16:15:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1E820440183 for ; Thu, 9 Nov 2023 16:15:18 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E40A51CAB1B for ; Thu, 9 Nov 2023 21:15:17 +0000 (UTC) X-FDA: 81439671474.08.823A6B6 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf24.hostedemail.com (Postfix) with ESMTP id 9C104180002 for ; Thu, 9 Nov 2023 21:15:14 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=JFV5Bs24; dmarc=none; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699564515; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=bkCl5OqaBwjr8Wp3TIpZ0yixG4f4EXLtVKQiFMou+24=; b=7u092YyoMeIPL2rnof1dgxvEKemgcntoUV2oSTajAwz3YlVGtPYcCFK2p0Z2hDdoEVi9Js ZgbVffYmS7IJvJKUcoj74OjiKrZLXUOZnw1IC+aJsHlCvIwPl42JTYmY+TYoCxx/RtdIWx 5LOYj+3i7Ya/EMToQbtmHRLU5sO7ZzA= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=JFV5Bs24; dmarc=none; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699564515; a=rsa-sha256; cv=none; b=d6D1u9afXS6hJGSAue9RIhvFVUHZ+r7T8/42BVyYzOvwHM1CCH7Me7e+OP5TzP4JKWWaEt BZv6GMZtZiwbRanBvudoH8LTvanzWKDrBXHKXqv1S9KIeRYGDiqXYgJ6JzlufUiDYVRy20 oHztPtCBDWcA/G7yfhejtRW+DJ+NLrY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=bkCl5OqaBwjr8Wp3TIpZ0yixG4f4EXLtVKQiFMou+24=; b=JFV5Bs24DOTAdVlRJDZBZDjqg8 KbUp3wbw/sO3+EpMTVC2NugOWDgz6B82qX6ub7InkVhfaSohe2epXS4L/UPDyINFgij7uso4RE73u sEE7FBrH1YlLgIHOgighWrUU/C7mNN6OZut+jy6vm/bQnOj4XpMcG8srhns3uJxjQIiFIrDnEZpPM dcPbW6raEZHglI/VOvJinujTcqNkCKOm47zWDYc9u175Jl/sb1Llti588ckCjfkC9jOOqw22pVDVc MpJihG+gFGQ8WSFbJ9YSk2wK2+iJOeSKacnevcy4IsliKxn04eg6AwPsSvegPSbgIWoSiT7t+2t7L Kp6/Cmag==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r1CMo-009UYw-G8; Thu, 09 Nov 2023 21:15:10 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] gfp: Include __GFP_NOWARN in GFP_NOWAIT Date: Thu, 9 Nov 2023 21:15:07 +0000 Message-Id: <20231109211507.2262419-1-willy@infradead.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 9C104180002 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 6aryjen4ieri8z1b9cg9urr1axtab45x X-HE-Tag: 1699564514-689780 X-HE-Meta: U2FsdGVkX19YkKTuhbouFtW62vf3Xz2+fKyMnxoe9zasZcuOM4jy66fsu++mpsDbKvh/kbkCatm2CLosS0MIMdMjgajaxifhuS9Ca/64lW6gL5CEeoWxOhR7bP9CZr1BrgfsW1ln9VfBx7/6xGCpCFZFd5EISWEKpnZ06m0Fr0ZkYsVzEBD1wezMNDxx3XLCIRs3+JAJnSbUbQVHFpZHEijn0Vw6giazgtC6vMJzzPtowkcFykBIYEN4qlnxz+RYTzqUuOJ+3LuO46Wa0T9ZY8T5S7xTiKE4d+2TOS0cKZwGtK+pyXVGcIXksBlNeKnTpAbx/MwqtHVp22NWbE6rWOsAOS5RpbjFni/mXAbdw1TOo+l0lO0NMMYhSsVEHsnjJfwRSW02V7phWOI8hBbBFF1jGkswxzKE5H+AIEfA8JYvFCLMCtxwsRpG3mo4alTcVlOsbO7rFaXUGhnD/IT6ssnnL3SrqMmKS3FlUgrcVaambLhjFgePZ8d55J7sfOaCThyI274mPa8M1HZaNZNULxH8IBvK2BmHWC3ZD2OzNsq0jhp/qRdviH2B1RsF44kJdPWAs5zaDbRbQ6mPCOfYZGK7mUtu+tYKIbHMANaDt9TA5iFM6v06pYA1jDpr75Fwin5S31/SEpLrLUTOKmYaknE6qIL13nE3x2/vApMwCy0V4Dmw+XX7tt3gdt58cduA+zrXMv7wSIihbkDsT1FWVR72y6KB0hbvu1HarR5+DBUiZ/u6GfNybjh46B16EBIR0g2N4oywgC06b9fu9TcV6e34m8YqXBoRffP4ImOhptQDbmaspyx37FhUAh/L1rGnACCbSy8irTE8ya1sxs75lVcqK7yRf2Un37eTUfwXOniEvNzg8NPJeBnicWuXqc/7/7/5qwb74CUyO6mDygL3eo+O6hn3L28JAwGFRw3YMvP1ax/sRAM/2XlQ0Psm1C7LedO8Qeq1KDj2OB70rSu 5xty9QSQ j/1ASYWwonwNkNGolOER/wkZNpVorI06pbuVMXC49+WhVEWTqDyDevFS5ejXDwDIjMlPXaM6OkRJoaP8NQuSVllxqsL/xL0GswAEFdnqZgyQuZ+rB+2FHlvUupnTSmp2oOIXUQTO9utYOuAvv4WaoBOhgOQSATKCmVM6vqb831CZSh2HHEImHpePZXD0kH55pZ5PKn5M+sW9EAiCQ28ukrJKBfXcRfwQ1lHD9 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: List-Subscribe: List-Unsubscribe: GFP_NOWAIT callers are always prepared for their allocations to fail because they fail so frequently. Forcing the callers to remember to add __GFP_NOWARN is just annoying and leads to an endless stream of patches for the places where we forgot to add it. We can now remove __GFP_NOWARN from all the callers which specify GFP_NOWAIT, but I'd rather wait a cycle and send patches to each maintainer instead of creating a big pile of merge conflicts. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/gfp_types.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/gfp_types.h b/include/linux/gfp_types.h index 6583a58670c5..ae994534a12a 100644 --- a/include/linux/gfp_types.h +++ b/include/linux/gfp_types.h @@ -274,7 +274,8 @@ typedef unsigned int __bitwise gfp_t; * accounted to kmemcg. * * %GFP_NOWAIT is for kernel allocations that should not stall for direct - * reclaim, start physical IO or use any filesystem callback. + * reclaim, start physical IO or use any filesystem callback. It is very + * likely to fail to allocate memory, even for very small allocations. * * %GFP_NOIO will use direct reclaim to discard clean pages or slab pages * that do not require the starting of any physical IO. @@ -325,7 +326,7 @@ typedef unsigned int __bitwise gfp_t; #define GFP_ATOMIC (__GFP_HIGH|__GFP_KSWAPD_RECLAIM) #define GFP_KERNEL (__GFP_RECLAIM | __GFP_IO | __GFP_FS) #define GFP_KERNEL_ACCOUNT (GFP_KERNEL | __GFP_ACCOUNT) -#define GFP_NOWAIT (__GFP_KSWAPD_RECLAIM) +#define GFP_NOWAIT (__GFP_KSWAPD_RECLAIM | __GFP_NOWARN) #define GFP_NOIO (__GFP_RECLAIM) #define GFP_NOFS (__GFP_RECLAIM | __GFP_IO) #define GFP_USER (__GFP_RECLAIM | __GFP_IO | __GFP_FS | __GFP_HARDWALL)