From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964878AbbESP7a (ORCPT ); Tue, 19 May 2015 11:59:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39405 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964842AbbESP72 (ORCPT ); Tue, 19 May 2015 11:59:28 -0400 From: Vitaly Kuznetsov To: Peter Zijlstra Cc: devel@linuxdriverproject.org, "K. Y. Srinivasan" , Haiyang Zhang , linux-kernel@vger.kernel.org, Dexuan Cui , Ingo Molnar , "Paul E. McKenney" , "Rafael J. Wysocki" , Thomas Gleixner , Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 1/2] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable References: <1432037742-25923-1-git-send-email-vkuznets@redhat.com> <1432037742-25923-2-git-send-email-vkuznets@redhat.com> <20150519151939.GG3644@twins.programming.kicks-ass.net> Date: Tue, 19 May 2015 17:58:47 +0200 In-Reply-To: <20150519151939.GG3644@twins.programming.kicks-ass.net> (Peter Zijlstra's message of "Tue, 19 May 2015 17:19:39 +0200") Message-ID: <87vbfo4kzs.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (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 Peter Zijlstra writes: > On Tue, May 19, 2015 at 02:15:41PM +0200, Vitaly Kuznetsov wrote: >> Loaded Hyper-V module will use these functions to disable CPU hotplug >> under certain circumstances. > > What's wrong with get_online_cpus() ? We need to disable cpu offlining permanently (till the module is unloaded but this is highly unlikely). If we do get_online_cpus() instead we get # echo 0 > /sys/devices/system/cpu/cpu1/online [ 240.247109] INFO: task bash:972 blocked for more than 120 seconds. [ 240.248937] Not tainted 4.1.0-rc3_bug1167380_test_rkr+ #602 [ 240.250515] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 240.252379] bash D ffff880021b83c18 0 972 939 0x00000004 [ 240.255068] ffff880021b83c18 0000000000000001 0000000000000046 ffff880021b83be8 [ 240.258140] ffffffff81fdcdb0 ffff880037dbcfc0 ffff880037203bd0 ffffffff81fdcdb8 [ 240.261275] ffff880021b84000 0000000000000001 0000000000000000 0000000000000001 [ 240.264402] Call Trace: [ 240.265423] [] schedule+0x37/0x90 [ 240.266748] [] cpu_hotplug_begin+0xd2/0xe0 [ 240.268210] [] ? cpu_hotplug_begin+0x5/0xe0 [ 240.269675] [] ? prepare_to_wait_event+0xf0/0xf0 [ 240.271285] [] _cpu_down+0x8a/0x300 [ 240.275294] [] cpu_down+0x36/0x50 [ 240.276680] [] cpu_subsys_offline+0x14/0x20 [ 240.278145] [] device_offline+0xa5/0xd0 [ 240.279618] [] online_store+0x50/0xa0 [ 240.280991] [] dev_attr_store+0x18/0x30 ... And if we do the cpu_hotplug_disable() call we get: # echo 0 > /sys/devices/system/cpu/cpu1/online -bash: echo: write error: Device or resource busy This behavior is preferable. -- Vitaly