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 9E272C021BE for ; Thu, 27 Feb 2025 09:16:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F291B280001; Thu, 27 Feb 2025 04:16:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ED8766B0089; Thu, 27 Feb 2025 04:16:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D52AA280001; Thu, 27 Feb 2025 04:16:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B886A6B0082 for ; Thu, 27 Feb 2025 04:16:50 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id CC70DB2B94 for ; Thu, 27 Feb 2025 09:16:49 +0000 (UTC) X-FDA: 83165169738.29.DA3500A Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf14.hostedemail.com (Postfix) with ESMTP id 505C010000C for ; Thu, 27 Feb 2025 09:16:47 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nGchcqsJ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=fPsJTNYS; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nGchcqsJ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=fPsJTNYS; spf=pass (imf14.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740647807; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5lEoqjFyjW2TiBKMGNuW66hnH+fSO6BStXqZzibWZR8=; b=5YcITLoVYFITiwdWkOktLXF2fiXVPLauAIWHelkmtVZ2SFqHPsXV93uQchB+5wvDbZJzPn dfufIziqvdDO0fC2RwwZB+pI1C/+eS5anMC3b1QMjWqFL1Aw936Fd9ZosfEpzOiLJoJu2H Ixr4B40iTr4lWV6XZp8VJfOJvrtstMc= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nGchcqsJ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=fPsJTNYS; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nGchcqsJ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=fPsJTNYS; spf=pass (imf14.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740647807; a=rsa-sha256; cv=none; b=Y5bedoTzNEOBIsn/MnmhakdES51CpiFARSwrYm5vyqo82HWF6kOtzG9uQEu6jdsPrAW+Jy EkUJ2Ux6OlRt7SLLzxJa4CgD1e8ocQGuxBcAVmwOQ8B4skH9exHKmK9MH1bDt8mOd/A24X 5sTMtNzHzinOEVm2xabfsoG6AH6OyZY= 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-out1.suse.de (Postfix) with ESMTPS id 69012210ED; Thu, 27 Feb 2025 09:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1740647805; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=5lEoqjFyjW2TiBKMGNuW66hnH+fSO6BStXqZzibWZR8=; b=nGchcqsJH1dEJDzCTmG62LFhl9R1MJgFnMfyY2/YZZM8C2toInBmhuYMWMxvvTmGs5XYMf XpGqsy/tZzvihKoph2nL+sCZ1E3XVUOH5Qrs7omGJGP1FChSuJKcZpX/Vluk+6251w62Zl BfIBmkY7g5uApPE+36uKRT1uVErtHII= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1740647805; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=5lEoqjFyjW2TiBKMGNuW66hnH+fSO6BStXqZzibWZR8=; b=fPsJTNYS6q2gLguci1lJHjryJoHl4wxjXwB/S4ECwMajWinTUMtlx3Dm6jY3YHGa9dGz1y XuzxxPV+E/B+9+Cw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1740647805; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=5lEoqjFyjW2TiBKMGNuW66hnH+fSO6BStXqZzibWZR8=; b=nGchcqsJH1dEJDzCTmG62LFhl9R1MJgFnMfyY2/YZZM8C2toInBmhuYMWMxvvTmGs5XYMf XpGqsy/tZzvihKoph2nL+sCZ1E3XVUOH5Qrs7omGJGP1FChSuJKcZpX/Vluk+6251w62Zl BfIBmkY7g5uApPE+36uKRT1uVErtHII= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1740647805; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=5lEoqjFyjW2TiBKMGNuW66hnH+fSO6BStXqZzibWZR8=; b=fPsJTNYS6q2gLguci1lJHjryJoHl4wxjXwB/S4ECwMajWinTUMtlx3Dm6jY3YHGa9dGz1y XuzxxPV+E/B+9+Cw== 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 5307E13888; Thu, 27 Feb 2025 09:16:45 +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 jzJ4E30twGdjEAAAD6G6ig (envelope-from ); Thu, 27 Feb 2025 09:16:45 +0000 Message-ID: Date: Thu, 27 Feb 2025 10:16:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Revert "mm/page_alloc.c: don't show protection in zone's ->lowmem_reserve[] for empty zone" Content-Language: en-US To: Baoquan He , Michal Hocko Cc: Gabriel Krisman Bertazi , akpm@linux-foundation.org, linux-mm@kvack.org, Mel Gorman References: <20250226032258.234099-1-krisman@suse.de> From: Vlastimil Babka Autocrypt: addr=vbabka@suse.cz; keydata= xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB 87tMFA+u+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wX PWnhf5WjdoNI1Xec+RcJ5p/pSel0jnvBX8L2cmniYnmI883NhtGZsEWj++wyKiS4NranDFlA HdDM3b4lUth1pTtABKQ1YuTvehj7EfoWD3bv9kuGZGPrAeFNiHPdOT7DaXKeHpW9homgtBxj 8aX/UkSvEGJKUEbFL9cVa5tzyialGkSiZJNkWgeHe+jEcfRT6pJZOJidSCdzvJpbdJmm+eED w9XOLH1IIWh7RURU7G1iOfEfmImFeC3cbbS73LQEFGe1urxvIH5K/7vX+FkNcr9ujwWuPE9b 1C2o4i/yZPLXIVy387EjA6GZMqvQUFuSTs/GeBcv0NjIQi8867H3uLjz+mQy63fAitsDwLmR EP+ylKVEKb0Q2A== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Action: no action X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 505C010000C X-Stat-Signature: e9bwwrnbt3rfwc8hq991r97x6ofmk3ur X-HE-Tag: 1740647807-207373 X-HE-Meta: U2FsdGVkX18LbjCoUaNa32ueKk0aCounLSAggY12svuQJpzTLVmyZSALqoAGX3TppO+MrgUgShWG/4xeqM976pYB9BaT6KBam/dLcksinJtg2TlFS8eHu26PxJWF9Dur/ayygzhm6oUvbCPHd6x0ko+eR26h9nA/4qaH2elaIDvgV7bM4CdCMmZgmsL68bgGAxRlBFQIC9+p+h363FrtwLQ6t9m4XozimBLRNRuB11yjVdjKRswiGMveuNEXnCKaCK4ufiyGen0VL0x+EEBPgKanWJffVBTlLyrQQMsY88eHRbLrzxqw04N1U2xMuGrIf584IauT4RXPz2k8RtFlhXDbpkIy/1Pg1dtt5sm1LtkmfOp8ZBUJzgYASognWfyGnomwOX5B0JLYugTklTeTjHdZLIcQKfphDWputoWgsAb8mwRlXA+lyZSXUHtWqI8wJmTCNRJ3a2nRggyWU5X4w6Ub7/dkyEAxOf0x9L5eqcMNkNWVG3oeGahY0vzfTBzDYl1qQGh8QSmZ1DKUFHlgQ7dXBqVPcky/N+nMGrVJ6OMPUegN4G4JejN/u2iiiRP54MRng5gqHpwwye8UMhvdQJbkyolR9o986u1KF1ks3GoS0ap0DPQOwT1dbn3rZ5FVt+fLSRUGJYJLt2/wFESqNYRYOYfgBYKI0I0wgxPv4oJvPds0Q/S4WmJfzgsSYHxuyDwyxKMK7NZQ54LO2zd4DRGoB2TNqEeQoWWmggo9AgEQ3CWBdmzt9Y0Q3AB54g/FbAfWeLh6g3C37ADpYGmtqtlHh/KXgoV/OcRgXKbVyUVm7KBof1JQtiLSuiub2Cdzh02G6pW+vG8VaSRQQ8GESmKIT72DCWFaslFj4+ZHW5cpXhBo+Wrn4boinCSm1WHyLz6bRxqeEWRyQNA3Tb4gmQ66H2lcQ8dvCjMowOrvbMRRu3bD5EK7Iux3Kij0z4eIXFBRjrlA9Y19r6b2Klx DbKB1hkl ZoabaG7qhzznAaHHMGMH0eKXRSPKAO5FhaMkVnL1FQxdrWshwexnExzdRSHDfKEyK+ylpnq7nnMKuuu1Dd6r2v8C0F4WE5b7GQ1J6gVbAZfLXY4do8NrmITY21ucaQspfasMZjcQWsWhZrnYI0ZNTHPKhABQIhEUrvwWsj8zwF+uaTcEjvsImwQ64xKalOvIUCtpeajuEp/Fgp7RUxmCNfEiiK/YKZYV1LfoYNKhSZXmOLt8MAqiIacpRf6a/r6QonFqaqmSYIVcNzKTGWEjPXVaVy15Igef9tbC2NzTqVY5wziKZaVKyYKHhzqy7B409XUsSu3Pj6C1a6FI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000064, 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 2/26/25 16:57, Baoquan He wrote: > On 02/26/25 at 01:01pm, Michal Hocko wrote: >> >> Why do you think anything needs to be adjusted? > > No, I don't think like that. But I am wondering what makes you get > the conclusion. > >> >> > I haven't thought of the whole zone fallback list to interleave nodes >> > which invovles a lot of change. >> > >> > > >> > > Btw. has 96a5c186efff tried to fix any actual runtime problem? The >> > > changelog doesn't say much about that. >> > >> > No, no actual problem was observed on tht. >> >> OK >> >> > I was just trying to make >> > clear the semantics because I was confused by its obscure value printing >> > of zone->lowmem_reserve[] in /proc/zoneinfo. >> > >> > I think we can merge this reverting firstly, then to investigate how to >> > better clarify it. >> >> What do you think needs to be clarify? How exactly is the original >> output confusing? > > When I did the change, I wrote the reason in commit log. I don't think > you care to read it from your talking. Let me explain again, in > setup_per_zone_lowmem_reserve(), each zone's protection value is > calculated based on its own node's zones. E.g below on node 0, its > Movable zone and Device zone are empty but still show influence on > Normal/DMA32/DMA zone, this is unreasonable from the protection value > calculating code and its showing. It's not unreasonable. A GFP_HIGHUSER_MOVABLE can use up to the Movable zone, so e.g. the dma32 zone should be protected from such an allocation, so it has space for GFP_DMA32 restricted allocations. If no Movable zone exists, but Normal zone does, the result is the protection will be the same for GFP_KERNEL allocations (that can use up to the Normal zone) and GFP_HIGHUSER_MOVABLE allocations. (i.e. the number of 22134 in your listing is the same for both indexes). That's fine. But setting the protection from Movable allocations to 0 as commit 96a5c186efff did was simply a bug, as that can directly lead to GFP_HIGHUSER_MOVABLE depleting ZONE_DMA32. The only "unreasonable" part here is that we define and show protections from ZONE_DEVICE allocations. The usage of this zone is AFAIK completely separate from normal page allocation through zonelists, so we could exclude it, if anyone cared enough. > If really as your colleague Gabriel said, the protection value of DMA zone > on node 0 will impact allocation when targeted zone is Movable zone, we > may need consider the protection value calcuation acorss nodes. Because > the impact happens among different nodes. I only said we can do > investigation, I didn't said we need change or have to change. There might be a theoretical issue if e.g. Node 0 only contained DMA and DMA32 zones and nothing else, while the Normal zone is on Node 1, there would be no protection for DMA/DMA32 zones from Normal allocations, as setup_per_zone_lowmem_reserve() considers each node separately and thus would not take Normal zone size from Node 1 into account. Should we sum zone sizes accross all nodes then? But then __GFP_THISNODE Normal allocations for node 0 would never succeed? Or we'd need a separate lowmem_reserve array for those? I guess the issue doesn't happen in practice. In any case it's out of scope of the reverted commit and the revert. > Node 0, zone DMA > ...... > pages free 2816 > ...... > protection: (0, 1582, 23716, 23716, 23716) > Node 0, zone DMA32 > pages free 403269 > ...... > protection: (0, 0, 22134, 22134, 22134) > Node 0, zone Normal > pages free 5423879 > ...... > protection: (0, 0, 0, 0, 0) > Node 0, zone Movable > pages free 0 > ...... > protection: (0, 0, 0, 0, 0) > Node 0, zone Device > pages free 0 > ...... > protection: (0, 0, 0, 0, 0) > >> >> -- >> Michal Hocko >> SUSE Labs >> > >