Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752605AbdHNVPp (ORCPT ); Mon, 14 Aug 2017 17:15:45 -0400 Received: from mga04.intel.com ([192.55.52.120]:2436 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752275AbdHNVPn (ORCPT ); Mon, 14 Aug 2017 17:15:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,374,1498546800"; d="scan'208";a="1162564913" Date: Mon, 14 Aug 2017 14:17:42 -0700 (PDT) From: Shivappa Vikas X-X-Sender: vikas@vshiva-Udesk To: Shivappa Vikas cc: Thomas Gleixner , Vikas Shivappa , x86@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, ravi.v.shankar@intel.com, tony.luck@intel.com, fenghua.yu@intel.com, eranian@google.com, davidcc@google.com, ak@linux.intel.com, sai.praneeth.prakhya@intel.com Subject: Re: [PATCH 3/3] x86/intel_rdt/cqm: Improve limbo list processing In-Reply-To: Message-ID: References: <1502304395-7166-1-git-send-email-vikas.shivappa@linux.intel.com> <1502304395-7166-4-git-send-email-vikas.shivappa@linux.intel.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1496 Lines: 46 On Mon, 14 Aug 2017, Shivappa Vikas wrote: > > > On Mon, 14 Aug 2017, Thomas Gleixner wrote: > >> On Wed, 9 Aug 2017, Vikas Shivappa wrote: >> >>> @@ -426,6 +426,9 @@ static int domain_setup_mon_state(struct rdt_resource >>> *r, struct rdt_domain *d) >>> GFP_KERNEL); >>> if (!d->rmid_busy_llc) >>> return -ENOMEM; >>> + INIT_DELAYED_WORK(&d->cqm_limbo, cqm_handle_limbo); >>> + if (has_busy_rmid(r, d)) >>> + cqm_setup_limbo_handler(d); >> >> This is beyond silly. d->rmid_busy_llc is allocated a few lines above. How >> would a bit be set here? > > If we logically offline all cpus in a package and bring it back, the worker > needs to be scheduled on the package if there were busy RMIDs on this > package. Otherwise that RMID never gets freed as its rmid->busy stays 1.. > > I needed to scan the limbo list and set the bits for all limbo RMIDs after > the alloc and before doing the 'has_busy_rmid' check. Will fix Tony pointed out that there is no guarentee that a domain will come back up once its down, so the above issue of rmid->busy staying at > 0 can still happen. So I will delete this - if (has_busy_rmid(r, d)) cqm_setup_limbo_handler(d); and add this when a domain is powered down - for each rmid in d->rmid_busy_llc if (--entry->busy) free_rmid(rmid); We have no way to know if the L3 was indeed flushed (or package was powered off). This may lead to incorrect counts in rare scenarios but can document the same. Thanks, vikas