Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5267033yba; Wed, 10 Apr 2019 15:26:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDq0eE1l2fwToTnd9WIfuaJzO2Nc41fz+W5l33Dc1jBCU27v+5WTkZ3k2sqKTA29dBAqeu X-Received: by 2002:a17:902:28e9:: with SMTP id f96mr25360596plb.190.1554935186171; Wed, 10 Apr 2019 15:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554935186; cv=none; d=google.com; s=arc-20160816; b=U8Rbw3wRNsjuKs/bfY7SUaBihCenrRJDoin5Ib8xq8gT7hA/cuwAubnpCYIoIkVfJ9 nOlmfofGE8B5GZ91apkHhq62EMmyN9xcgFfu3fRS5hNhpt2+8m9RobPXKmz7S33tvRUx AYlM+m6kkMGrwmFw9r+OawYgCQ9o6abwCRi628L4WlzBvpJyImiTXBI7Hg+kAS9k+7oC gIfCIiKK94A1lT0MeTOj0FD4JBJmDvgI3GtzXIePTuphdlSlqvJZCItAI824vXa+NHLr SJWzjIXgYUB20fFjjmMTLvU8brTuxPmUeAgLCadfquB4YLkXxmxcfYyI/xU32Cokt6bj vu2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Y7nE7ZG7nELr6t53V66jtZhQYEzl5on9riW0DsXxtsU=; b=AjC/4eQ3xjK0Ag+iCJEZbaiW6y4kHnA6jBcoqSl/FUBt/axI/95gH00QweymNmH3UA Eq3gnss5MxyFKySVgqdTauvx7UWKyMx63NzTwuGhyAMrObhD9aD2gW73p12Am03k6kE/ mJYykhPb8twPmCwLhDh2cg9PiQ1dI9B1yhiQ0g3gFJaybnOzhpf5rY0e52CL7MJkzGj/ pO1ru++G+vkLod2KL1CbRaqxjgu7deVHxCBtVz0Tz099F8ahpaiYPwrB8FWdZm/FTtuS qFgrSdC/ysE3Z51tZAu9a212cbqvsy6pr24MZa0nXYwLI4tYWhu2NMYGEgxIq07sjlLU Bmmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Vz+FQpOz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si9159439pls.114.2019.04.10.15.26.10; Wed, 10 Apr 2019 15:26:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Vz+FQpOz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726564AbfDJWYR (ORCPT + 99 others); Wed, 10 Apr 2019 18:24:17 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:44507 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfDJWYQ (ORCPT ); Wed, 10 Apr 2019 18:24:16 -0400 Received: by mail-ed1-f66.google.com with SMTP id d11so3408883edp.11 for ; Wed, 10 Apr 2019 15:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Y7nE7ZG7nELr6t53V66jtZhQYEzl5on9riW0DsXxtsU=; b=Vz+FQpOzm6oQvCsP+brtuHCQSOX5/IFmz44R5D6t8JjmNBhQLvZMg12d3Mf6jRuj2d XROl8WlRjkeOMYXrAvOEVCutH9U5gq6PmaEMgw9CVvrnBormAApbvWFf9PbXBdZD2Bgk gRwozLmSR9dFbDKzk4tLfRA6nXzZ1RPIdFwZKrLyl077JXOWvmbE02yK4z3GiSUDkjNh FtSJAfcl/a+EYUu/nwKCLcM7j5QfUkMSaUNeXx3FD22PDYBWTpwG2FVJzfzo0rZy7mMU 5yfYFUy2QM6S30nBSZNlvW0ukXcXDc8ulnVSsxeCsX7UoKrbjFXO/TznvRZVaaSGwRSp +CfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Y7nE7ZG7nELr6t53V66jtZhQYEzl5on9riW0DsXxtsU=; b=cAeEQu8Swa/qndk0po6phqsQWkfIQ+DZLCH16BNGDpepMkSUUsAl02+lLWxsEByWk4 itRu0+v/S/GAzYbqasdzmIEpMFvD4aHXNIFFpUmXPrSEA3kAVVN6D1ZDHNhzeHGdseAO 7uPvH0hygYu1MzNY+ySuwOBb3QMOaEdRpHL9kmFHsPoCEXQe6xESgQvl2VPqdOIHY3Yf EuD3yiFDH7Rr7tARODvSy4zHk/vOHwlLGMuyO/BHoqU8AIijv/wAa7oIoA5oJQbvG6MK pgmNXgTOOi3Rpn8/NmRHmz/dmTCG09l/kDC8qzwxFS07OQ7SRScyEu9QmeQ76JOVY1DA 3qjw== X-Gm-Message-State: APjAAAUIR1/FfNJCR+++ex99MUlW3wbjpCLFc0cqYI3c5qFwEo0bsx7y QZsfHqak4rAdVRD4cCHoza4= X-Received: by 2002:a17:906:7496:: with SMTP id e22mr25675653ejl.45.1554935055071; Wed, 10 Apr 2019 15:24:15 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id h11sm4540083eds.44.2019.04.10.15.24.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Apr 2019 15:24:14 -0700 (PDT) Date: Wed, 10 Apr 2019 22:24:13 +0000 From: Wei Yang To: David Hildenbrand Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Oscar Salvador , Michal Hocko , Pavel Tatashin , Wei Yang , Qian Cai , Arun KS , Mathieu Malaterre Subject: Re: [PATCH] mm/memory_hotplug: Drop memory device reference after find_memory_block() Message-ID: <20190410222413.4ljc2tchgkbl4lbo@master> Reply-To: Wei Yang References: <20190410101455.17338-1-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190410101455.17338-1-david@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 10, 2019 at 12:14:55PM +0200, David Hildenbrand wrote: >While current node handling is probably terribly broken for memory block >devices that span several nodes (only possible when added during boot, >and something like that should be blocked completely), properly put the >device reference we obtained via find_memory_block() to get the nid. > >Fixes: d0dc12e86b31 ("mm/memory_hotplug: optimize memory hotplug") >Cc: Andrew Morton >Cc: Oscar Salvador >Cc: Michal Hocko >Cc: David Hildenbrand >Cc: Pavel Tatashin >Cc: Wei Yang >Cc: Qian Cai >Cc: Arun KS >Cc: Mathieu Malaterre >Signed-off-by: David Hildenbrand You are right. Reviewed-by: Wei Yang >--- > mm/memory_hotplug.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >index 5eb4a4c7c21b..328878b6799d 100644 >--- a/mm/memory_hotplug.c >+++ b/mm/memory_hotplug.c >@@ -854,6 +854,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ > */ > mem = find_memory_block(__pfn_to_section(pfn)); > nid = mem->nid; >+ put_device(&mem->dev); > > /* associate pfn range with the zone */ > zone = move_pfn_range(online_type, nid, pfn, nr_pages); >-- >2.20.1 -- Wei Yang Help you, Help me