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 32CC2ECAAD2 for ; Thu, 1 Sep 2022 06:25:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A08A96B0072; Thu, 1 Sep 2022 02:25:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B87B6B0073; Thu, 1 Sep 2022 02:25:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 859348D0001; Thu, 1 Sep 2022 02:25:14 -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 73A536B0072 for ; Thu, 1 Sep 2022 02:25:14 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4AC9A120A1E for ; Thu, 1 Sep 2022 06:25:14 +0000 (UTC) X-FDA: 79862529348.09.5E9B9C6 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf05.hostedemail.com (Postfix) with ESMTP id EB2F5100037 for ; Thu, 1 Sep 2022 06:25:13 +0000 (UTC) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28166KZL006068; Thu, 1 Sep 2022 06:24:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=QQhCb+FskmjfqMLGykfJhvDY+A7IPLRr+13M5HvxOgs=; b=Htb8quhdnDGbqIWUfHELpGZxxgu1sEaqYfr46FAtY8xeNZE6K43RHZFct69e37NK5xW0 gUv4+L7GpPVphcJJ/OBUjzFGuHlz68FEIHJkVFPW3yd6KO3IIajqg42vZjCcIaiTxo0e MWhfOQxz9REJerFJJE/osBrGkzldTsBHkjB7KwrH+UM84BpuLKz8G9UC1fUsfEb7+4F4 vCXM9wVgiYqLRHabJ7vT+3K+9s88a/94nNLd7he3ZQWdvsxDDYyBv54STZAzlBNg1TUN 1Nvy/1NWHctDmfW/39lLhCA9YOc/aigsyIIlM1oChymt4qmo02fdHegfMTYaE4VsNYDh ZA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3jaq660k56-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Sep 2022 06:24:53 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 28166x7O009721; Thu, 1 Sep 2022 06:24:53 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3jaq660k4f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Sep 2022 06:24:53 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2816LpR9010778; Thu, 1 Sep 2022 06:24:51 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03ams.nl.ibm.com with ESMTP id 3j7aw968um-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Sep 2022 06:24:51 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2816OmQs40108362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Sep 2022 06:24:49 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DF4AE4C040; Thu, 1 Sep 2022 06:24:48 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 18E214C046; Thu, 1 Sep 2022 06:24:44 +0000 (GMT) Received: from [9.43.54.15] (unknown [9.43.54.15]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 1 Sep 2022 06:24:43 +0000 (GMT) Message-ID: Date: Thu, 1 Sep 2022 11:54:42 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH mm-unstable] mm/demotion: Assign correct memory type for multiple dax devices with the same node affinity Content-Language: en-US To: "Huang, Ying" Cc: linux-mm@kvack.org, akpm@linux-foundation.org, Wei Xu , Yang Shi , Davidlohr Bueso , Tim C Chen , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Johannes Weiner , jvgediya.oss@gmail.com, Bharata B Rao References: <20220826100224.542312-1-aneesh.kumar@linux.ibm.com> <87a67j1uyk.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Aneesh Kumar K V In-Reply-To: <87a67j1uyk.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: FRb_FSmd90YHyCtg5qXfIeO1w_Rb5Vto X-Proofpoint-ORIG-GUID: ry5pEToQ3QWddUNlKrXvMEnPQHl_4ERG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-01_03,2022-08-31_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=0 impostorscore=0 spamscore=0 adultscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 phishscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209010025 ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Htb8quhd; spf=pass (imf05.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662013514; a=rsa-sha256; cv=none; b=ctlKkjWutctK6DmeALfjWetiVJVea+hUhh96Exhagnddz1zi/M2816hS1MGydfIB/cvuS5 JZHa7s8KkVWKNfsrDq1EdWN02Fp7WMaUBop+uhPkho1BA+MHthHc/naOgKPujTZf1cCWAm RXlBRYLRoejNVZr1BpqYmxiNiMr29zY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662013514; 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=QQhCb+FskmjfqMLGykfJhvDY+A7IPLRr+13M5HvxOgs=; b=k/9kzYkCWTbuJr0aTbYsDHeaAgfUlaIQoO5kIhk6POIJ06MCfj5YV91rwmmyvgpNeCPZKz kRt33XS1lyOII4/jxlqdYgGkt870fnI6JcEzbFSRCilTde2KOznmBj3TLdusKFldsWGbsB 1B34jUnTpxxnu5KHDGpjqQOILx2V/o4= Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Htb8quhd; spf=pass (imf05.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Rspam-User: X-Stat-Signature: exp4tkec5m6md4xxr9i797gukxgyfoig X-Rspamd-Queue-Id: EB2F5100037 X-Rspamd-Server: rspam09 X-HE-Tag: 1662013513-858571 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 9/1/22 11:45 AM, Huang, Ying wrote: > "Aneesh Kumar K.V" writes: > >> With multiple dax devices having the same node affinity, the kernel wrongly assigned >> default_dram memory type to some devices after the memory hotplug operation. Fix this by >> not clearing node_memory_types on the dax device remove. > > Sorry for late reply. > > Just for confirmation. There are multiple dax devices in one NUMA node? > > If you can show the bug reproducing steps, that will make it even easier > to understand. > NUMA nodes are assigned per region and you can have multiple devdax namespace with same NUMA node affinity. dax0.1 and dax0.2 are examples. To recreate you can follow the below steps root@ubuntu-guest:/sys/devices/system/node/node3# ls compact cpumap meminfo memory34 memory36 memory38 memory41 memory43 memory45 memory47 memory50 memory52 memory54 numastat uevent cpulist distance memory33 memory35 memory37 memory39 memory42 memory44 memory46 memory49 memory51 memory53 memory55 subsystem vmstat root@ubuntu-guest:/sys/devices/system/node/node3# root@ubuntu-guest:/sys/devices/system/node/node3# for mem in memory*; do echo 0 > $mem/online; done root@ubuntu-guest:/sys/devices/system/node/node3# cd /sys/bus/dax/drivers root@ubuntu-guest:/sys/bus/dax/drivers# echo dax0.0 > kmem/unbind root@ubuntu-guest:/sys/bus/dax/drivers# cd /sys/devices/system/node/node3/ root@ubuntu-guest:/sys/devices/system/node/node3# ls compact cpumap meminfo memory42 memory44 memory46 memory49 memory51 memory53 memory55 subsystem vmstat cpulist distance memory41 memory43 memory45 memory47 memory50 memory52 memory54 numastat uevent root@ubuntu-guest:/sys/devices/system/node/node3# for mem in memory*; do echo 1 > $mem/online; done -aneesh