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 7B581C61DA4 for ; Thu, 16 Feb 2023 08:22:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CEF456B0071; Thu, 16 Feb 2023 03:22:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C7B296B0072; Thu, 16 Feb 2023 03:22:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF1816B0073; Thu, 16 Feb 2023 03:22:07 -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 9840A6B0071 for ; Thu, 16 Feb 2023 03:22:07 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5A5921A1100 for ; Thu, 16 Feb 2023 08:22:07 +0000 (UTC) X-FDA: 80472462294.22.8B06F16 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf13.hostedemail.com (Postfix) with ESMTP id 7452C20007 for ; Thu, 16 Feb 2023 08:22:04 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=leRIznFw; spf=pass (imf13.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676535725; 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=Hh4/is4PFD339p+Vzvq5d2pFw4nO4v+SgFREe+8IyEg=; b=tRUCealxeytBNGthQ1FAfaL7TbG6JgJ3n5/aZRXU4L2vfBF0XIOnyA8tJs9J0d8mBaOgOf T3ddyPHGDVUUHgaA3OUBX6mVfV6sFWKEtmtAKYxTje/Yov2KeQiijLGx037txaDdeH1lHd QJPwmeu+6gn2+L7ADEEHJ/7liRkfokA= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=leRIznFw; spf=pass (imf13.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676535725; a=rsa-sha256; cv=none; b=uhd1tXk//WDnc7xWPUG8b9KlCmt/2qOEBJlquEcs2rqlqYOw2amhbiMbUuXxjzcJ1ALH4Z RH4NoJL5BeLjmGG4TaQlohsheNwjSUn8RrbMUCOlrWk5/xQ4pTIX9+p0fNLwUwZJHpKXqx kBg6IhS7J6E29xWs/flhYffTchH3q34= Received: by mail-pj1-f43.google.com with SMTP id d2so1140994pjd.5 for ; Thu, 16 Feb 2023 00:22:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Hh4/is4PFD339p+Vzvq5d2pFw4nO4v+SgFREe+8IyEg=; b=leRIznFw82AuY/38fwOPZ5k1ZasfpPUFPxEMdHvxjaTV/izRviWI93SVYSemn06ZiP iKYji5pNZw3QVORYMVDSIhgegTaTarHm/oiu7lEP3Mo2iNdYnjCd07DTEOCy5u5AmleY IKq8Spscrmcqf7l0pcW1VHS2Ypk/ZuGgXJvrhhQ8Z1lqmrom4/jkCaJ+6JOrBYnFEGyw duECIB8H2/YNxnXsouhwxE+B62wk4CEduaWNxgsEW7M2Gx4Y39NV9xr/AxF4P6JtYnAr Xa0edaaBhRES9c2vkUz0iSdk+IU5ig+cav5Vc8/ronq2Qr/DfXyt5viO1vCrQUdwwGst o41Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Hh4/is4PFD339p+Vzvq5d2pFw4nO4v+SgFREe+8IyEg=; b=uku8rUlXcjNv1HExhpxQAFHrBuyBcEu7hXkFGHDurMKfz7zFLvPgB2FUP6fO+6Uyaw Obl5v2g0zEg1T59hCa+XwdhiJYPkeAKmw5he5yleB8qFuYfHarkimaAgMzl/wwudTJEP 3h95B7jOPuxett5wAdCFa3sp3HnebY7UGlOAybot9KeFDMQvvwVjL/IVNIWxHfe/m1tj u+rAGra31Bvq8ZNHkZp8rX9eZ3LMoVNPNgj4DL+Y+PEYan2ayBhnmApottMFLFin+H5F AMEbx72Oc2tVyD2YCqgezU2r+0lWwVPxLTNvPFAm9Am3tOFVVjk8Xkz4cGFZ9tZ3xyjO tR0w== X-Gm-Message-State: AO0yUKUctHT5+eZhXVePtMov8q84Ndo0F22pyR913LyE9+TPm7+1h07b NtYuuZHiNh5Fz/CzUK3KOOsOBA== X-Google-Smtp-Source: AK7set/d+zMI0EwCIMY3z/YEUs1RRSFePHgdVadW/XyJYsdqUtR/e2S9+DhFY9ivkfaYiVy4Pxy2QA== X-Received: by 2002:a17:902:e5ce:b0:19a:f556:e386 with SMTP id u14-20020a170902e5ce00b0019af556e386mr797120plf.0.1676535723190; Thu, 16 Feb 2023 00:22:03 -0800 (PST) Received: from [10.70.252.135] ([139.177.225.245]) by smtp.gmail.com with ESMTPSA id x7-20020a170902a38700b0018099c9618esm673838pla.231.2023.02.16.00.21.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Feb 2023 00:22:02 -0800 (PST) Message-ID: <767893ef-f8c2-c478-f1a0-e785bbf2da09@bytedance.com> Date: Thu, 16 Feb 2023 16:21:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH 0/2] handle memoryless nodes more appropriately Content-Language: en-US To: Michal Hocko 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 References: <20230215152412.13368-1-zhengqi.arch@bytedance.com> <3426457c-99bf-9f7c-f663-c29474d9fa73@bytedance.com> From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 7452C20007 X-Rspam-User: X-Stat-Signature: 6ip8itmkdg7afebj5y9q6pjjjd9n3pa4 X-HE-Tag: 1676535724-286814 X-HE-Meta: U2FsdGVkX19oVSta0DXC1/qkgR+awkYMwFWMhGXRiPhBawHIL+4lXQWNIwVcAc8/mGpH1IzNGD1hQufb9KLRAEeYtVgDYAEFisGCj4nb3Upv9r8y72DsVxyhRvKLzqYjp4QIYA6cWxtr78Gr42Uq/oxtgqYvSgDabpS6W5ltI4136pJmUOfR3oe1cdavEilBPEz7xIY/pLMJDvC7d4QoaTlv9zzHmdIUj9XBR+8rcVMQ399BeVOiIhZCjg3F677NGV3AqhdrkE0FUMHt+Oay/A4Jh1RvJTUr7m7Ewjkbv7LlAFSMG7A+k6JYl8ASnEye7T++zzMhpkt0gjqfGiz9DyuJUr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KRgenYZuP5DrpSi 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 2023/2/16 15:51, Michal Hocko wrote: > 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. I understand your concern, but should we therefore reject all revisions to this? > >>> 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? No, and the original reason for noticing this place was the panic I mentioned in [1] (< NODE_MIN_SIZE). And if we had handled the memoryless node's zonelist correctly before, we wouldn't have had that panic at all. > Currently we are just sacrificing some tiny performance for a > simplicity. Hmm, I don't think my modification complicates the code. > >> 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? Sorry for the ambiguity, what I meant was that memoryless nodes should never have been built into any fallback list, not just for performance optimizations. > -- Thanks, Qi