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 D405EC6FD20 for ; Fri, 24 Mar 2023 14:55:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48F8B6B0075; Fri, 24 Mar 2023 10:55:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 43F22900002; Fri, 24 Mar 2023 10:55:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32DCC6B007B; Fri, 24 Mar 2023 10:55:20 -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 230C06B0075 for ; Fri, 24 Mar 2023 10:55:20 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C3E2E140A9F for ; Fri, 24 Mar 2023 14:55:19 +0000 (UTC) X-FDA: 80604089958.07.D447D91 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 7FEE520013 for ; Fri, 24 Mar 2023 14:55:17 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="NCsmFY/L"; dmarc=none; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679669718; 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=eTcXgqk2rzRigxmbJ3ABqXEIuWKSD+gs6tvhN/boums=; b=UCPqW3kDD9BqODVNsMnvlmo+4UmO//C7i8SI3knxYlLcWhP2GdQfjahu9TWorACHk7UOWc van4NPgBEJqQPAhytv0eUXjFHX4BTREmrIRt2LN/BygRRPtJY5Q//6IsGLHraShKTrGHF6 AyJH5gwBvk3T6s1nX/xfANkr3/9FqhY= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="NCsmFY/L"; dmarc=none; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679669718; a=rsa-sha256; cv=none; b=7h0Ddj457o7HhtOouFSuNGBDi9PHFkQrThvxfY91Eqtz2N//Co28v6U5qW+hbHxtKo6G8I Qam1EcsWL6qd4/2Ivlo2fz1CwQkIv6tSMZLRJ3vEruskAPXo/WGEzsr4SEe2A9YWMRJ1gJ IKlhJ6JmYakR2LKyRdfV5UBpixITmd4= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=eTcXgqk2rzRigxmbJ3ABqXEIuWKSD+gs6tvhN/boums=; b=NCsmFY/Lysf9dov02yXtwZY+a7 gdMqk3opPGE7GRSUOwdRJ+aA3XqQ7BoEg/EMAsSRDc2IG9h3/9LZArrdeImlHy/FLRj6+DFkTrRsU odxkREjbZLEtyJCq1dIYWSyZMfi9u1jNv0jM0UrrVyMxlH0CCsNjkAoImoJY/Wbpiej8HfqHr4t9z 3OLUz4rB7ZkwYNk7WAwds0HVS5A/A3mVZzBx31FYp/89aRPyz0VvCGGgInCWOe7dIIP3jk1aZc8zT IbrB5ONEwGqjTb8kMU6KuBx1VBd1YnXNdDvSc2cG6Ynz0t70Yrfr2PrXLUHOeXLKA/5H0UsiZfEUX CNWOgZzQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pfioo-00504p-5t; Fri, 24 Mar 2023 14:55:02 +0000 Date: Fri, 24 Mar 2023 14:55:02 +0000 From: Matthew Wilcox To: Kyungsan Kim Cc: dan.j.williams@intel.com, 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 Subject: Re: RE(2): FW: [LSF/MM/BPF TOPIC] SMDK inspired MM changes for CXL Message-ID: References: <641b7b2117d02_1b98bb294cb@dwillia2-xfh.jf.intel.com.notmuch> <20230323105105.145783-1-ks0204.kim@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230323105105.145783-1-ks0204.kim@samsung.com> X-Rspamd-Queue-Id: 7FEE520013 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: ep94nef7kwrgyoa3kd5fsndazrpq67ji X-HE-Tag: 1679669717-720239 X-HE-Meta: U2FsdGVkX1+zKvkWqPDJ4DyBGtdlxIhmUtvabVRwiQg/lg63RBCXtQKfReDKRoSaVqLNwd5FxgTkKLqbHEXIGaWz8x1/KskM6g0idBzh0seqwj+ZgBX3ZshsNxV8IMMzRQ75UoBSSJZykXLAs0uxv1UI1Zk/E5F2lJ5oJtiTZuHkZPsHXuwaeWq57NA9qfwslfYdBK9Owa33b2XgqiPUBSQnKCTeVN8NcEQRQonnxxaZLgwXe9JO6J+C+OGxYcY0ty0f8NGOdtoXalG+IquWIwO+qiyN2Dx1IhMC/ykgO7WgrKTJ8+xpgGzlFuS4hYMNdcrhGkpCBSE0VGLcwKNGo8mif5JsvMIgl1tf0C3X1V6lUawM/IYefPUvB84xEArtpwUOxBskAUJFLNcY0RSYFE3OO7l3LAm16eTtgcSicK6OYlj4ZzNQdMDSN3/zzKkqEWwFauPWef9z26z9Tz5onesd9r6PjC1vyVM++s3uCz/z5i2pqEfU86iEAetoSm6527CKBOGukrdRIDLsXaoo19/F4VDQtYZLqMdf1w+eGI4CBPo19tPNdIfoprBAkJBt8eM6ycW67QEQLElpASla0AFIlyY1tfMdKiFunwv64dxhtRgCI1O9Vr6LBovYEyo2RBcuCkYBpDFJKErN5CYTQ0Ce28Y8OKk8FeARlTPAxKsFh6kgAbZadLk01aH8tLJV2OsDKI2IioQj990yG5kjgc9AgHrbMf9DGkguejYb3DJdyO8yyCF8lnxAhn2XQCUiAL6okw4bcRyNJ7a3ZL+8zLu0Rwyc1EN2qPsbZeGUGKY0r8HPBJ3wZywtM07MzRqao/bnz9YshFER5VvaE/Tym7sFX3Qr2R+K48rlpsWF3E0bcpVjkr3Ll7yK2y6ysaH6FzxmvgmUM8momoAizrsg7jFBru4oJtxiJc6X4UeZpvLrIrKY0s+k9vTuBSXNiq2+Q5rElM+7QDS5rqxH2cD gQAqaKEr Mf1fpjvdevcSFdU/InBlkX9r3+gyE0lVMSI46zo0w0T+WvqwL6KnU3gHtHpLhH/gG/xZbndrhm2L9DgudyvVYfI/XRyT7HHcgoZteG5pta7CVvXP0lpG2ZfINGF+T4N045W+h0F007QzJdtjqsWLiBrOKJw== 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 Thu, Mar 23, 2023 at 07:51:05PM +0900, Kyungsan Kim wrote: > 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. No, that's not true. You can allocate kernel memory from ZONE_MOVABLE. You have to be careful when you do that, but eg filesystems put symlinks and directories in ZONE_MOVABLE, and zswap allocates memory from ZONE_MOVABLE. Of course, then you have to be careful that the kernel doesn't try to move it while you're accessing it. That's the tradeoff. > Alternatively, we allocated a kernel context out of ZONE_MOVABLE by adding GFP_MOVABLE flag. > In case, oops and system hang has occasionally occured because ZONE_MOVABLE can be swapped. I think you mean "migrated". It can't be swapped unless you put the page on the LRU list, inviting the kernel to swap it. > We resolved the issue using ZONE_EXMEM by allowing seletively choice of the two usecases. This sounds dangerously confused. Do you want the EXMEM to be removable or not? If you do, then allocations from it have to be movable. If you don't, why go to all this trouble?