xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: keir@xen.org, Ian.Campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, Ian.Jackson@eu.citrix.com,
	xen-devel@lists.xen.org, Dongxiao Xu <dongxiao.xu@intel.com>,
	dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v4 1/7] x86: detect and initialize Cache QoS Monitoring feature
Date: Tue, 3 Dec 2013 13:45:44 +0000	[thread overview]
Message-ID: <529DE088.7070507@citrix.com> (raw)
In-Reply-To: <529DE28302000078001095F1@nat28.tlf.novell.com>

On 03/12/13 12:54, Jan Beulich wrote:
>>>> On 03.12.13 at 12:46, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> This currently won't do what you expect, and to get regular Xen boolean
>> behaviour, you need tobe a little more cunning.
>>
>> Here is some completely untested code...
>>
>> static void __init parse_pqos_param(char *s)
>> {
>>     char *ss;
>>     char *val_str;
>>     int val;
>>
>>     do {
>>         val = !!strncmp(s, "no-", 3);
>>         if ( !val )
>>             s += 3;
>>
>>         ss = strchr(s, ',');
>>         if ( ss )
>>             *ss = '\0';
>>
>>         val_str = strchr(s, '=');
>>
>>         if ( !parse_bool(s) )
>>             opt_pqos = 0;
> This won't either - parse_bool() returns the boolean value, or
> negative if the input didn't match any of the boolean tokens.
>
> Also, while I realize that you likely took this from elsewhere, I
> think we should stop further propagation of bad things (like
> allowing "pqos=no-true" or "pqos=no-cqm=on").
>
> And using = for both the top level separator and the sub-option
> ones looks odd to me generally too. I'd suggest using : instead.
>
> Jan
>

Hmm yes - perhaps that would be better, and more in line with the
current options such as dom0_mem

So something like this?

static void __init parse_pqos_param(char *s)
{
    char *ss, *val_str;
    int val;

    do {
        val = !!strncmp(s, "no-", 3);
        if ( !val )
            s += 3;

        ss = strchr(s, ',');
        if ( ss )
            *ss = '\0';

        val_str = strchr(s, ':');

        if ( !parse_bool(s) )
            opt_pqos = 0;
        else if ( !strcmp(s, "cqm") )
            opt_cqm = val;
        else if ( val_str && !strcmp(s, "cqm_max_rmid") )
            opt_cqm_max_rmid = simple_strtoul(val_str, NULL, 0);

        s = ss + 1;
    } while ( ss );
}

~Andrew

  reply	other threads:[~2013-12-03 13:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  8:47 [PATCH v4 0/7] enable Cache QoS Monitoring (CQM) feature Dongxiao Xu
2013-12-03  8:47 ` [PATCH v4 1/7] x86: detect and initialize Cache QoS Monitoring feature Dongxiao Xu
2013-12-03 11:46   ` Andrew Cooper
2013-12-03 12:54     ` Jan Beulich
2013-12-03 13:45       ` Andrew Cooper [this message]
2013-12-03 14:01         ` Jan Beulich
2013-12-03 20:32   ` Konrad Rzeszutek Wilk
2013-12-04 11:37     ` Ian Jackson
2013-12-03  8:47 ` [PATCH v4 2/7] x86: dynamically attach/detach CQM service for a guest Dongxiao Xu
2013-12-03  8:47 ` [PATCH v4 3/7] x86: initialize per socket cpu map Dongxiao Xu
2013-12-03  9:56   ` Dario Faggioli
2013-12-03  8:47 ` [PATCH v4 4/7] x86: collect CQM information from all sockets Dongxiao Xu
2013-12-03 11:52   ` Andrew Cooper
2013-12-03  8:47 ` [PATCH v4 5/7] x86: enable CQM monitoring for each domain RMID Dongxiao Xu
2013-12-03  8:47 ` [PATCH v4 6/7] xsm: add platform QoS related xsm policies Dongxiao Xu
2013-12-03 13:53   ` Daniel De Graaf
2013-12-03  8:47 ` [PATCH v4 7/7] tools: enable Cache QoS Monitoring feature for libxl/libxc Dongxiao Xu
2013-12-03 12:17   ` Dario Faggioli
2013-12-04  2:44     ` Xu, Dongxiao
2013-12-04  8:14       ` Dario Faggioli

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=529DE088.7070507@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=dongxiao.xu@intel.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.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).