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 4D0DDC53210 for ; Sun, 8 Jan 2023 09:30:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D2888E0002; Sun, 8 Jan 2023 04:30:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 65C7F8E0001; Sun, 8 Jan 2023 04:30:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FC9E8E0002; Sun, 8 Jan 2023 04:30:57 -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 3D7878E0001 for ; Sun, 8 Jan 2023 04:30:57 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 145FBAA484 for ; Sun, 8 Jan 2023 09:30:57 +0000 (UTC) X-FDA: 80331112554.04.CA519EF Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf17.hostedemail.com (Postfix) with ESMTP id 63D1440004 for ; Sun, 8 Jan 2023 09:30:55 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="IjJc/c5Q"; spf=pass (imf17.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673170255; a=rsa-sha256; cv=none; b=qnjnTd6ZXc1C7ETFiWDQOgKOM2EVYShHCXFPPo1QmddAYcNZ4Qj/3nP7BJh6ayrguhdHY/ NGSzKOanZZfhDQwZ/HiMjTIs4pXOT9Gesa0Lv9Gx3Pq8SaxNx51Ey+I6ckvCoKmV/syk31 MBQ5DxCWJdrFqhauLGh/u1OspjR3I64= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="IjJc/c5Q"; spf=pass (imf17.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673170255; 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=zny6K9G44tPDU1Meown4sh2NFAHIQ96Z2uNsKUtqjeE=; b=zfPYx96Fc+p2sKvxDwwqUXsJ8bOqihc580259/4BiMCIFDNhNDaBQP6c137Lj9Vnnm2/OC YQqOKEJqT1NrF+Q3JUNaRHWy0sVINpqqSItoyN9u4+L9k9Mqs/X2VCFj5tdISS/1Ds+Eze qxgHdm86ZfDcG4LiRlS8HHnfpBUsh1A= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 28BDCB8069B; Sun, 8 Jan 2023 09:30:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16F24C433EF; Sun, 8 Jan 2023 09:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673170251; bh=kOhhVFFhBDGqUh/brGt5JGVkand7yI9Pjr/HEe7Ulxk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IjJc/c5QE4w+O313L9gvAEilkwzuGR/fSlK3BYDNEfErYiMj/NtW3FY+cdzFkw6Tg MS7k2+l+NpX3KRqD25fLUNAmaUrEpiiEFt2KrW6G6I/Y7xR4CNC/T1U+x6bLoemMbm ihpgySs8fLdY0dB7VgLOk2AuqQHowoOCh7ogBL0rdNGscutqrzJeULgKjU09XpuJTI cbmLSUQTCBqjzgg+3pwggUWwx0BbKiiMnk3BRLh1NaBcMOISfuun6PwLqoubUx0HQJ 80gKJzjLAADutN5LLyyZCxyQ25xo19wAx9zC7D3IPCBXoQbs5KOgLBhC4G9ZPxHIVC z99fZB9Gp70fg== Date: Sun, 8 Jan 2023 11:30:37 +0200 From: Mike Rapoport To: Mel Gorman Cc: Linux-MM , Andrew Morton , Michal Hocko , NeilBrown , Thierry Reding , Matthew Wilcox , Vlastimil Babka , LKML Subject: Re: [PATCH 6/6] mm: discard __GFP_ATOMIC Message-ID: References: <20221129151701.23261-1-mgorman@techsingularity.net> <20221129151701.23261-7-mgorman@techsingularity.net> <20230106093524.ck5otyaopd724een@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230106093524.ck5otyaopd724een@techsingularity.net> X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 63D1440004 X-Stat-Signature: smpuoy9he6a6obkxcwo9k8ajayjsahsg X-HE-Tag: 1673170255-52479 X-HE-Meta: U2FsdGVkX18o27MCiG8qDajEP4cCNBVIF2UyHwyCDq5z+BxFMMoUZuYCVRz5VfcYQM8SL8PvH0SVHVk3QYT0uLsq+AhZLPYWEXhVY5Qq1EEy4ej4d2PVevTe/K4VxQIxd//YOzPhqMLd8XD/S57nleziYqOetPcMHQuUyrQbO5VWyONmCJUYXS800r3f+s7rYJl8qZ2+3tndAVnO9OD+rD1bS6jo1q1+qkcGOQ0YjAEbsesmksvz0saA7Qwe2RZ39iKEH6tab83IAmTL1FDifCxqvvsd4akaRJUGfpGYKr18qAHT2jLCqxPSjjr6Eekp5hKgH4jpzaOyQdiiRLGSn6Wa3bgEKm2jpjVF9B1xYZJabkGCYvowAU4OqXCiriPk8RnZHY3GzV9eIQUBb2zDVnePvIeO6+UqvaT36m3jKZYKbElyDnQHFUJkK2ustUqdsUW3ThIwDwOfu3Ivg13d6jltmXZE/4RCqlo+cl6aaMRnFYFNCurvEe8pL7vdFsjtanLsgN6MdBUHXKFT2lNF4S6w3ZvRIS+wT/6Y/hjPVPrrlN0zanMQiGudvqttG+idZzq9QtvwRGFCzmed81iZaj72GcOpzr4eZvzr4tXWd8addb9liByGBu5e/PFl8zvLlDL7rXgwEkLNX6WTxNL/E+pfgCwMNy7h0H4OgWzrEU0GzrKKgcrtwRf11bXuzxLK++SCeVnScTW0ho1FppTbBwKcEL6pAMnU4e2En3qbf/FA7JmG5rP9P2BwZNLY5IpqDEkW+LUQnCdlrV78n7D1rC8bN+IX0pr9xka6XW/N7TC32Uu5g1xWz5icqfoXuMfq2NlCNJiWuqtDDUeX562WUmLAJsHLWO3n+cGja3NfOGiEud3B6AYwJuef6lPefF+t/Mh/yILuHXgrYirNdYVFKbbihd8zWDZooz1Vlk2kH8CrP7NRDFvYkAnGRSj+xFPg2UHAXyr0fjRACKnhget J9AEw4tZ 0VTQo6saGBLMCNNUv38WRC8DpNBt7mukN4NZ+sl3Nchtq/UJG89+dvq2M9cCM9gUW5J5WNdbSrb8BvDLa9KsMZX4VDSotZ+VlH8uDZ7xLxeOPNoORBtEoTMe+K69DiOedgwSNerSpOvcTuBV50ghK/wpzXg== 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, Jan 06, 2023 at 09:35:24AM +0000, Mel Gorman wrote: > On Thu, Jan 05, 2023 at 03:49:44PM +0200, Mike Rapoport wrote: > > Hi Mel, > > > > On Tue, Nov 29, 2022 at 03:17:01PM +0000, Mel Gorman wrote: > > > From: NeilBrown > > > > > > __GFP_ATOMIC serves little purpose. Its main effect is to set > > > ALLOC_HARDER which adds a few little boosts to increase the chance of an > > > allocation succeeding, one of which is to lower the water-mark at which it > > > will succeed. > > > > > > It is *always* paired with __GFP_HIGH which sets ALLOC_HIGH which also > > > adjusts this watermark. It is probable that other users of __GFP_HIGH > > > should benefit from the other little bonuses that __GFP_ATOMIC gets. > > > > > > __GFP_ATOMIC also gives a warning if used with __GFP_DIRECT_RECLAIM. > > > There is little point to this. We already get a might_sleep() warning if > > > __GFP_DIRECT_RECLAIM is set. > > > > > > __GFP_ATOMIC allows the "watermark_boost" to be side-stepped. It is > > > probable that testing ALLOC_HARDER is a better fit here. > > > > > > __GFP_ATOMIC is used by tegra-smmu.c to check if the allocation might > > > sleep. This should test __GFP_DIRECT_RECLAIM instead. > > > > > > This patch: > > > - removes __GFP_ATOMIC > > > - allows __GFP_HIGH allocations to ignore watermark boosting as well > > > as GFP_ATOMIC requests. > > > - makes other adjustments as suggested by the above. > > > > > > The net result is not change to GFP_ATOMIC allocations. Other > > > allocations that use __GFP_HIGH will benefit from a few different extra > > > privileges. This affects: > > > xen, dm, md, ntfs3 > > > the vermillion frame buffer > > > hibernation > > > ksm > > > swap > > > all of which likely produce more benefit than cost if these selected > > > allocation are more likely to succeed quickly. > > > > > > [mgorman: Minor adjustments to rework on top of a series] > > > Link: https://lkml.kernel.org/r/163712397076.13692.4727608274002939094@noble.neil.brown.name > > > Signed-off-by: NeilBrown > > > Signed-off-by: Mel Gorman > > > --- > > > Documentation/mm/balance.rst | 2 +- > > > > Documentation/core-api/memory-allocation.rst needs an update as well, and > > there are other mentions of GFP_ATOMIC in Documentation/ > > > > What part do you think needs updating in that file? > > There are two references to GFP_ATOMIC in that file, one about accessing > reserves and another about non-sleeping allocations and the accuracy > does not change after the series. You are right, I got confused. > If anything, this statement should change because it invites GFP_ATOMIC > abuse for spurious reasons > > * If you think that accessing memory reserves is justified and the kernel > will be stressed unless allocation succeeds, you may use ``GFP_ATOMIC``. Care to send a patch? ;-) > There are other references to GFP_ATOMIC in Documentation/ that are are a > little inaccurate but not in a way that is harmful and is not changed by > the series. For example; > > GFP_ATOMIC requests are kernel internal allocations that must > be satisfied, immediately. The kernel may drop some request, > in rare cases even panic, if a GFP_ATOMIC alloc fails. > > This is a stronger statement than GFP_ATOMIC deserves but it's close enough > in the given context. > > -- > Mel Gorman > SUSE Labs > -- Sincerely yours, Mike.