From patchwork Mon Jul 6 01:19:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia He X-Patchwork-Id: 11644801 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC073618 for ; Mon, 6 Jul 2020 01:20:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 839802074F for ; Mon, 6 Jul 2020 01:20:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 839802074F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 95C6B6B0007; Sun, 5 Jul 2020 21:20:16 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 931C06B0008; Sun, 5 Jul 2020 21:20:16 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 848E76B000A; Sun, 5 Jul 2020 21:20:16 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id 6DEB86B0007 for ; Sun, 5 Jul 2020 21:20:16 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 37121181AC9CC for ; Mon, 6 Jul 2020 01:20:16 +0000 (UTC) X-FDA: 77005895232.29.knot72_141854b26ea7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 1632B18086E2B for ; Mon, 6 Jul 2020 01:20:16 +0000 (UTC) X-Spam-Summary: 1,0,0,fe9327b7348ed538,d41d8cd98f00b204,justin.he@arm.com,,RULES_HIT:41:355:379:541:800:960:968:973:988:989:1260:1261:1345:1359:1437:1534:1541:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2741:3138:3139:3140:3141:3142:3352:3865:3866:3870:3871:3872:3874:4321:5007:6261:7903:8603:8634:8660:10004:11026:11658:11914:12043:12114:12297:12438:12555:12679:12895:12986:13069:13148:13161:13229:13230:13311:13357:13972:14181:14384:14394:14721:21080:21627:21939:21987:21990:30054,0,RBL:217.140.110.172:@arm.com:.lbl8.mailshell.net-64.100.201.201 62.2.0.100;04ygq3xbrez5tppe6zrnbr6gamxrzoc9c1x514efy8fkuq3ax36einwr4t56q7h.s3ubotbrzrdt675bsomttsq3ehdzkgzaozakuiexd7c7s3mx7t658k5q3jcsruz.o-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: knot72_141854b26ea7 X-Filterd-Recvd-Size: 2628 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Mon, 6 Jul 2020 01:20:15 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 45B061042; Sun, 5 Jul 2020 18:20:15 -0700 (PDT) Received: from localhost.localdomain (entos-thunderx2-02.shanghai.arm.com [10.169.212.213]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D5CE53F718; Sun, 5 Jul 2020 18:20:11 -0700 (PDT) From: Jia He To: Catalin Marinas , Will Deacon Cc: Andrew Morton , Mike Rapoport , Baoquan He , Chuhong Yuan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Kaly Xin , Jia He Subject: [PATCH 3/3] mm/memory_hotplug: fix unpaired mem_hotplug_begin/done Date: Mon, 6 Jul 2020 09:19:47 +0800 Message-Id: <20200706011947.184166-4-justin.he@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706011947.184166-1-justin.he@arm.com> References: <20200706011947.184166-1-justin.he@arm.com> X-Rspamd-Queue-Id: 1632B18086E2B X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: When check_memblock_offlined_cb() returns failed rc(e.g. the memblock is online at that time), mem_hotplug_begin/done is unpaired in such case. Therefore a warning: Call Trace: percpu_up_write+0x33/0x40 try_remove_memory+0x66/0x120 ? _cond_resched+0x19/0x30 remove_memory+0x2b/0x40 dev_dax_kmem_remove+0x36/0x72 [kmem] device_release_driver_internal+0xf0/0x1c0 device_release_driver+0x12/0x20 bus_remove_device+0xe1/0x150 device_del+0x17b/0x3e0 unregister_dev_dax+0x29/0x60 devm_action_release+0x15/0x20 release_nodes+0x19a/0x1e0 devres_release_all+0x3f/0x50 device_release_driver_internal+0x100/0x1c0 driver_detach+0x4c/0x8f bus_remove_driver+0x5c/0xd0 driver_unregister+0x31/0x50 dax_pmem_exit+0x10/0xfe0 [dax_pmem] This fixes it by moving mem_hotplug_done ahead of "done" Signed-off-by: Jia He Acked-by: Dan Williams --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index e1e290577b45..86b36714342b 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1769,8 +1769,8 @@ static int __ref try_remove_memory(int nid, u64 start, u64 size) try_offline_node(nid); -done: mem_hotplug_done(); +done: return rc; }