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 EC837C04AA5 for ; Thu, 25 Aug 2022 12:16:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F1876B0074; Thu, 25 Aug 2022 08:16:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A173940007; Thu, 25 Aug 2022 08:16:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 368656B0078; Thu, 25 Aug 2022 08:16:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 26FBF6B0074 for ; Thu, 25 Aug 2022 08:16:49 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 02449140BE5 for ; Thu, 25 Aug 2022 12:16:48 +0000 (UTC) X-FDA: 79838013738.13.813507C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 9C00F1C000E for ; Thu, 25 Aug 2022 12:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661429808; 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=50JDuznIcplANtCCRHF9PDcl3HjI31bAhYxaYQTlejM=; b=MEDy6YcV0WAS7Dqxcn2ze0yiFYYWo0B6WxtZxLJ0SO22XVqweEHMJOTPD6Raq5+G+PMXXN os8n0l9830rnVgGnLtgvlZEraqs5vhgR6pvugomNhvxPI+Bc7yrb0Njb6AMT4BImDous0i ktK9F0z3wakJpDtosjZxaEnvDqYsc4Y= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-615-Z8aL3Z3iMB6NaH6QhKFBew-1; Thu, 25 Aug 2022 08:16:45 -0400 X-MC-Unique: Z8aL3Z3iMB6NaH6QhKFBew-1 Received: by mail-wm1-f71.google.com with SMTP id r10-20020a1c440a000000b003a538a648a9so10851552wma.5 for ; Thu, 25 Aug 2022 05:16:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=50JDuznIcplANtCCRHF9PDcl3HjI31bAhYxaYQTlejM=; b=2nNQeOFBRc/Ku5tdx7c85Pk1TTc3dHs7ymPuAjJS6VnvrxeZn5ozPoRpJJS0xjrezN BU2H0kvw4M3zbsYSr0pBuyYsLLf6+OVegjTs4TzvzijhaDPAT4Tj1xQSN3Sj8eHTclCU MjE1rOQwAYaTOAAE1YNBHWY4+cVCC8NpAn6VcAUjVwu1H39k18QvHe79EZ2V4I4VFPeR WAsFnCfp/Q2GQBnSWiAPS0ZMJHLlcP/wGLcqnsWOJmeWz1jJG6GmvPrNZY2Vxm1HWCh/ L4yE9HQKpofzDeumY1RmJDXlZdc6ikVfV6J5dAWELDq9WtqAQmPWyu2sX5kMsueGsPxH UQHA== X-Gm-Message-State: ACgBeo3zvTe4VlSdjZjTu++fRvH2U54SmayzaXgrUW1fmqIC/C5sHuAO rvJzxxsIMF3PJs0APUBid1KbxGkg9zOP3icXtiCiWfhVxo6MxCsPYYXIzhN3kl7Vd+qshGMh5cG MOwrdcdZmU+4= X-Received: by 2002:a05:600c:2248:b0:3a5:a469:b874 with SMTP id a8-20020a05600c224800b003a5a469b874mr7854863wmm.63.1661429803949; Thu, 25 Aug 2022 05:16:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR4yMHS2Da8W3+l7WwcSWgXKwX1JSRL+OG+2q/EzEzRgH4HIZaKuOe2rXsQHEmuVi0vDa73wHQ== X-Received: by 2002:a05:600c:2248:b0:3a5:a469:b874 with SMTP id a8-20020a05600c224800b003a5a469b874mr7854850wmm.63.1661429803698; Thu, 25 Aug 2022 05:16:43 -0700 (PDT) Received: from ?IPV6:2a09:80c0:192:0:20af:34be:985b:b6c8? ([2a09:80c0:192:0:20af:34be:985b:b6c8]) by smtp.gmail.com with ESMTPSA id l6-20020a05600c4f0600b003a690f704absm4718162wmq.4.2022.08.25.05.16.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Aug 2022 05:16:43 -0700 (PDT) Message-ID: <0602b3b4-214f-94b1-61fe-2b2528ff529b@redhat.com> Date: Thu, 25 Aug 2022 14:16:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] mm/demotion: Fix kernel error with memory hotplug To: "Aneesh Kumar K.V" , linux-mm@kvack.org, akpm@linux-foundation.org Cc: Wei Xu , Huang Ying , 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: <20220825092019.379069-1-aneesh.kumar@linux.ibm.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220825092019.379069-1-aneesh.kumar@linux.ibm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MEDy6YcV; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661429808; a=rsa-sha256; cv=none; b=ybS0wL8coM80WzRIYd7JaYOusZFaDobNdQMRrITIy7niYqSW0jq9C8IvNZoBNeZy1oLeEh UoPQsSgiifjTyU0vU15WBJwA6MDos5XYirIlwxf0wfn9YJKNL05XxUQtcJX0QTfnqRocnE izninDxv28hNxcvjNT3cj4rm5p9BSJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661429808; 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=50JDuznIcplANtCCRHF9PDcl3HjI31bAhYxaYQTlejM=; b=517jX/6+r4l0k72MVwFHOUwh1gGiyQUZ+B6gT9XECw7dWA55VsIqMOSg+D7XNOESjE07/c nhlwNxq4Roc6h+PoWX2EPTGlEXouBxvhxHJCHyHpRR68Z1yU88IMaJJ1KPwotJMTKqGGFS kFCABj3BeDFgyW4wGRKbHt0J+BPDMqY= X-Stat-Signature: 1opc9why1ph39nypi7a6s3og46jokkbg Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MEDy6YcV; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9C00F1C000E X-Rspam-User: X-HE-Tag: 1661429808-609837 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 25.08.22 11:20, Aneesh Kumar K.V wrote: > On memory hot unplug, the kernel removes the node memory type > from the associated memory tier. Use list_del_init instead of > list del such that the same memory type can be added back > to a memory tier on hotplug. > > Without this, we get the below warning and return error on > adding memory type to a new memory tier. > > [ 33.596095] ------------[ cut here ]------------ > [ 33.596099] WARNING: CPU: 3 PID: 667 at mm/memory-tiers.c:115 set_node_memory_tier+0xd6/0x2e0 > [ 33.596109] Modules linked in: kmem > > ... > > [ 33.596126] RIP: 0010:set_node_memory_tier+0xd6/0x2e0 > > .... > [ 33.596196] memtier_hotplug_callback+0x48/0x68 > [ 33.596204] blocking_notifier_call_chain+0x80/0xc0 > [ 33.596211] online_pages+0x25e/0x280 > [ 33.596218] memory_block_change_state+0x176/0x1f0 > [ 33.596225] memory_subsys_online+0x37/0x40 > [ 33.596230] online_store+0x9b/0x130 > [ 33.596236] kernfs_fop_write_iter+0x128/0x1b0 > [ 33.596242] vfs_write+0x24b/0x2c0 > [ 33.596249] ksys_write+0x74/0xe0 > [ 33.596254] do_syscall_64+0x43/0x90 > [ 33.596259] entry_SYSCALL_64_after_hwframe+0x63/0xcd > > Fixes: mm/demotion: Add hotplug callbacks to handle new numa node onlined Do we have a proper 12-digit commit id as well? Do we have to cc stable? > Signed-off-by: Aneesh Kumar K.V > --- > mm/memory-tiers.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c > index a20795bb0e07..ba844fe9cc8c 100644 > --- a/mm/memory-tiers.c > +++ b/mm/memory-tiers.c > @@ -451,7 +451,7 @@ static bool clear_node_memory_tier(int node) > memtype = node_memory_types[node]; > node_clear(node, memtype->nodes); > if (nodes_empty(memtype->nodes)) { > - list_del(&memtype->tier_sibiling); > + list_del_init(&memtype->tier_sibiling); > if (list_empty(&memtier->memory_types)) > destroy_memory_tier(memtier); > } -- Thanks, David / dhildenb