From: Yi Sun <yi.y.sun@linux.intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
xen-devel@lists.xenproject.org, "Wei Liu" <wei.liu2@citrix.com>,
"Chao Peng" <chao.p.peng@linux.intel.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v8 08/16] x86: implement set value flow for MBA
Date: Tue, 17 Oct 2017 09:14:01 +0800 [thread overview]
Message-ID: <20171017011401.GT11006@yi.y.sun> (raw)
In-Reply-To: <59E4C70D0200007800186B70@prv-mh.provo.novell.com>
On 17-10-16 06:49:49, Jan Beulich wrote:
> >>> On 16.10.17 at 05:04, <yi.y.sun@linux.intel.com> wrote:
> > This patch implements set value flow for MBA including its callback
> > function and domctl interface.
> >
> > Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>
> > v8:
> > - restore some unnecessary changes in 'cat_check_cbm'.
> > (suggested by Jan Beulich)
>
> This reads as if you did exactly the opposite thing of what you
> actually did.
>
> > +static bool mba_sanitize_thrtl(const struct feat_node *feat, uint32_t *thrtl)
> > +{
> > + if ( *thrtl > feat->mba.thrtl_max )
> > + return false;
>
> Wouldn't it be better to do this check after ...
>
> > + /*
> > + * Per SDM (chapter "Memory Bandwidth Allocation Configuration"):
> > + * 1. Linear mode: In the linear mode the input precision is defined
> > + * as 100-(MBA_MAX). For instance, if the MBA_MAX value is 90, the
> > + * input precision is 10%. Values not an even multiple of the
> > + * precision (e.g., 12%) will be rounded down (e.g., to 10% delay
> > + * applied).
> > + * 2. Non-linear mode: Input delay values are powers-of-two from zero
> > + * to the MBA_MAX value from CPUID. In this case any values not a
> > + * power of two will be rounded down the next nearest power of two.
> > + */
> > + if ( feat->mba.linear )
> > + *thrtl -= *thrtl % (100 - feat->mba.thrtl_max);
> > + else
> > + {
> > + /* Not power of 2. */
> > + if ( *thrtl & (*thrtl - 1) )
> > + *thrtl = 1 << (fls(*thrtl) - 1);
> > + }
>
> ... these adjustments? That way someone specifying e.g. a linear
> value of 95% would get 90% just like for 85% (s)he would get
> 80%.
>
> > + return true;
>
> If so, the return statement could simply become
>
> return *thrtl <= feat->mba.thrtl_max;
>
> My R-b also applies if you decide to make this change.
>
Thank you for the suggestion! It is not worthy to send whole patch set out.
I will just update this patch.
> Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-10-17 1:15 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-16 3:04 [PATCH v8 00/16] Enable Memory Bandwidth Allocation in Xen Yi Sun
2017-10-16 3:04 ` [PATCH v8 01/16] docs: create Memory Bandwidth Allocation (MBA) feature document Yi Sun
2017-10-16 3:04 ` [PATCH v8 02/16] Rename PSR sysctl/domctl interfaces and xsm policy to make them be general Yi Sun
2017-10-18 14:14 ` Jan Beulich
2017-10-18 14:58 ` Wei Liu
2017-10-19 1:22 ` [PATCH v9 " Yi Sun
2017-10-19 11:36 ` Jan Beulich
2017-10-19 12:01 ` Yi Sun
2017-10-16 3:04 ` [PATCH v8 03/16] x86: rename 'cbm_type' to 'psr_type' to make it general Yi Sun
2017-10-16 3:04 ` [PATCH v8 04/16] x86: a few optimizations to psr codes Yi Sun
2017-10-16 3:04 ` [PATCH v8 05/16] x86: implement data structure and CPU init flow for MBA Yi Sun
2017-10-16 3:04 ` [PATCH v8 06/16] x86: implement get hw info " Yi Sun
2017-10-16 3:04 ` [PATCH v8 07/16] x86: implement get value interface " Yi Sun
2017-10-16 3:04 ` [PATCH v8 08/16] x86: implement set value flow " Yi Sun
2017-10-16 12:49 ` Jan Beulich
2017-10-17 1:14 ` Yi Sun [this message]
2017-10-17 1:04 ` [PATCH v9 " Yi Sun
2017-10-17 1:27 ` Yi Sun
2017-10-17 1:05 ` [PATCH v9.1 " Yi Sun
2017-10-16 3:04 ` [PATCH v8 09/16] tools: create general interfaces to support psr allocation features Yi Sun
2017-10-16 3:04 ` [PATCH v8 10/16] tools: implement the new libxc get hw info interface Yi Sun
2017-10-16 3:04 ` [PATCH v8 11/16] tools: implement the new libxl " Yi Sun
2017-10-16 3:04 ` [PATCH v8 12/16] tools: implement the new xl " Yi Sun
2017-10-16 3:04 ` [PATCH v8 13/16] tools: rename 'xc_psr_cat_type' to 'xc_psr_type' Yi Sun
2017-10-16 3:04 ` [PATCH v8 14/16] tools: implement new generic get value interface and MBA get value command Yi Sun
2017-10-16 3:04 ` [PATCH v8 15/16] tools: implement new generic set value interface and MBA set " Yi Sun
2017-10-16 3:04 ` [PATCH v8 16/16] docs: add MBA description in docs Yi Sun
2017-10-19 20:08 ` [PATCH v8 00/16] Enable Memory Bandwidth Allocation in Xen Konrad Rzeszutek Wilk
2017-10-20 1:20 ` Yi Sun
2017-10-20 1:45 ` Yi Sun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171017011401.GT11006@yi.y.sun \
--to=yi.y.sun@linux.intel.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=chao.p.peng@linux.intel.com \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).