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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19F9EC4828D for ; Thu, 1 Feb 2024 15:59:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C8076B0093; Thu, 1 Feb 2024 10:59:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 977D46B0096; Thu, 1 Feb 2024 10:59:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83F6D6B0098; Thu, 1 Feb 2024 10:59:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 747196B0093 for ; Thu, 1 Feb 2024 10:59:13 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 444AA1604BB for ; Thu, 1 Feb 2024 15:59:13 +0000 (UTC) X-FDA: 81743694186.25.105453C Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf25.hostedemail.com (Postfix) with ESMTP id 1D434A0016 for ; Thu, 1 Feb 2024 15:59:09 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=vBFB9v4m; dkim=pass header.d=suse.com header.s=susede1 header.b=vBFB9v4m; spf=pass (imf25.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706803150; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QMyMhVacT5QeEHBmhzg+MX1Mr6dLBY+wzQ4mwXlFXXk=; b=uJbfnYgS+rFYMp1fXkoo67e4NOS2dD46KHzqtRxO/LdE1wCyP25IpGlwK8fxeMQRvMlIFd Xga5ERZboDw0QVNQ+h5w6qgsb+oiuEllB83pKNYDogaAm5QGhnJxe3GUEOEhJor3ckePDO JypsEmx9sx8T5/hlnXSFi5dpjYoUwx0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706803150; a=rsa-sha256; cv=none; b=r6JBIIFD4SCg2eADADXSt9HV0VHlwOxM0Z8azrBOa9rznojLWwdilGa4nNNFOkfIm/bg5F Wx4C/7SciHfPsgTtne46WEcvsForHqi0UaoT/540KxIUGb4DhpdLevU5fG9714d0HnxLJv y/5ToEBVTmQZly+UdBT5FcYX7MLGqv4= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=vBFB9v4m; dkim=pass header.d=suse.com header.s=susede1 header.b=vBFB9v4m; spf=pass (imf25.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1EA991FBCD; Thu, 1 Feb 2024 15:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706803148; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QMyMhVacT5QeEHBmhzg+MX1Mr6dLBY+wzQ4mwXlFXXk=; b=vBFB9v4mOMEsvTcDeXzNh78YqsMGXGGTYI4TypMbd2G5wqmWGDA2ZDFi5QcRKz6ciChUyD x8CzV0KVm2GCrjHVE9A8AUd1uZxLYTMorlRCkgXA0jkORYgOk4L7uujttRPz86eemaRLvr rLO88MSmkjRmwHAlwd+A8rdWncDt3AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706803148; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QMyMhVacT5QeEHBmhzg+MX1Mr6dLBY+wzQ4mwXlFXXk=; b=vBFB9v4mOMEsvTcDeXzNh78YqsMGXGGTYI4TypMbd2G5wqmWGDA2ZDFi5QcRKz6ciChUyD x8CzV0KVm2GCrjHVE9A8AUd1uZxLYTMorlRCkgXA0jkORYgOk4L7uujttRPz86eemaRLvr rLO88MSmkjRmwHAlwd+A8rdWncDt3AA= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 067ED13672; Thu, 1 Feb 2024 15:59:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id G6GjOsu/u2W6DwAAD6G6ig (envelope-from ); Thu, 01 Feb 2024 15:59:07 +0000 Date: Thu, 1 Feb 2024 16:59:07 +0100 From: Michal Hocko To: Kent Overstreet Cc: linux-mm@kvack.org, Vlastimil Babka , Matthew Wilcox , "Darrick J . Wong" Subject: Re: [PATCH 2/2] mm: introduce PF_MEMALLOC_NOWARN Message-ID: References: <20240126220756.395187-1-kent.overstreet@linux.dev> <20240126220756.395187-2-kent.overstreet@linux.dev> <3lzd24v653hn7ks6ocdeos6xkppk5l7pgun7nysmmmsfgrjob3@mqynwkythb4d> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3lzd24v653hn7ks6ocdeos6xkppk5l7pgun7nysmmmsfgrjob3@mqynwkythb4d> X-Stat-Signature: igttykdi9nynz7msj9ms8ubbtayem3ho X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 1D434A0016 X-Rspam-User: X-HE-Tag: 1706803149-992275 X-HE-Meta: U2FsdGVkX1+cUXpbVZy6WYT7krEm39aidQsB4ucsysDvBTHqPNAgb1VwBB2g8F4sY4EKlqHd9nnr0dHfzu8oqfPfiYHDhB5QhjKg97x4dto5uloeW39M9haSAgRZw8jZLZuiYi6WxO+SD+sbKbpZkctvWSkMNonsKZLj0L2N8V/B2fDmMMOgAEAgY6Gn08OhriX7dtYoEWWYMLPv3ROuryPoE01Lit22rtQuzXWq/4ZZ0I3+sRazKMUNaFg2RdDSV4R74tepmnTD8gOqgEbij1R1au0dJq223HobaU8ToYSphJcnCeRYvOxEgzg8TpJztHS04HlrdimRfbZOPLlBGuebdBTJfKD78mGOBuqmp7mlAhlLjzgVVHfcJKVbNxkEQFZ3jHBQhgpm/3L9RB2PLDHd+D0fvUlmf7+8xyLIQDXXpnUbB6BRFnAPZtk7e+wS+jOJD0jgoZ+yeM1I9mwq2gIHp8ZTcGQ02X6dAOa58TeQyApnnjVxnZ3oJ1V9lNlSdqBDVzcT7seQ8yHWOStju+z90EKfxySaHFSEa2FpQIfmoYjl8yrkplJnQmLkH+6qkeOPLspsX3pnBNXU3K8pDKjPCMs4QD2bWueIMmwfXj6dGQiDj36vFs+h80k7UOsA4IUDfdUscIN1TDl8c/CiID2bWAkvFEZ1ey5Smr4qk9IE1SXCzLu/58n41PltOQ42KqkLwrxNXZgpdgDRAyuyGNxM+QG2n0aVE+W3cFDcXDob9bDkWC4KT60NyaRUbLNkLyifzPUlUlla251IT1VKu7GYq+cK6bKI8zRnpARCLx8LWTLXHpWqrZh4JSTPlSVxWE7XLoFnBKOIY8pySK6eU+/EsPIM51G0eh3yHMh1WCO6Nc0lDZbNT7o8tiDGywSnTeYKc9D8Fli0w8LpGECStyvi8EyyP3oPu+I2Ow9S6aZv+ZzKqj7yj2kmL5Dqj6hN9tPRCREbdrc++bUbdGP jthSKX3+ sRtj2eeW2G2mNPBmrEK/0vojB765VhPvEm9F42TQ+tiMGDFpl92TfqIo9OcozraxFYH2bIrBV1YovicKbi5r9AnEe1lsCv6IogWxR/eDOHuOLqrQKtH3FAS+Ji/PrewPMJSublnVuiro/6OjJO/Z/EvdshNZ5+UQafYQKX2WME1nt6Eeb+RZmFC4MpWGmzSpUEXJvF2K3fOBbyddgWzkje0PW0htO/88NX2kxzN50OjgRDxfD1zNsDpo0tsk+cgfFouoU X-Bogosity: Ham, tests=bogofilter, spamicity=0.000509, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu 01-02-24 06:03:27, Kent Overstreet wrote: > On Mon, Jan 29, 2024 at 11:48:00AM +0100, Michal Hocko wrote: [...] > >From 0e87e55058ccddde4b6bcc092f43e66a4e632575 Mon Sep 17 00:00:00 2001 > From: Kent Overstreet > Date: Thu, 25 Jan 2024 19:00:24 -0500 > Subject: [PATCH] mm: introduce PF_MEMALLOC_NORECLAIM, PF_MEMALLOC_NOWARN > > Introduce PF_MEMALLOC_* equivalents of some GFP_ flags: > > PF_MEMALLOC_NORECLAIM -> GFP_NOWAIT scoped NOWAIT/NORECLAIM semantic has been proposed in the past. I haven't been fan of it TBH. This is really tricky because unlike other scoped flags this changes the allocation failure semantic for the code that is not really aware of that. Even worse if the code inside the scope has a completely different allocation failure requirements - e.g. consider a nested GFP_NOFAIL request. Your implementation would simply override that and cause an unexpected failure. Now you could exclude GFP_NOFAIL explicitly but that brings more problems down the road - e.g. consider the scope NOWAIT is a way to prevent from sleeping from within atomic context. Now nested GFP_NOFAIL request either busy waits or sleeps inside of an atomic context. No good! -- Michal Hocko SUSE Labs