From: Chao Gao <chao.gao@intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
"Nakajima, Jun" <jun.nakajima@intel.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v2 1/5] xentrace: add TRC_HVM_PI_LIST_ADD
Date: Mon, 15 May 2017 16:57:16 +0800 [thread overview]
Message-ID: <20170515085714.GA7052@skl-2s3> (raw)
In-Reply-To: <AADFC41AFE54684AB9EE6CBC0274A5D190CD1634@SHSMSX101.ccr.corp.intel.com>
On Mon, May 15, 2017 at 09:33:04AM +0800, Tian, Kevin wrote:
>> From: Gao, Chao
>> Sent: Thursday, May 11, 2017 2:04 PM
>>
>> This patch adds TRC_HVM_PI_LIST_ADD to track adding one entry to
>> the per-pcpu blocking list. Also introduce a 'counter' to track
>> the number of entries in the list.
>>
>> Signed-off-by: Chao Gao <chao.gao@intel.com>
>> ---
>> @@ -119,6 +120,9 @@ static void vmx_vcpu_block(struct vcpu *v)
>> */
>> ASSERT(old_lock == NULL);
>>
>> + atomic_inc(&per_cpu(vmx_pi_blocking, v->processor).counter);
>> + HVMTRACE_4D(PI_LIST_ADD, v->domain->domain_id, v->vcpu_id, v-
>> >processor,
>> + atomic_read(&per_cpu(vmx_pi_blocking, v->processor).counter));
>> list_add_tail(&v->arch.hvm_vmx.pi_blocking.list,
>> &per_cpu(vmx_pi_blocking, v->processor).list);
>> spin_unlock_irqrestore(pi_blocking_list_lock, flags);
>> @@ -186,6 +190,8 @@ static void vmx_pi_unblock_vcpu(struct vcpu *v)
>> {
>> ASSERT(v->arch.hvm_vmx.pi_blocking.lock == pi_blocking_list_lock);
>> list_del(&v->arch.hvm_vmx.pi_blocking.list);
>> + atomic_dec(&container_of(pi_blocking_list_lock,
>> + struct vmx_pi_blocking_vcpu, lock)->counter);
>> v->arch.hvm_vmx.pi_blocking.lock = NULL;
>> }
>>
>> @@ -234,6 +240,7 @@ void vmx_pi_desc_fixup(unsigned int cpu)
>> if ( pi_test_on(&vmx->pi_desc) )
>> {
>> list_del(&vmx->pi_blocking.list);
>> + atomic_dec(&per_cpu(vmx_pi_blocking, cpu).counter);
>> vmx->pi_blocking.lock = NULL;
>> vcpu_unblock(container_of(vmx, struct vcpu, arch.hvm_vmx));
>> }
>> @@ -258,6 +265,8 @@ void vmx_pi_desc_fixup(unsigned int cpu)
>>
>> list_move(&vmx->pi_blocking.list,
>> &per_cpu(vmx_pi_blocking, new_cpu).list);
>> + atomic_dec(&per_cpu(vmx_pi_blocking, cpu).counter);
>> + atomic_inc(&per_cpu(vmx_pi_blocking, new_cpu).counter);
>
>Don't you also need a trace here?
Yes, it is needed.
>
>and from completeness p.o.v, is it useful to trace both dec/inc?
>
I tried to do this. Assuming the log should show which pcpu's list
has decreased, I don't know how to get the pcpu id in vmx_pi_unblock_vcpu(),
though we can reference the per-cpu structure.
Thanks
Chao
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-05-15 8:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-11 6:04 [PATCH v2 0/5] mitigate the per-pCPU blocking list may be too long Chao Gao
2017-05-11 6:04 ` [PATCH v2 1/5] xentrace: add TRC_HVM_PI_LIST_ADD Chao Gao
2017-05-15 1:33 ` Tian, Kevin
2017-05-15 8:57 ` Chao Gao [this message]
2017-05-15 15:14 ` George Dunlap
2017-05-11 6:04 ` [PATCH v2 2/5] vcpu: track hvm vcpu number on the system Chao Gao
2017-05-11 11:35 ` Wei Liu
2017-05-11 11:37 ` Wei Liu
2017-05-12 8:23 ` Chao Gao
2017-05-11 6:04 ` [PATCH v2 3/5] VT-d PI: restrict the vcpu number on a given pcpu Chao Gao
2017-05-15 5:24 ` Tian, Kevin
2017-05-15 9:27 ` Chao Gao
2017-05-15 15:48 ` George Dunlap
2017-05-15 16:13 ` Chao Gao
2017-05-11 6:04 ` [PATCH v2 4/5] VT-d PI: Adding reference count to pi_desc Chao Gao
2017-05-15 14:42 ` George Dunlap
2017-05-11 6:04 ` [PATCH v2 5/5] VT-d PI: Don't add vCPU to PI blocking list for a case Chao Gao
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=20170515085714.GA7052@skl-2s3 \
--to=chao.gao@intel.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=wei.liu2@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).