Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755477AbdCaSpu (ORCPT ); Fri, 31 Mar 2017 14:45:50 -0400 Received: from mga14.intel.com ([192.55.52.115]:53476 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752491AbdCaSps (ORCPT ); Fri, 31 Mar 2017 14:45:48 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,253,1486454400"; d="scan'208";a="1114102061" Date: Fri, 31 Mar 2017 11:45:52 -0700 (PDT) From: Shivappa Vikas X-X-Sender: vikas@vshiva-Udesk To: "Luck, Tony" cc: Thomas Gleixner , Vikas Shivappa , Fenghua Yu , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/intel_rdt: Implement "update" mode when writing schemata file In-Reply-To: <1490377918-30686-1-git-send-email-tony.luck@intel.com> Message-ID: References: <1490377918-30686-1-git-send-email-tony.luck@intel.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 891 Lines: 31 On Fri, 24 Mar 2017, Luck, Tony wrote: > +++ b/arch/x86/kernel/cpu/intel_rdt_schemata.c > @@ -56,7 +56,7 @@ static bool cbm_validate(unsigned long var, struct rdt_resource *r) > * Read one cache bit mask (hex). Check that it is valid for the current > * resource type. > */ > -static int parse_cbm(char *buf, struct rdt_resource *r) > +static int parse_cbm(char *buf, struct rdt_resource *r, struct rdt_domain *d) > { > unsigned long data; > int ret; > @@ -66,7 +66,8 @@ static int parse_cbm(char *buf, struct rdt_resource *r) > return ret; Would need a check here for repeated domain entries to error out something like: echo -e "L3:1=7f;1=7;1=7ff" | cat > /sys/fs/resctrl/p1/schemata if (d->have_newcbm) return -EINVAL; > if (!cbm_validate(data, r)) > return -EINVAL; > - r->tmp_cbms[r->num_tmp_cbms++] = data; > + d->new_cbm = data; > + d->have_new_cbm = true; >