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 1AC06C6FD20 for ; Fri, 24 Mar 2023 09:12:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58FA76B0072; Fri, 24 Mar 2023 05:12:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 54B7C6B0074; Fri, 24 Mar 2023 05:12:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40AAD6B0075; Fri, 24 Mar 2023 05:12:42 -0400 (EDT) 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 313C46B0072 for ; Fri, 24 Mar 2023 05:12:42 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 066E7AB610 for ; Fri, 24 Mar 2023 09:12:42 +0000 (UTC) X-FDA: 80603226564.05.61750FF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id B41C980017 for ; Fri, 24 Mar 2023 09:12:39 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YdONawQg; spf=pass (imf02.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679649159; a=rsa-sha256; cv=none; b=j9bTQMqaR/QZTCvsbxF0zNPPoVQyPE/OLOb/x0+L5DIs6C4oFD/n3QAPqV3/ASl4dHVB2g xgJp6jxlAd6PxMOcSfsYqLrfI8prevdCzxBREv/TMArzjOqH524pav5xkJnSWPMa2b6zb2 cNNJ9r9rvpPFDAqw9eKLkPz3E/RO19Q= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YdONawQg; spf=pass (imf02.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679649159; 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=yiqRrGCw8GJaBQNoK0W4TjNWeAd0DfxdfliriX6rTOg=; b=GqHl9w7YaMWoPi52Z2GU1Yd+Xrl+wrLAwPI2DKBzgXXMPtJcfKcV23vzIUxr7LUQRxxsie MnPJGyAjvRYKkw8trssCzaNuNx7KWAmh0muQH7ahZdjc4CLJJUDpVCC+z5TxBztlk5yONK PPbBHeUYS/TYw3M84K7kGxMbYUWaqYU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679649159; h=from:from: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; bh=yiqRrGCw8GJaBQNoK0W4TjNWeAd0DfxdfliriX6rTOg=; b=YdONawQgYwNDP/JZrUMFyYqVnbMqyQi7novogIBjwV4wxFYrruNd4wS22uKuEZCJIBvbuu 95MlViFqglPec34+M5WEQawp1+1u+1NUXgUBzoBVczibKWqlPDb5e8Q+GW5NNd76skXVAR 0c+UtjAJZ5WlfjxCSfDeowDCvwmQytI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-363-2a88yuXHOa-xzWcfxfYsGw-1; Fri, 24 Mar 2023 05:12:37 -0400 X-MC-Unique: 2a88yuXHOa-xzWcfxfYsGw-1 Received: by mail-wm1-f69.google.com with SMTP id u6-20020a05600c19c600b003ed7cb98a8dso536054wmq.9 for ; Fri, 24 Mar 2023 02:12:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679649156; h=content-transfer-encoding:in-reply-to:organization: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=yiqRrGCw8GJaBQNoK0W4TjNWeAd0DfxdfliriX6rTOg=; b=SGHG0cwuLtyoFgdY8lJeLSx0t+sDewjFeE2G9CBWGvc+9jXWu8D6893j7zjvJkGDw4 ik0u04gaufWO0rpDrEgIYfgtGuoK+d6pa76iGC5089PoAbmNvzFQ042s11zfk5BwbdvU 9UEmwat8LI001CQzqIDMl/ek5KGIP2f5PnhiG2oiceO7UC2rHMIM4vD0zvVGmcl4j1pZ nJwzr+p3jL9dmoulJuuobBbI9WByr+xGc2YrH8jMhkeCXl9tmf/vQ9buNPzZYx0d4EnH QCjtpPSThrNI/SAyOtAilNJSKG6Oz1sGFEoIqEKYuKzFdY3SjYInqqQ/rB1txoW9NqKO YdLw== X-Gm-Message-State: AO0yUKWBQLdd7zvhbS+HxKUsJs0IJq1XsMUIHT+H54bSBQ7FBuUQcLVE UWQH3svONADBcLtTuaZoQG4++7wLL+VWJht+heM3QxYuUgJ8NbEMKo6+t2GKa+WK3T7tqlevve/ kt0fJCsVFo9U= X-Received: by 2002:a05:600c:286:b0:3ee:7f0b:387b with SMTP id 6-20020a05600c028600b003ee7f0b387bmr1288495wmk.17.1679649156556; Fri, 24 Mar 2023 02:12:36 -0700 (PDT) X-Google-Smtp-Source: AK7set/eQK72a69vOqXrE2MS7v3RovaIxLMqEWkliJJs8oZ2pzs2KdrM/PF7WWc9myyrZVUuz+GCIA== X-Received: by 2002:a05:600c:286:b0:3ee:7f0b:387b with SMTP id 6-20020a05600c028600b003ee7f0b387bmr1288474wmk.17.1679649156168; Fri, 24 Mar 2023 02:12:36 -0700 (PDT) Received: from [10.105.158.254] ([88.128.92.189]) by smtp.gmail.com with ESMTPSA id l18-20020a1ced12000000b003edc11c2ecbsm4341456wmh.4.2023.03.24.02.12.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 02:12:35 -0700 (PDT) Message-ID: <5536d792-867d-6390-81e2-b1ef135d347d@redhat.com> Date: Fri, 24 Mar 2023 10:12:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: FW: [LSF/MM/BPF TOPIC] SMDK inspired MM changes for CXL To: Kyungsan Kim Cc: lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-cxl@vger.kernel.org, a.manzanares@samsung.com, viacheslav.dubeyko@bytedance.com, dan.j.williams@intel.com References: <31395703-5f0e-651e-1e3d-226751a22d1b@redhat.com> <20230324090923.147947-1-ks0204.kim@samsung.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230324090923.147947-1-ks0204.kim@samsung.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Queue-Id: B41C980017 X-Rspamd-Server: rspam01 X-Stat-Signature: kyxki3p3omnmy3dyjisttey73utzkfmj X-HE-Tag: 1679649159-242908 X-HE-Meta: U2FsdGVkX18bfY5M/stCmRd/FfwkDkge96/Xkun8QUHX/Yn9niG97V6KJaWjAVKmYOLlQuj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29nH/gpvW9ukEIo5e+fUCqdL9X95Dhm9jdg+7+u8XMZVdz0KS0rjETS6J/9RvZ1/arLYPz4TRnB+c9MSZGM+Fr8xqn6qtS/y5GAdpqg6ynl8pZ0YJrdWZBeb8apMiJeYflkdNmGK+TXAaNcanR/FDOa64z/kI0UuG+C4GSEJDzhY9RWmvJbT1ykMepFrbw3xKM31tvCeeWykIedFWnq3Zj0olDqdR61MIHYmE+tUjWAJdeo4WFrdfR2ka7jrm4JGq 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 24.03.23 10:09, Kyungsan Kim wrote: > Thank you David Hinderbrand for your interest on this topic. > >>> >>>> Kyungsan Kim wrote: >>>> [..] >>>>>> In addition to CXL memory, we may have other kind of memory in the >>>>>> system, for example, HBM (High Bandwidth Memory), memory in FPGA card, >>>>>> memory in GPU card, etc. I guess that we need to consider them >>>>>> together. Do we need to add one zone type for each kind of memory? >>>>> >>>>> We also don't think a new zone is needed for every single memory >>>>> device. Our viewpoint is the sole ZONE_NORMAL becomes not enough to >>>>> manage multiple volatile memory devices due to the increased device >>>>> types. Including CXL DRAM, we think the ZONE_EXMEM can be used to >>>>> represent extended volatile memories that have different HW >>>>> characteristics. >>>> >>>> Some advice for the LSF/MM discussion, the rationale will need to be >>>> more than "we think the ZONE_EXMEM can be used to represent extended >>>> volatile memories that have different HW characteristics". It needs to >>>> be along the lines of "yes, to date Linux has been able to describe DDR >>>> with NUMA effects, PMEM with high write overhead, and HBM with improved >>>> bandwidth not necessarily latency, all without adding a new ZONE, but a >>>> new ZONE is absolutely required now to enable use case FOO, or address >>>> unfixable NUMA problem BAR." Without FOO and BAR to discuss the code >>>> maintainability concern of "fewer degress of freedom in the ZONE >>>> dimension" starts to dominate. >>> >>> One problem we experienced was occured in the combination of hot-remove and kerelspace allocation usecases. >>> ZONE_NORMAL allows kernel context allocation, but it does not allow hot-remove because kernel resides all the time. >>> ZONE_MOVABLE allows hot-remove due to the page migration, but it only allows userspace allocation. >>> Alternatively, we allocated a kernel context out of ZONE_MOVABLE by adding GFP_MOVABLE flag. > >> That sounds like a bad hack :) . > I consent you. > >>> In case, oops and system hang has occasionally occured because ZONE_MOVABLE can be swapped. >>> We resolved the issue using ZONE_EXMEM by allowing seletively choice of the two usecases. > >> I once raised the idea of a ZONE_PREFER_MOVABLE [1], maybe that's >> similar to what you have in mind here. In general, adding new zones is >> frowned upon. > > Actually, we have already studied your idea and thought it is similar with us in 2 aspects. > 1. ZONE_PREFER_MOVABLE allows a kernelspace allocation using a new zone > 2. ZONE_PREFER_MOVABLE helps less fragmentation by splitting zones, and ordering allocation requests from the zones. > > We think ZONE_EXMEM also helps less fragmentation. > Because it is a separated zone and handles a page allocation as movable by default. So how is it different that it would justify a different (more confusing IMHO) name? :) Of course, names don't matter that much, but I'd be interested in which other aspect that zone would be "special". -- Thanks, David / dhildenb