From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932550AbcHXVez (ORCPT ); Wed, 24 Aug 2016 17:34:55 -0400 Received: from p3plsmtps2ded02.prod.phx3.secureserver.net ([208.109.80.59]:57682 "EHLO p3plsmtps2ded02.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756783AbcHXVef (ORCPT ); Wed, 24 Aug 2016 17:34:35 -0400 x-originating-ip: 72.167.245.219 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, alexng@microsoft.com Cc: "K. Y. Srinivasan" Subject: [PATCH 3/5] Drivers: hv: balloon: don't wait for ol_waitevent when memhp_auto_online is enabled Date: Wed, 24 Aug 2016 16:23:11 -0700 Message-Id: <1472080993-29694-3-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1472080993-29694-1-git-send-email-kys@exchange.microsoft.com> References: <1472080943-29654-1-git-send-email-kys@exchange.microsoft.com> <1472080993-29694-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfCxndSWBTwRrieDcvXLVZPLwXEqdrTWR/FRbpgSsSVnnL+r0Xb8NJxES3qf8uRElk92JoYr8LJp6CquTc0a3pLhrRtiXm/WCJHM44nKR9xEWkmRQtqhT 7bPfR64YPulBHX0FvgXB2NTktZcyeFc/Q8LzldhsTgr/JJArSA4aYMZbpP8gztYZD/GfXsTg81QXLETOM3pG1ievwOQ0jGK75hQEr5g1nqBnXZYXQH56e+ck vqZsyrNZmgO7z+Fiiu/xuZucMxap21mVDqQrZJS+fSdvpyoryvv6J1fMjCNU/SFh22ptf/yHngQ1dGnPwGcR4k68byiFhhiI4K6kSh942ZSzGvNpLAmN+wjH 5IO962SLYnPo3pPJH7aemgHVBnLlrcB+7ftV42HChGASeR7XLdRyquqVPHktm+RdGBtsL+HdmgLRlyEfJWkuFlgI0Q+ufdbu0x0C9DYv6OQ5lcN5AzkCzevq HBsAmY5EXldXxDBX Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Kuznetsov With the recently introduced in-kernel memory onlining (MEMORY_HOTPLUG_DEFAULT_ONLINE) these is no point in waiting for pages to come online in the driver and we can get rid of the waiting. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 18766f6..3441326 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -673,7 +673,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, has->covered_end_pfn += processed_pfn; init_completion(&dm_device.ol_waitevent); - dm_device.ha_waiting = true; + dm_device.ha_waiting = !memhp_auto_online; mutex_unlock(&dm_device.ha_region_mutex); nid = memory_add_physaddr_to_nid(PFN_PHYS(start_pfn)); @@ -699,12 +699,15 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, } /* - * Wait for the memory block to be onlined. - * Since the hot add has succeeded, it is ok to - * proceed even if the pages in the hot added region - * have not been "onlined" within the allowed time. + * Wait for the memory block to be onlined when memory onlining + * is done outside of kernel (memhp_auto_online). Since the hot + * add has succeeded, it is ok to proceed even if the pages in + * the hot added region have not been "onlined" within the + * allowed time. */ - wait_for_completion_timeout(&dm_device.ol_waitevent, 5*HZ); + if (dm_device.ha_waiting) + wait_for_completion_timeout(&dm_device.ol_waitevent, + 5*HZ); mutex_lock(&dm_device.ha_region_mutex); post_status(&dm_device); } -- 1.7.4.1