Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp917353pxp; Wed, 16 Mar 2022 21:14:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdt26PCZAYXTAUh6xTI2cdOm1vhuYXZwmv11A9l5cjYvqnaOOuVKy2AdVz+FOrNYB/KFOZ X-Received: by 2002:a17:902:9b97:b0:153:85ac:abc0 with SMTP id y23-20020a1709029b9700b0015385acabc0mr3162502plp.100.1647490459970; Wed, 16 Mar 2022 21:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647490459; cv=none; d=google.com; s=arc-20160816; b=RsqMGhywEtXX+AgOhFm0bQ7UH2dLBpA+OI9VZHltDXYMMgNWHip39BmAyyXSNOuO5g IpuRoIgIDYVeblR80avI5WD6/3vuNjMVOholbjXg7geTQkVqxqMCrFCc1F6yRuC2Q1ee wsTddp1iPOGYTkOjsqmmOEMsafQOuSa5/JXHEWpKJVWK6reCDvXsdfbbPgTv6A6Xfgt4 UejBvgAylwLyQOiEy+ZIfJGi6kBpIz8C/c4OG3yYayH01i+duEWIn2xzPM/BG8J00YhM Jwki25l00phL1cfuLK02lgp0lgUp/neQ1QswK6O6CWDtdU97SIyhHn6EnxI+yDVdBmhM oEVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=tfJJB/zxJxbASqEMWuMPEFJZmPZC1yNFWWyena+d4lk=; b=K8qvETINYVsxWRDAbot2qvU+F58nrCFkEGzpAfAvM/NGGy3/MVMW1yVv2ZkDtIk3Me yV5cIssIwbgLdP9Lqu2eco5Po1IoAAcoYzuLtVU2/kFfdqx+cw7eQRcY36xRnAL3meW2 elXe2c3lvkkBoWq2Sb42TbqBr4VEBpqXxZK9XaRh+Zjimu9z809HNifT5fv3u/n0d4NZ 2WFr7esY7IUldDySrsr205pq1EYN+Daikk+XiK+5iiHYKz3t9J+ZFwA4tM1cLi5pWEpY lUco3K0ioveRdvDGg8t5FSqslJ9rLeEwGnr8wqzkAhX9rOeMVQ2Yt4u9jVCiYKlFx25a XKiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HA7joJSI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x7-20020a17090a530700b001bf082ef447si1168852pjh.111.2022.03.16.21.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 21:14:19 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HA7joJSI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7778CBBE39; Wed, 16 Mar 2022 20:52:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239156AbiCOGdC (ORCPT + 99 others); Tue, 15 Mar 2022 02:33:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234939AbiCOGcu (ORCPT ); Tue, 15 Mar 2022 02:32:50 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47B704A3F6 for ; Mon, 14 Mar 2022 23:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647325899; x=1678861899; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=T43rbjuUfmYFNJl+eyDeXU+oKMJm8uoX+WBhgwCcupw=; b=HA7joJSIGiqKtH485mZtcmX0K7oeEGx1mAMFr1mE9PVwim9BZn7wwVBu 78jAX9VTwsbk8hvmShOE3r5Uc/sAXR9rxya8GyAEnm6XpTl8HTM++oNXE J4Fq2GsqOcgVIvyV+J47qQ/mTWkCHfgo1Dc1B7Z+ooAuVLoMOrgIAAWjw EVUtpTMU5A24U/l0dn17QTPWY17DBLEt+rDFRNkD8HdqRFy7/Od34/wGe rIXxpaS5hRxCHBWqk2JTYfSsafx+bC811jN2L1fXXu62tFe8z1jRVuzPr 8Kr+9CZeynOH9wEgYFt7zAtoi7AyMfRpYblK9eXAwuWvJ76nh+KDfIdK7 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="243676853" X-IronPort-AV: E=Sophos;i="5.90,182,1643702400"; d="scan'208";a="243676853" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2022 23:31:38 -0700 X-IronPort-AV: E=Sophos;i="5.90,182,1643702400"; d="scan'208";a="515743481" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.13.94]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2022 23:31:36 -0700 From: "Huang, Ying" To: Oscar Salvador Cc: Dave Hansen , Andrew Morton , Dave Hansen , Abhishek Goel , Baolin Wang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: Only re-generate demotion targets when a numa node changes its N_CPU state References: <20220310120749.23077-1-osalvador@suse.de> <87mthxb514.fsf@yhuang6-desk2.ccr.corp.intel.com> <87czip73b4.fsf@yhuang6-desk2.ccr.corp.intel.com> <6b63d2ad-9b21-3fd6-37b4-31d7ad804c30@intel.com> Date: Tue, 15 Mar 2022 14:31:34 +0800 In-Reply-To: (Oscar Salvador's message of "Tue, 15 Mar 2022 07:13:37 +0100") Message-ID: <87tubz3ewp.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oscar Salvador writes: > On Mon, Mar 14, 2022 at 08:20:57AM -0700, Dave Hansen wrote: >> Qemu, for instance, has a "mem-path" argument. It's typically used for >> using hugetlbfs as guest memory. But, there's nothing stopping you from >> pointing it to a DAX device or a file on a DAX filesystem that's backed >> by pmem. > > Thanks Dave. > > But that is somehow different, is not it? > When you use pmem backed memory as a RAM for the guest, the guest is not > seeing that as PMEM, but just as a normal RAM, right? > IOW, the guest cannot use that memory for demotion, as we can use it in > the host when configured. > > I might be missing something, I am using this qemu cmdline: > > $QEMU -enable-kvm -machine pc -smp 4 -cpu host -monitor pty -m 5G \ > -object memory-backend-file,id=pc.ram,size=5G,mem-path=/mnt/pmem,share=off -machine memory-backend=pc.ram \ > $IMAGE -boot c -vnc :0 > > (/mnt/pmem was mounted with "mount -o dax /dev/pmem1 /mnt/pmem/") > > My point is, if it is really true that the guest cannot use that memory for > demotion, then we would still need CONFIG_MEMORY_HOTPLUG, as that is the > only way to expose PMEM to any system to be used as a demotion option > (via add_memory_driver_managed() through kmem driver). > > Or am I missing some qemu magic to use that memory as demotion in the > guest as well? You need to put PMEM to a NUMA node to use demotion, as follows, qemu-system-x86_64 --enable-kvm \ -M pc,accel=kvm,nvdimm=on -smp 8 -m 160G,slots=18,maxmem=703G \ -object memory-backend-ram,id=mem0,size=32G \ -object memory-backend-file,id=mem1,share=on,mem-path=/dev/dax0.0,size=128G,align=2M \ -numa node,memdev=mem0,cpus=0-7,nodeid=0 \ -numa node,memdev=mem1,nodeid=1 \ $IMAGE Best Regards, Huang, Ying