From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034022AbcIZL5e (ORCPT ); Mon, 26 Sep 2016 07:57:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:54841 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030356AbcIZL5c (ORCPT ); Mon, 26 Sep 2016 07:57:32 -0400 Date: Mon, 26 Sep 2016 13:57:29 +0200 From: Borislav Petkov To: Prarit Bhargava Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Greg Kroah-Hartman , Peter Zijlstra , Len Brown , Andi Kleen , Jiri Olsa , Juergen Gross Subject: Re: [PATCH 0/2 v3] cpu hotplug: Preserve topology directory after soft remove event Message-ID: <20160926115728.sdnvjaz3ty6xpsvr@pd.tnic> References: <1474457973-19536-1-git-send-email-prarit@redhat.com> <20160921130428.2e7bprll64vs6h2r@pd.tnic> <57E28BFF.8060107@redhat.com> <20160921140135.i5emid4qno2o6cre@pd.tnic> <57E3C78C.5040400@redhat.com> <20160922121039.l6lnhb53os2af27x@pd.tnic> <57E90A61.60402@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <57E90A61.60402@redhat.com> User-Agent: NeoMutt/ (1.7.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 26, 2016 at 07:45:37AM -0400, Prarit Bhargava wrote: > When offline, /sys/devices/system/cpuX/cpu/online is 0. The problem is that > when online is 0, topology disappears so there is no way to determine _the > location_ of the offline'd thread. What does "the location" mean exactly? > cpupower should still print out all asterisks for down'd threads. It does not > because the topology directory is incorrectly removed. > > IOW how does userspace know the _location_ of the thread? The topology > directory no longer exists when the thread is downed, so core_id and > physical_package_id (both of which would be effectively static) do not exist. > The whole point of this patchset is to know where the offline'd thread actually is. What do you mean "where"? $ echo 0 > /sys/devices/system/cpu/cpu2/online $ cat /sys/devices/system/cpu/online 0-1,3-7 So core 2 is right between 1 and 3. If you need to show the package id, you still iterate over the core numbers in an increasing order and show '*' for the offlined ones. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --