From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751625AbcADO2V (ORCPT ); Mon, 4 Jan 2016 09:28:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52989 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbcADO2T (ORCPT ); Mon, 4 Jan 2016 09:28:19 -0500 From: Vitaly Kuznetsov To: David Vrabel Cc: , , , , Jonathan Corbet , "Greg Kroah-Hartman" , Daniel Kiper , Dan Williams , Tang Chen , David Rientjes , "Andrew Morton" , Naoya Horiguchi , Xishi Qiu , Mel Gorman , "K. Y. Srinivasan" , "Igor Mammedov" , Kay Sievers , "Konrad Rzeszutek Wilk" , Boris Ostrovsky Subject: Re: [PATCH v2] memory-hotplug: add automatic onlining policy for the newly added memory References: <1450801950-7744-1-git-send-email-vkuznets@redhat.com> <568A560A.80906@citrix.com> Date: Mon, 04 Jan 2016 15:28:12 +0100 In-Reply-To: <568A560A.80906@citrix.com> (David Vrabel's message of "Mon, 4 Jan 2016 11:22:50 +0000") Message-ID: <871t9xto5f.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Vrabel writes: > On 22/12/15 16:32, Vitaly Kuznetsov wrote: >> @@ -1292,6 +1304,11 @@ int __ref add_memory_resource(int nid, struct resource *res) >> /* create new memmap entry */ >> firmware_map_add_hotplug(start, start + size, "System RAM"); >> >> + /* online pages if requested */ >> + if (online) >> + online_pages(start >> PAGE_SHIFT, size >> PAGE_SHIFT, >> + MMOP_ONLINE_KEEP); > > This will cause the Xen balloon driver to deadlock because it calls > add_memory_resource() with the balloon_mutex locked and the online page > callback also locks the balloon_mutex. Currently xen ballon driver always calls add_memory_resource() with online=false so this won't happen. -- Vitaly