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 EFD1FC6FD1C for ; Thu, 23 Mar 2023 12:25:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 69DC86B0072; Thu, 23 Mar 2023 08:25:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64F846B0074; Thu, 23 Mar 2023 08:25:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4EF296B0075; Thu, 23 Mar 2023 08:25:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 426C06B0072 for ; Thu, 23 Mar 2023 08:25:57 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 18D661A06BC for ; Thu, 23 Mar 2023 12:25:57 +0000 (UTC) X-FDA: 80600084754.13.E1A035D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf20.hostedemail.com (Postfix) with ESMTP id ECB7B1C0021 for ; Thu, 23 Mar 2023 12:25:53 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bay7Auva; spf=pass (imf20.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=1679574354; 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=j84pqX9AA+7rapMB0nYjO2DDYRDtYXRYeAkzhS0IY0M=; b=j5r3gOTGMvc7AZ5XHbKSneQ7tA4GK7uZKTy/HEsL+H1SChQ4jDcrO6MfKw+f94Ex9JxuIs FXlwx/6xPvv5TbpX0hpTo1IjZRxuGS4Jd5GeOUoQCUsA9AWzF7L142b+doR9wMv3i0ff4d 2Rfrdgxp376B12OysA3d4hMzFwmw+iI= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bay7Auva; spf=pass (imf20.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=1679574354; a=rsa-sha256; cv=none; b=A3/svXUckXsUXEQyidK8NVN1lM/mOCyes2iqBgYrMHbLd6Q0o7Wfh6yB7vAo4B/hzMAiTM DXfVJCekWMyWacpWjdqQKba/W7xPvbGJfMXy4DC1OBBIzHjHYyLoBBPtf55BDyZpNf7NDt EJU4nJBzxgpCO4BjHRzquSiM8BeRe30= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679574353; 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=j84pqX9AA+7rapMB0nYjO2DDYRDtYXRYeAkzhS0IY0M=; b=bay7Auvaz9bLX5Lwj2eF45EixNlPg0OYudgfujZCzNyhnw6ykZXyXNMJiSGSgbaZpLuOJm 8o0cE4FdswfrtzxSnjC4T7HKjdfComIIay/Wqx4XzhgoY141TJCR+P+vc5oh7IRGrIwxoO 738qndJHSk/FzuFZvMIQgzJruijIpOs= 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-167-0TIscLv2M66v25TuvBya0A-1; Thu, 23 Mar 2023 08:25:50 -0400 X-MC-Unique: 0TIscLv2M66v25TuvBya0A-1 Received: by mail-wm1-f69.google.com with SMTP id ay37-20020a05600c1e2500b003ee69edec16so935216wmb.5 for ; Thu, 23 Mar 2023 05:25:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679574349; 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=j84pqX9AA+7rapMB0nYjO2DDYRDtYXRYeAkzhS0IY0M=; b=xrCQJvuFj3c6/lAYO6oJ+fukRQ3K1517U5V8IONT9c26k1xXM5EZ5DO6eFSdQx+Puo nj+YEPOSO5gQS32qAiiB2juBpWjmOoQ65TYlgJKv/dVsNFkigPeRUrNtriIKpTkJcIWc fq+jPcK+kUwnIU+2+q7LOH+gkF1iJICv4KA+TMM8Xe2opwKNd/ZmdPZ3dbvseG3p7f+A XQAuiginM5VIGCHLGm24ovbKZpxvfyQYsJpOjoxXZ87hivwzhSqLb5LyagTN7kbzy8wQ u2G6Yrujqq/Ppt/2MGs5y4mxRWmnGvGk6ihMjCNO60Jns0qdM3QtofDVIF5xPuqg5cQG vWcg== X-Gm-Message-State: AO0yUKXG9z2YLMz9l5bheI2hJjnLiYw2zUibUDtpPrXY9up8k0oN7orR yvg+fnc11ciqdVuvDRGkri6kMQBzPIIMtUJYLDwRFwrVDi0qWZtf6oF+Pl5tN4W1wnWjTfl5jNs p/NqW9XURhDw= X-Received: by 2002:a05:600c:b46:b0:3eb:29fe:f922 with SMTP id k6-20020a05600c0b4600b003eb29fef922mr2053545wmr.29.1679574349477; Thu, 23 Mar 2023 05:25:49 -0700 (PDT) X-Google-Smtp-Source: AK7set+dhEun5J5hTK3lDPuI/2GQ0/eWFSI8uUOix985BymBdH1ITnxsGKbjpel8RqRCJITPzEHuOQ== X-Received: by 2002:a05:600c:b46:b0:3eb:29fe:f922 with SMTP id k6-20020a05600c0b4600b003eb29fef922mr2053532wmr.29.1679574349167; Thu, 23 Mar 2023 05:25:49 -0700 (PDT) Received: from ?IPV6:2a09:80c0:192:0:5dac:bf3d:c41:c3e7? ([2a09:80c0:192:0:5dac:bf3d:c41:c3e7]) by smtp.gmail.com with ESMTPSA id 12-20020a05600c22cc00b003ee697ecefdsm1700871wmg.45.2023.03.23.05.25.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Mar 2023 05:25:48 -0700 (PDT) Message-ID: <31395703-5f0e-651e-1e3d-226751a22d1b@redhat.com> Date: Thu, 23 Mar 2023 13:25:47 +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 , dan.j.williams@intel.com 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, ying.huang@intel.com References: <641b7b2117d02_1b98bb294cb@dwillia2-xfh.jf.intel.com.notmuch> <20230323105105.145783-1-ks0204.kim@samsung.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230323105105.145783-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-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: ECB7B1C0021 X-Stat-Signature: xkgrmp8ncagshr3ijsqi3agj8aqx8i1m X-Rspam-User: X-HE-Tag: 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y9DX4GCkezSt49AeNl0fcM3fWx9gquuUVOyrKtuPpL00JEQzyfP0S8vxLg4WbSigNs1wzanREjfLaJ0fI85N3fSBnSkjfANhxhAN03+O9QMlwCmmPQcGUQcR7R4wNsSgYw4AX+15XivMVLtgOv0RVvphJpqjtAhTqsKWut6Rx6FQuVqbIvSgV6MWHOgu4dVZOCGpdfrJ/0EvmUEseEG1vQodRfAEKtikN6bQ8Crwth11VJunDl9yxv07K+wErf81MlHqwQUGjNwa21nhy6rYMKicSc7ZLSWMEho28EM2FHPvX0fMYKN6MXAA59Ze41XZwPIvChyGGZlhS7OzNj7guU8quLXuhMcsmpLJb9T8DFpjmIvjCw1avflbGKiKChuNxG3/1HtdPn+/cERrA4WCbk3TeArhwEp3bllsYX8d8= 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 23.03.23 11:51, Kyungsan Kim wrote: > I appreciate dan for the careful advice. > >> 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 :) . > 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. > As you well know, among heterogeneous DRAM devices, CXL DRAM is the first PCIe basis device, which allows hot-pluggability, different RAS, and extended connectivity. > So, we thought it could be a graceful approach adding a new zone and separately manage the new features. > > Kindly let me know any advice or comment on our thoughts. [1] https://www.lkml.org/lkml/2020/9/9/667 -- Thanks, David / dhildenb