Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932961AbbLRQx2 (ORCPT ); Fri, 18 Dec 2015 11:53:28 -0500 Received: from smtp.citrix.com ([66.165.176.89]:23065 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754004AbbLRQx0 (ORCPT ); Fri, 18 Dec 2015 11:53:26 -0500 X-IronPort-AV: E=Sophos;i="5.20,447,1444694400"; d="scan'208";a="320329885" Message-ID: <56743A00.4020503@citrix.com> Date: Fri, 18 Dec 2015 16:53:20 +0000 From: David Vrabel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Vitaly Kuznetsov , 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 Subject: Re: [PATCH] memory-hotplug: add automatic onlining policy for the newly added memory References: <1450457155-31234-1-git-send-email-vkuznets@redhat.com> In-Reply-To: <1450457155-31234-1-git-send-email-vkuznets@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1691 Lines: 35 On 18/12/15 16:45, Vitaly Kuznetsov wrote: > Currently, all newly added memory blocks remain in 'offline' state unless > someone onlines them, some linux distributions carry special udev rules > like: > > SUBSYSTEM=="memory", ACTION=="add", ATTR{state}=="offline", ATTR{state}="online" > > to make this happen automatically. This is not a great solution for virtual > machines where memory hotplug is being used to address high memory pressure > situations as such onlining is slow and a userspace process doing this > (udev) has a chance of being killed by the OOM killer as it will probably > require to allocate some memory. > > Introduce default policy for the newly added memory blocks in > /sys/devices/system/memory/hotplug_autoonline file with two possible > values: "offline" which preserves the current behavior and "online" which > causes all newly added memory blocks to go online as soon as they're added. > The default is "online" when MEMORY_HOTPLUG_AUTOONLINE kernel config option > is selected. FWIW, I'd prefer it if the caller of add_memory_resource() could specify that it wants the new memory automatically onlined. I'm not sure just having one knob is appropriate -- there are different sorts of memory that can be added. e,g., in the Xen balloon driver we use the memory add infrastructure to add empty pages (pages with no machine pages backing them) for mapping things into, as well as adding regular pages. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/