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 94ED6C6FD20 for ; Fri, 24 Mar 2023 09:30:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E85576B0072; Fri, 24 Mar 2023 05:30:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E32F26B0074; Fri, 24 Mar 2023 05:30:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFAA06B0075; Fri, 24 Mar 2023 05:30:46 -0400 (EDT) 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 BF9A46B0072 for ; Fri, 24 Mar 2023 05:30:46 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 933554091A for ; Fri, 24 Mar 2023 09:30:46 +0000 (UTC) X-FDA: 80603272092.09.6467999 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf05.hostedemail.com (Postfix) with ESMTP id 2A58E100025 for ; Fri, 24 Mar 2023 09:30:43 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=h4LU+l3z; spf=pass (imf05.hostedemail.com: domain of david@redhat.com designates 170.10.133.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=1679650244; 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=21j5HZHNaqnqYk/qMb/3bvONholuvmzFTx+bQH+Yn+o=; b=hzNvutq88sZTnRP8NTS7SpsycqVtomAwraQ0n6Q3PLPBTQzPP+XGGrBuEoWDzHekNZ9MmW Ss+BdJqz0Ro8/A9si/s0R+kNBfng2tCV0Fm6+xRtgxsev2aY0U96Kx+Q4x1GTyRSkqxp8M Mwz4ktrM2gW4RXzS2nbgCznajivDxtM= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=h4LU+l3z; spf=pass (imf05.hostedemail.com: domain of david@redhat.com designates 170.10.133.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=1679650244; a=rsa-sha256; cv=none; b=nsMLmWYXZj9IlU9qe96VJ59kMTppNTWJqXWRn/Hfa9cuESyqLh31cEoDQDl7PtEfshMCTR 4t0HgyzWwdDt7voQ8p3A0c/AZY64U4/B2aF3X8Z79sX6lTwJnnijTx2z2d3sYg4VmQRf1C x1njeOxgeTI9P4/+eBCu5FED9qpjI+M= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679650243; 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=21j5HZHNaqnqYk/qMb/3bvONholuvmzFTx+bQH+Yn+o=; b=h4LU+l3zYuS6MYCtSl+weDUAmxL4XBHHhstguV+0y0Oo0IhQ5W19UkS+ERe196dqWbAKAx 7iL7k/UEoVaLEg8AqeLLKamISxpSrLENaCFGzPJpXpJBEaJ8IG0wwtd27/SUQ1LimaPn/k 5+JkJqik2sFOrhdl29O30BjWjS7YGzI= 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-324-BNkjnZ-1MRaEXi37F2-mkw-1; Fri, 24 Mar 2023 05:30:41 -0400 X-MC-Unique: BNkjnZ-1MRaEXi37F2-mkw-1 Received: by mail-wm1-f69.google.com with SMTP id i3-20020a05600c354300b003edfa408811so2326782wmq.1 for ; Fri, 24 Mar 2023 02:30:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679650241; 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=21j5HZHNaqnqYk/qMb/3bvONholuvmzFTx+bQH+Yn+o=; b=SrYTRSHC/IO/pCGdtPIKpBLLbKKnYZIINVRtPjo7RMsMsDlzuGoO4dL4bxjUyn4+ex 4WVdj0ke9fdQWx3XlhO5uCJZvyy2anPjZB2mNF9R0VoMC7F1pzCM4sB6/5ckm8uzzRF8 l74cfRx6LmUta0Ka4KinqFPxQMw7Mgm3NLZYSTpDBWGr70A/TfO92fv9T+eh+ZqUlpQs FPMeyrUQS+VDvsrsTehM2UZWscUoeApnpOpJTXZj1xoZgjjScT+LFbrcHIW9pufmpPX7 kFKOBiWtDzxuAJmIR6TxR5DmVX5UIOCnp6Z7hlNOdFyU2ATeu58X+IEZph1bJSjGufGb UjFw== X-Gm-Message-State: AO0yUKVUfSVenzE7aUIUfS4rxkNmLAGuUW69UCpPwif9JycI72E8kqLb iA7QkDC8xBjFfklJtb4BtG5h7aS+7IdLCzkI/cL5pc4rFIGOJ1yi6U8BOvuZdZSK4rWPrZfRfUo /bXRFCq49LDw= X-Received: by 2002:a05:600c:2289:b0:3df:e468:17dc with SMTP id 9-20020a05600c228900b003dfe46817dcmr1727271wmf.40.1679650240909; Fri, 24 Mar 2023 02:30:40 -0700 (PDT) X-Google-Smtp-Source: AK7set/IiMAnVG44QY0lj4W/8T78wkjWb5uNZDBeaBMhsRJC8+SM5VO0asITh0DvQ+GzWK5qGo9Tvg== X-Received: by 2002:a05:600c:2289:b0:3df:e468:17dc with SMTP id 9-20020a05600c228900b003dfe46817dcmr1727251wmf.40.1679650240530; Fri, 24 Mar 2023 02:30:40 -0700 (PDT) Received: from [10.105.158.254] ([88.128.92.189]) by smtp.gmail.com with ESMTPSA id ay6-20020a05600c1e0600b003ee443bf0c7sm1318153wmb.16.2023.03.24.02.30.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 02:30:39 -0700 (PDT) Message-ID: <91d02705-1c3f-5f55-158a-1a68120df2f4@redhat.com> Date: Fri, 24 Mar 2023 10:30:32 +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: <5536d792-867d-6390-81e2-b1ef135d347d@redhat.com> <20230324092731.148023-1-ks0204.kim@samsung.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230324092731.148023-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: rspam07 X-Rspamd-Queue-Id: 2A58E100025 X-Rspam-User: X-Stat-Signature: 7atfkbrnjp31irtfyj1s7fgsffewtmax X-HE-Tag: 1679650243-600351 X-HE-Meta: U2FsdGVkX1/Aemmt/WSWC6mfJmbq7wVgSyN+dHKzO5qqIhJSrmmG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3mXPpAwBwrgwBf1eQkW/FLlL71okL3+i+7X4z4q8TbSKw5DoUCVNIb5jSCS6/PSDYGccRH4kldggG4/vYHzehgUWUQzLyzRePblG5VlCSqEXaAuRNYCIB39oBXmjJitaY5JUFz6MPBSpqrZBGyqVHQeMjB6XF2s3qK7c5jcF8aLluEG2lHTZ7xo4R6QsizYUFhMJ4Cx4TlMl27lsJYRwUI3T8OlgypMoPcv79RT+Ufi+Gt0vjY/2ZJmuHO8rW9NqGJbzW5Hfe/m6MKPzlvlfoz5GNNyHl86v 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:27, Kyungsan Kim wrote: >> 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". > > FYI for the first time I named it as ZONE_CXLMEM, but we thought it would be needed to cover other extended memory types as well. > So I changed it as ZONE_EXMEM. > We also would like to point out a "special" zone aspeact, which is different from ZONE_NORMAL for tranditional DDR DRAM. > Of course, a symbol naming is important more or less to represent it very nicely, though. > Do you prefer ZONE_SPECIAL? :) I called it ZONE_PREFER_MOVABLE. If you studied that approach there must be a good reason to name it differently? -- Thanks, David / dhildenb