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 934F1ECAAD2 for ; Fri, 26 Aug 2022 09:54:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E270940008; Fri, 26 Aug 2022 05:54:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 06B38940007; Fri, 26 Aug 2022 05:54:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2688940008; Fri, 26 Aug 2022 05:54:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id CC3D0940007 for ; Fri, 26 Aug 2022 05:54:02 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A9DE2140D69 for ; Fri, 26 Aug 2022 09:54:02 +0000 (UTC) X-FDA: 79841282724.25.68D19BA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 3BE8118000A for ; Fri, 26 Aug 2022 09:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661507641; 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=gxGpACUZugSb6gistk/DMyJom0Pp6sbkUgL6hlrJ7UI=; b=QU4mE6HqGBMSE5s6nFeOldIC/iPmKLP8uhl409RTB5ul+/g8gYTl77EdiONCaGIZ3UhYLu VzBkylQvEtDyxeHD8zHKh/w5L4HZQlMS9GSTPDan77XhWoMYHhEMuv5Cqzi9jB1nzwnp1a Gl6sndTL5myyr+pfyTuJwvvfHWRH3Cs= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-460-wiS6o0AvM3GxpXC5Xf0arA-1; Fri, 26 Aug 2022 05:54:00 -0400 X-MC-Unique: wiS6o0AvM3GxpXC5Xf0arA-1 Received: by mail-wm1-f70.google.com with SMTP id k24-20020a7bc418000000b003a62ad689feso285426wmi.3 for ; Fri, 26 Aug 2022 02:54:00 -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=gxGpACUZugSb6gistk/DMyJom0Pp6sbkUgL6hlrJ7UI=; b=DY8K8locfqX+4YXPWEVBYLfD4vgB/xRbWDMZQKxfjVCPHn5meUYxk/YWHKYFta+LmD sl2cKPiL8tloYtkvYAqBELuxWCNCnHaVdKxjmSbLOUWDdGRGEVzMfWcepfe5D2uFnBbm +VYzwfy8zxpP/vLoz+/bfo3b1VxLJ0k6XNCPmqELL+FefQVrJhUjd89fT6atvyAQ06oo HB0iCw6zrw90hqSQ6LaQUy7/qovjihMJspeIUKX39VMXgp+X59IcFpmJwVoGDVDn2Tbk PVTsxnkpZ5MSFvORyuWXNEef8XDn1EsVXJq/97zsSUq+pw0xQJAvCDrNWpnPuQwuXZAG ACaw== X-Gm-Message-State: ACgBeo25XR22e3d35j0ASSWTRL1xu7agw/grmZJkju0FrQPPYoJ/EBPP xgwSTdfbbEUGHaHI6GkKvKNOjC5CtiM0G1onyEMYmR8Aeb7eqaMWzCEsUEclzuRd5IqIFMWUug1 hqcMH/cFNJzs= X-Received: by 2002:a05:6000:1a42:b0:225:8b5e:e0f8 with SMTP id t2-20020a0560001a4200b002258b5ee0f8mr1160325wry.710.1661507639316; Fri, 26 Aug 2022 02:53:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR7OtQPy8Lm0bdpcz01XQN4p2UT47Y+kVemr6tDelSv1bI7UiNdLH1R+YF0s1vXJMQxqxwNRCg== X-Received: by 2002:a05:6000:1a42:b0:225:8b5e:e0f8 with SMTP id t2-20020a0560001a4200b002258b5ee0f8mr1160302wry.710.1661507639072; Fri, 26 Aug 2022 02:53:59 -0700 (PDT) Received: from ?IPV6:2003:cb:c708:f600:abad:360:c840:33fa? (p200300cbc708f600abad0360c84033fa.dip0.t-ipconnect.de. [2003:cb:c708:f600:abad:360:c840:33fa]) by smtp.gmail.com with ESMTPSA id h21-20020a05600c351500b003a60ff7c082sm8338300wmq.15.2022.08.26.02.53.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Aug 2022 02:53:58 -0700 (PDT) Message-ID: <204b7465-0d30-d305-64fb-60fe46ca1dba@redhat.com> Date: Fri, 26 Aug 2022 11:53:57 +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> <0602b3b4-214f-94b1-61fe-2b2528ff529b@redhat.com> <5b0d911b-4cc2-f1ae-b33b-79aca6e3124c@linux.ibm.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <5b0d911b-4cc2-f1ae-b33b-79aca6e3124c@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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661507642; a=rsa-sha256; cv=none; b=YXxtLV6mZEwfmTSfrhs7H739rmhYOWq+hFMW7GLWgyOEK6BHXLBcI7F3zX9OxawMGMbq+B vdECSyX5rYCSyJK/msoXZAe+btJscLWwwSrQZdOI+XwmOh7L2j5Vnysyga6o+Y1K/cfLrC 3qEnQBtfABiiZFPiqfCxOE132ekEgxk= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QU4mE6Hq; spf=pass (imf16.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=1661507642; 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=gxGpACUZugSb6gistk/DMyJom0Pp6sbkUgL6hlrJ7UI=; b=ZIq2mBrzscIQTvw6SxfROIDkikS0RgThHujzZprwmsZ36ex6V3BhWMF6mVYepG1HFF2O++ dS2tlBSi1efYMu8tcQya+yckz9lqp2hvhxMJEfwdizigOIJ9EasYlpwPxOj1iv2n7Y3FEh Z8oikr61WimoJOcxmBRlZXZQJVoCvV4= X-Stat-Signature: kzcrfao61fihnj9rgysma8xc37p11mk7 X-Rspamd-Queue-Id: 3BE8118000A X-Rspam-User: X-Rspamd-Server: rspam06 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=QU4mE6Hq; spf=pass (imf16.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 X-HE-Tag: 1661507642-854563 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 14:53, Aneesh Kumar K V wrote: > On 8/25/22 5:46 PM, David Hildenbrand wrote: >> 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? >> > > That patch is not yet merged upstream. It is in mm-unstable. I guess Andrew can fold the change > into the original patch? > Please make that clearer next time somehow -- either via "[PATCH mm-unstable]" or just by stating "Andrew, please squash this into XYZ". I know, akpm headquarter tracks all pending patches, but for other reviewers this really helps to figure out how urgent this is and where this applies to (+ saves time). -- Thanks, David / dhildenb