Received: by 10.223.185.116 with SMTP id b49csp27287wrg; Tue, 13 Feb 2018 15:54:22 -0800 (PST) X-Google-Smtp-Source: AH8x224WCv9PpufTuSn85IFWw6iLfCOsuXKouv2o3LvDKvZnOcelDGQm7OQJDbHnXnYE8Juzm4ur X-Received: by 2002:a17:902:2803:: with SMTP id e3-v6mr2557713plb.447.1518566061925; Tue, 13 Feb 2018 15:54:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518566061; cv=none; d=google.com; s=arc-20160816; b=UP6uzB8wY0KXLZ1+tCiUhMEJuYf5WB1lpGHp+m4bfW1QmtJszPeAemioBT6U0Ty37r 6EcajeW6jG/H7v1qF8kkFwrAD9taqecVbiIhWB8LS1LzZZalZZ0XIPb24qT7Hfj094qh 1SYeQgzWFdlIag/j7zABp+kPDPaAYOBLGw8Y5bHqY0SCg6sD18ofWhXILMgrcHdvG71j rLs3/xC+gnPIJIGMoX2YgH9vzEcJ1dm5K7ZWID45sOyxOUOM292KznZw+qA6y1OyTmRJ xX1tjwJCzd18kYlww5uya1wC/YgA5bRKpH9lcT0lBWfUaCPYMpbZTU8yUL9NAIUNtvCm J16g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=VJAGGQTPm2fGu5ZrrpoIBPPMQPVX4XTWAWv1xxTL7mg=; b=fkGHfSgvVhRTvpIiBwAleHWF8km6VapuCaCUIpeZ/OyX71iIelDaU2puGIgLBLQMB3 DzCLINPHPENVeaGCGzkDjTlJUR/Y1JuivU7ox8v8ZRciIkQwaZuN+byhM8job3Sc7mdj J+43PXjGlle9i96bQU9BY7AU9jeHG7KQVtQ0Sv2c5auDaI6lKXAfyhLnvx2l+eJ3oFlQ J9phWfX8p4UFHwsZm+m/5cewftJg8YV098ug37YxGibR++rFMkrMtN/zo9v1TNY0XF86 kioxXVysIdWlStQ7qqMulK7MYKe7vJ0ZskccDojU2nF8C3sBe/sF+Sq8KEN/Ys6lP6yO TZwg== 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 1-v6si8123114plx.93.2018.02.13.15.54.07; Tue, 13 Feb 2018 15:54:21 -0800 (PST) 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 S966375AbeBMXwq (ORCPT + 99 others); Tue, 13 Feb 2018 18:52:46 -0500 Received: from mga17.intel.com ([192.55.52.151]:53394 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966179AbeBMXtf (ORCPT ); Tue, 13 Feb 2018 18:49:35 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2018 15:49:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,509,1511856000"; d="scan'208";a="29822317" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by fmsmga004.fm.intel.com with ESMTP; 13 Feb 2018 15:49:34 -0800 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com Cc: gavin.hindman@intel.com, vikas.shivappa@linux.intel.com, dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre Subject: [RFC PATCH V2 07/22] x86/intel_rdt: Connect pseudo-locking directory to operations Date: Tue, 13 Feb 2018 07:46:51 -0800 Message-Id: <98b002182bf81fb75346edcf80588ba85f35c74b.1518443616.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As a dependent of RDT/CAT we hook up the pseudo-locking files initialization to that of RDT/CAT. The initial operations of mkdir/rmdir used to create pseudo-locked regions are now hooked up also. Signed-off-by: Reinette Chatre --- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index 5698d66b6892..24d2def37797 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -1244,13 +1244,19 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type, goto out_cdp; } + ret = rdt_pseudo_lock_fs_init(rdtgroup_default.kn); + if (ret) { + dentry = ERR_PTR(ret); + goto out_info; + } + if (rdt_mon_capable) { ret = mongroup_create_dir(rdtgroup_default.kn, NULL, "mon_groups", &kn_mongrp); if (ret) { dentry = ERR_PTR(ret); - goto out_info; + goto out_psl; } kernfs_get(kn_mongrp); @@ -1291,6 +1297,8 @@ static struct dentry *rdt_mount(struct file_system_type *fs_type, out_mongrp: if (rdt_mon_capable) kernfs_remove(kn_mongrp); +out_psl: + rdt_pseudo_lock_fs_remove(); out_info: kernfs_remove(kn_info); out_cdp: @@ -1439,6 +1447,7 @@ static void rmdir_all_sub(void) /* Notify online CPUs to update per cpu storage and PQR_ASSOC MSR */ update_closid_rmid(cpu_online_mask, &rdtgroup_default); + rdt_pseudo_lock_fs_remove(); kernfs_remove(kn_info); kernfs_remove(kn_mongrp); kernfs_remove(kn_mondata); @@ -1861,6 +1870,9 @@ static int rdtgroup_mkdir(struct kernfs_node *parent_kn, const char *name, if (strchr(name, '\n')) return -EINVAL; + if (parent_kn == pseudo_lock_kn) + return rdt_pseudo_lock_mkdir(name, mode); + /* * If the parent directory is the root directory and RDT * allocation is supported, add a control and monitoring @@ -1970,6 +1982,9 @@ static int rdtgroup_rmdir(struct kernfs_node *kn) cpumask_var_t tmpmask; int ret = 0; + if (parent_kn == pseudo_lock_kn) + return rdt_pseudo_lock_rmdir(kn); + if (!zalloc_cpumask_var(&tmpmask, GFP_KERNEL)) return -ENOMEM; -- 2.13.6