Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1903005imm; Sat, 23 Jun 2018 05:17:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKwQm0QFgnbDUy1W7FlqVOC6XdGSwwEDXzan6+33Uiag9CwP4Nlyt4jCWSPm/J8oYXWGOPY X-Received: by 2002:a63:370f:: with SMTP id e15-v6mr4638288pga.192.1529756243365; Sat, 23 Jun 2018 05:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529756243; cv=none; d=google.com; s=arc-20160816; b=R7P/X7c5DD06Zwayjh9pvLhb0letwpx+pnsl6sfYJS6A1U6WEgKI9jBY9GPjc1wBRx DlLB7Cbj4nTEWfH0oQr/ipCrJ8CNKpxuWvTNPtcCH1f1s8cgzstVoSSQ51iB66F2xi/y bZAjlP8w/Qycis0VopGVhpfHuk09SiR9SDgwlPcppnXM16ZrlZ6vS+z8rn8PIap5q9W/ ERWNiNfbF42PoNo3TU8HghyQ4th4pCyWSijkuaCVJptWNKJmI894FWO86NEco5ueDyWh KMRTC0Tou22DBL4BQuTZ8vKULm/Cc7iUcvtLK14AbkThJXrVFaM+OYsPYLj9OmWjPBHE XSZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=pzvKDtTVwbOWq7xt9Z7FVk/k97Z6VgOTeHMWjSAbL4I=; b=byJ7X8z0tmz+lbq9byeJP45jlMLTg7pC/Id11VQ7M8xmBP3lTZAlvN+jAaM0o4LmsP OSxDJbt1JzHlQTsSORVlYSBsL9E/ETf2OHSv/Zou4JEs0vqAtL6UzcVAB0lnTgsd4yHT Rn8BgGCzxMwf7zRzdA6JeBXKENE+A1toNFLw25RRvKLE5gl7pP3pQdYxf4z4iCTefTum WpauLo8CiIPTdICmnsXKEpubbLKvt9lC3qKreyD+aOvCnTvzi2vv5ZIKMnA0v9VrLj1A FLxb2QGYnSOXLDWCAGVfK2T1pJLTGajwtr21P/ZE1Rg5ePt2tRtRuM0LiZuoX9/aBZ+B ynrg== 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 cc1-v6si1665625plb.458.2018.06.23.05.17.09; Sat, 23 Jun 2018 05:17:23 -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 S1752063AbeFWMQV (ORCPT + 99 others); Sat, 23 Jun 2018 08:16:21 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:43269 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbeFWMQS (ORCPT ); Sat, 23 Jun 2018 08:16:18 -0400 Received: from p4fea482e.dip0.t-ipconnect.de ([79.234.72.46] helo=nanos.glx-home) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fWhSY-0005Gx-3c; Sat, 23 Jun 2018 14:16:06 +0200 Date: Sat, 23 Jun 2018 14:16:05 +0200 (CEST) From: Thomas Gleixner To: Reinette Chatre cc: fenghua.yu@intel.com, Tony Luck , vikas.shivappa@linux.intel.com, gavin.hindman@intel.com, jithu.joseph@intel.com, dave.hansen@intel.com, mingo@redhat.com, "H. Peter Anvin" , x86@kernel.org, LKML , David Howells , Al Viro Subject: Re: [PATCH V7 00/41] Intel(R) Resource Director Technology Cache Pseudo-Locking enabling In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reinette! On Fri, 22 Jun 2018, Reinette Chatre wrote: > The Cache Pseudo-Locking enabling series that was recently merged to the > x86/cache branch of tip was found to conflict with the new kernfs support > for mounting with fs_context. > > In preparation for a conflict-free merge between the two repos some no-op > hooks are created within the RDT mount function being changed by > the two features. The goal is for this commit to be placed on a minimal > no-rebase branch to be consumed by both features. Thanks for doing this so quick! I've picked up the lot and slightly modified the first patch by moving the stubs to the header file to get them completely out of the conflicting area. The immutable branch for David to pull is: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git for-vfs I've also created a branch based on Davids mount-context branch, applied the cleanup patch below to it and merged the for-vfs branch on top. David feel free to pull the result from git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git for-vfs-merged or pick up the patch below and do the merge and conflict resolution yourself. The x86/cache branch is rebased and merges cleanly with for-vfs-merged. The last two patches are dropped; I folded them back to the patches they fix. git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/cache Reinette, can you please verify that x86/cache + for-vfs-merged are doing the right thing? Thanks, tglx 8<---------------------------- Subject: x86/intel_rdt: Mop up the fs_context conversion From: Thomas Gleixner Date: Sat, 23 Jun 2018 12:27:32 +0200 - Stick the struct into the local header file and not at some random place in the source. - Get rid of the fugly camel case - Move the enablement into a separate function Signed-off-by: Thomas Gleixner Cc: David Howells --- arch/x86/kernel/cpu/intel_rdt.h | 15 ++++++++ arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 54 ++++++++++++------------------- 2 files changed, 36 insertions(+), 33 deletions(-) --- a/arch/x86/kernel/cpu/intel_rdt.h +++ b/arch/x86/kernel/cpu/intel_rdt.h @@ -33,6 +33,21 @@ #define RMID_VAL_ERROR BIT_ULL(63) #define RMID_VAL_UNAVAIL BIT_ULL(62) + +struct rdt_fs_context { + struct kernfs_fs_context kfc; + bool enable_cdpl2; + bool enable_cdpl3; + bool enable_mba_mbps; +}; + +static inline struct rdt_fs_context *rdt_fc2context(struct fs_context *fc) +{ + struct kernfs_fs_context *kfc = fc->fs_private; + + return container_of(kfc, struct rdt_fs_context, kfc); +} + DECLARE_STATIC_KEY_FALSE(rdt_enable_key); /** --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -36,20 +36,6 @@ #include #include "intel_rdt.h" -struct rdt_fs_context { - struct kernfs_fs_context kfc; - bool enable_cdpl2; - bool enable_cdpl3; - bool enable_mba_MBps; -}; - -static inline struct rdt_fs_context *rdt_fc2context(struct fs_context *fc) -{ - struct kernfs_fs_context *kfc = fc->fs_private; - - return container_of(kfc, struct rdt_fs_context, kfc); -} - DEFINE_STATIC_KEY_FALSE(rdt_enable_key); DEFINE_STATIC_KEY_FALSE(rdt_mon_enable_key); DEFINE_STATIC_KEY_FALSE(rdt_alloc_enable_key); @@ -1213,6 +1199,22 @@ static int mkdir_mondata_all(struct kern struct rdtgroup *prgrp, struct kernfs_node **mon_data_kn); +static int rdt_enable_ctx(struct rdt_fs_context *ctx) +{ + int ret = 0; + + if (ctx->enable_cdpl2) + ret = cdpl2_enable(); + + if (!ret && ctx->enable_cdpl3) + ret = cdpl3_enable(); + + if (!ret && ctx->enable_mba_mbps) + ret = set_mba_sc(true); + + return ret; +} + static int rdt_get_tree(struct fs_context *fc) { struct rdt_fs_context *ctx = rdt_fc2context(fc); @@ -1230,24 +1232,10 @@ static int rdt_get_tree(struct fs_contex goto out; } - if (ctx->enable_cdpl2) { - ret = cdpl2_enable(); - if (ret < 0) - goto out_cdp; - } - - if (ctx->enable_cdpl3) { - ret = cdpl3_enable(); - if (ret < 0) - goto out_cdp; - } + ret = rdt_enable_ctx(ctx); + if (ret < 0) + goto out_cdp; - if (ctx->enable_mba_MBps) { - ret = set_mba_sc(true); - if (ret < 0) - goto out_cdp; - } - closid_init(); ret = rdtgroup_create_info_dir(rdtgroup_default.kn); @@ -1299,7 +1287,7 @@ static int rdt_get_tree(struct fs_contex out_info: kernfs_remove(kn_info); out_mba: - if (ctx->enable_mba_MBps) + if (ctx->enable_mba_mbps) set_mba_sc(false); out_cdp: cdp_disable_all(); @@ -1323,7 +1311,7 @@ static int rdt_parse_option(struct fs_co return 0; } if (strcmp(opt, "mba_MBps") == 0) { - ctx->enable_mba_MBps = true; + ctx->enable_mba_mbps = true; return 0; }