[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190410222413.4ljc2tchgkbl4lbo@master>
Date: Wed, 10 Apr 2019 22:24:13 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Oscar Salvador <osalvador@...e.de>,
Michal Hocko <mhocko@...e.com>,
Pavel Tatashin <pasha.tatashin@...een.com>,
Wei Yang <richard.weiyang@...il.com>, Qian Cai <cai@....pw>,
Arun KS <arunks@...eaurora.org>,
Mathieu Malaterre <malat@...ian.org>
Subject: Re: [PATCH] mm/memory_hotplug: Drop memory device reference after
find_memory_block()
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 <akpm@...ux-foundation.org>
>Cc: Oscar Salvador <osalvador@...e.de>
>Cc: Michal Hocko <mhocko@...e.com>
>Cc: David Hildenbrand <david@...hat.com>
>Cc: Pavel Tatashin <pasha.tatashin@...een.com>
>Cc: Wei Yang <richard.weiyang@...il.com>
>Cc: Qian Cai <cai@....pw>
>Cc: Arun KS <arunks@...eaurora.org>
>Cc: Mathieu Malaterre <malat@...ian.org>
>Signed-off-by: David Hildenbrand <david@...hat.com>
You are right.
Reviewed-by: Wei Yang <richard.weiyang@...il.com>
>---
> 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
Powered by blists - more mailing lists