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 B61AEC636CC for ; Thu, 16 Feb 2023 07:51:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E8D006B0073; Thu, 16 Feb 2023 02:51:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E3E006B0074; Thu, 16 Feb 2023 02:51:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D05996B0078; Thu, 16 Feb 2023 02:51:15 -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 C35B06B0073 for ; Thu, 16 Feb 2023 02:51:15 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5BE011410A7 for ; Thu, 16 Feb 2023 07:51:15 +0000 (UTC) X-FDA: 80472384510.11.1D2FE55 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf26.hostedemail.com (Postfix) with ESMTP id 73205140005 for ; Thu, 16 Feb 2023 07:51:13 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Q00C+H4d; spf=pass (imf26.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 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=1676533873; 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=ajBmdtrtPrLwGMCnqDRXFKAEd2YXbkPSZ+MplyN1QkI=; b=k5ZKEgyBXaEqXH5VJbH8ecEJ8VPQx7kmVVFMs6CnAQ3EAbr3KOnk/BaQ/Su1disQ0dFyex abq8MyUYl2F5IBy259LoU4+fX1sHxMBN28uad097Nc4KD9VLJ8aqZuBaTI9oFa9pVikysE n0oTbIkI7BmrRssjI6AndwSuZxZOn0k= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Q00C+H4d; spf=pass (imf26.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676533873; a=rsa-sha256; cv=none; b=y1TJluspdVtlsOo25B+1nIMAD1KvbLQaRlg5IW4WiIZufZNW68hA8LoTPvJ5/9Qz0CKJDx BPzJfZw7EYDsMI5yjsw3OK3tC1B59rVT58WFiN88Megl+c1udFhGJBRFteD+rbbF3WRuqz g0Ge/Cphxo2VCGxTOQIIMoNMSpsP42E= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DAFBA21D72; Thu, 16 Feb 2023 07:51:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1676533871; 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=ajBmdtrtPrLwGMCnqDRXFKAEd2YXbkPSZ+MplyN1QkI=; b=Q00C+H4d4aX4jwiE1H0DMrADM4G6xFCOJA1WllHAQwVNzw5Jb/bu/OPMSrSgLqKHZ32odx YK6jZ3zsB6FFqJtw2wEMGjzsqJc9AswXpN17C8BiPKIqN/gylZd8QTkIuURCdEcgJdvvnf WmuEQPH371RkX991MshS6pFEw3++kto= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BE907139B5; Thu, 16 Feb 2023 07:51:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rOUaLG/g7WNUfAAAMHmgww (envelope-from ); Thu, 16 Feb 2023 07:51:11 +0000 Date: Thu, 16 Feb 2023 08:51:11 +0100 From: Michal Hocko To: Qi Zheng Cc: akpm@linux-foundation.org, vbabka@suse.cz, david@redhat.com, rppt@kernel.org, willy@infradead.org, mgorman@techsingularity.net, osalvador@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song Subject: Re: [PATCH 0/2] handle memoryless nodes more appropriately Message-ID: References: <20230215152412.13368-1-zhengqi.arch@bytedance.com> <3426457c-99bf-9f7c-f663-c29474d9fa73@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3426457c-99bf-9f7c-f663-c29474d9fa73@bytedance.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 73205140005 X-Rspam-User: X-Stat-Signature: w3t49qnxfoe1mkcpyz8hgbz8fn5btag3 X-HE-Tag: 1676533873-325586 X-HE-Meta: U2FsdGVkX18hh0bS4IFYGskt7n8yGzOVvmc6IDY0pC3t77LKcSxZlgKdEmUqrq6PZrCzIJNkj/YA1k3BsPE9uh/QnggktD65Bt+Zpgq4X4BReFyYRPQ1PNqQLD/Kq4PQPQSmPmmgnOBpyYrlxSzqfXxp1dqih//Zka4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ence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu 16-02-23 07:11:19, Qi Zheng wrote: > > > On 2023/2/16 00:36, Michal Hocko wrote: > > On Wed 15-02-23 23:24:10, Qi Zheng wrote: > > > Hi all, > > > > > > Currently, in the process of initialization or offline memory, memoryless > > > nodes will still be built into the fallback list of itself or other nodes. > > > > > > This is not what we expected, so this patch series removes memoryless > > > nodes from the fallback list entirely. > > > > > > Comments and suggestions are welcome. > > Hi Michal, > > > > > This is a tricky area full of surprises and it is really easy to > > Would you mind giving an example of a "new problem"? The initialization is spread over several places and it is quite easy to introduce bugs because it is hard to review this area. Been there done that. Just look into the git log. > > introduce new problems. What kind of problem/issue are you trying to > > solve/handle by these changes? > > IIUC, I think there are two reasons: > > Firstly, as mentioned in commit message, the memoryless node has no > memory to allocate (If it can be allocated, it may also cause the panic > I mentioned in [1]), so we should not continue to traverse it when > allocating memory at runtime, which will have a certain overhead. Sure that is not the most optimal implementation but does this matter in practice? Can you observe any actual measurable performance penalty? Currently we are just sacrificing some tiny performance for a simplicity. > Secondly, from the perspective of semantic correctness, why do we remove > the memoryless node from the fallback list of other normal nodes > (N_MEMORY), but not from its own fallback list (PATCH[1/2])? Why should > an upcoming memoryless node continue exist in the fallback list of > itself and other normal nodes (PATCH[2/2])? I am not sure I follow. What is the semantic correctness issue? -- Michal Hocko SUSE Labs