Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1907341imm; Sat, 23 Jun 2018 05:23:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI7j6U/HXCFXfRJIQNNE1BLFSareBmnknsIUns9/fwLppC5emgEVJnPtV0KDSbkwd9ww4hw X-Received: by 2002:a63:714c:: with SMTP id b12-v6mr4692894pgn.420.1529756599321; Sat, 23 Jun 2018 05:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529756599; cv=none; d=google.com; s=arc-20160816; b=hkrMv8jNFZwfW4PSih8mThnYP7pxKLXT1WhPGIHGKJRlSyh0cKG7PkQdyulxtykSnF dgAxzD2wZ/uue0EmLA7EArBxbPWuMfMfw+nwbiEvPd/TSySNWWxEWbWpSEDUWd0VrDff Iqi1NI1Mz+TGF//79QhE1t5o9Ed3NKSUscKgZk0dVHyGOFT3tc7lbcwaWloVZg1fx6xN pbKVG/GyMn5tujKzu21Gfu9XlmOBjKBDp4nVYJLL/iE2LOx6SFHNNddGmM/hqL4bMMzr alYhZ86EA1exlefyqMrpiLSBQB3qPnRR2BTN8g8DOn/Kb7mkyX9mp54YAcappMgFbKIz roKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=e3m7pyEmxH/ZxgRt2MxQb3aH6qgSPgU4VKyKGG/JT1g=; b=EWnYP5omKfZEDSRKUKzoH29ZFt/6q/0mFXxIxMy4ZX36lSpg8IbkB/fsMH3cJHxgBQ RNgX3bADh9e+LMWhJDN/pcZNVqOiomLbFpqvNMukRGK0AGDQilfJ93Sd941KIw8YgA80 DM17KHksqwkLo4DaQehuMnle/z2J4NyVh3yWS1xHbpSLNsIZcT7UMDqDHCmG6l54P3YZ zhZu5zs29kW2/5f9brgtXSPCdoDSiHyOXYCUMxki+vheGqisBFmsFoyk+qyJ7asNO+qn U9KDQl1dXcQZOCldIc93blxKCGlNnG15oZOVYwWleSvAYwfrae7+nVoCV9cHYSTe/Wu+ 178Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6-v6si7840502pga.622.2018.06.23.05.23.05; Sat, 23 Jun 2018 05:23:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752182AbeFWMVL (ORCPT + 99 others); Sat, 23 Jun 2018 08:21:11 -0400 Received: from terminus.zytor.com ([198.137.202.136]:45563 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751654AbeFWMVK (ORCPT ); Sat, 23 Jun 2018 08:21:10 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5NCL5Bt465224 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 23 Jun 2018 05:21:05 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5NCL5Mi465221; Sat, 23 Jun 2018 05:21:05 -0700 Date: Sat, 23 Jun 2018 05:21:05 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Reinette Chatre Message-ID: Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, reinette.chatre@intel.com Reply-To: reinette.chatre@intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cache] x86/intel_rdt: Split resource group removal in two Git-Commit-ID: 17eafd076291ed23eeb17b28132fa33b0688bc57 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 17eafd076291ed23eeb17b28132fa33b0688bc57 Gitweb: https://git.kernel.org/tip/17eafd076291ed23eeb17b28132fa33b0688bc57 Author: Reinette Chatre AuthorDate: Fri, 22 Jun 2018 15:42:18 -0700 Committer: Thomas Gleixner CommitDate: Sat, 23 Jun 2018 13:03:48 +0200 x86/intel_rdt: Split resource group removal in two Resource groups used for pseudo-locking do not require the same work on removal as the other resource groups. The resource group removal is split in two in preparation for support of pseudo-locking resource groups. A single re-ordering occurs - the setting of the rdtgrp flag is moved to later. This flag is not used by any of the code between its original and new location. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/c8cbf7a7c72480b39bb946a929dbae96c0f9aca1.1529706536.git.reinette.chatre@intel.com --- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index bd4e2de303dc..526cd4a97054 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -2620,6 +2620,21 @@ static int rdtgroup_rmdir_mon(struct kernfs_node *kn, struct rdtgroup *rdtgrp, return 0; } +static int rdtgroup_ctrl_remove(struct kernfs_node *kn, + struct rdtgroup *rdtgrp) +{ + rdtgrp->flags = RDT_DELETED; + list_del(&rdtgrp->rdtgroup_list); + + /* + * one extra hold on this, will drop when we kfree(rdtgrp) + * in rdtgroup_kn_unlock() + */ + kernfs_get(kn); + kernfs_remove(rdtgrp->kn); + return 0; +} + static int rdtgroup_rmdir_ctrl(struct kernfs_node *kn, struct rdtgroup *rdtgrp, cpumask_var_t tmpmask) { @@ -2645,7 +2660,6 @@ static int rdtgroup_rmdir_ctrl(struct kernfs_node *kn, struct rdtgroup *rdtgrp, cpumask_or(tmpmask, tmpmask, &rdtgrp->cpu_mask); update_closid_rmid(tmpmask, NULL); - rdtgrp->flags = RDT_DELETED; closid_free(rdtgrp->closid); free_rmid(rdtgrp->mon.rmid); @@ -2654,14 +2668,7 @@ static int rdtgroup_rmdir_ctrl(struct kernfs_node *kn, struct rdtgroup *rdtgrp, */ free_all_child_rdtgrp(rdtgrp); - list_del(&rdtgrp->rdtgroup_list); - - /* - * one extra hold on this, will drop when we kfree(rdtgrp) - * in rdtgroup_kn_unlock() - */ - kernfs_get(kn); - kernfs_remove(rdtgrp->kn); + rdtgroup_ctrl_remove(kn, rdtgrp); return 0; }