From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752948AbdKJPBP (ORCPT ); Fri, 10 Nov 2017 10:01:15 -0500 Received: from mga06.intel.com ([134.134.136.31]:4873 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752127AbdKJPBO (ORCPT ); Fri, 10 Nov 2017 10:01:14 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,374,1505804400"; d="scan'208";a="174353688" Date: Fri, 10 Nov 2017 07:01:12 -0800 From: Andi Kleen To: Prarit Bhargava Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Peter Zijlstra , Dave Hansen , Piotr Luc , Kan Liang , Borislav Petkov , Stephane Eranian , Arvind Yadav , Andy Lutomirski , Christian Borntraeger , "Kirill A. Shutemov" , Tom Lendacky , He Chen , Mathias Krause , Tim Chen , Vitaly Kuznetsov Subject: Re: [PATCH v5 2/3] x86/topology: Avoid wasting 128k for package id array Message-ID: <20171110150112.GI8522@tassilo.jf.intel.com> References: <20171105165428.32108-1-prarit@redhat.com> <20171105165428.32108-3-prarit@redhat.com> <372083ad-2a77-4646-bc67-dd4348a521d9@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <372083ad-2a77-4646-bc67-dd4348a521d9@redhat.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > All of that works. There is no way to make sure that a lookup is fully > > serialized against a concurrent update. Even if the lookup holds > > cpu_read_lock() the new package might arrive right after the unlock. > > > > Thanks Thomas. > > Andi, do you want to take a look at this? I was originally worried about races, that is why i tried to put everything into cpu_data. But that didn't work out because something clears it. Perhaps the right solution would be some extra per_cpu data variables, and search for the first match. I suspect that would be simpler. But if that doesn't work I guess something like Thomas' example will work. I assume you will handle it, Prarit? -Andi