All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: xen/arm: Domain not fully destroyed when using credit2
Date: Wed, 25 Jan 2017 12:38:06 +0000	[thread overview]
Message-ID: <0c19de52-e7f5-b97a-ec31-41b4284add32@arm.com> (raw)
In-Reply-To: <1485342610.32103.96.camel@citrix.com>

Hi Dario,

On 25/01/17 11:10, Dario Faggioli wrote:
> On Tue, 2017-01-24 at 15:06 +0000, Julien Grall wrote:
>> On 24/01/17 14:16, Dario Faggioli wrote:
>>> There, we have tracing (BTW, did that made it to ARM eventually?)
>>> and
>>> there's TRC_PM_IDLE_ENTRY/EXIT which do pretty much the same of
>>> your
>>> printk-s.
>>
>> There is patch on the ML for xentrace support (see [1]) but nothing
>> has
>> been upstreamed yet. Waiting for a new version from the contributor.
>>
> Yep, that was I was remembering, and referring to. Thanks for the
> update.
>
>>> And if I look at it, I do see even totally idle (from the scheduler
>>> point of view) pCPUs, I indeed see them going back and forth from
>>> and
>>> to C3.
>>
>> My knowledge on x86 is limited. When does a CPU decides to leave the
>> idle mode?
>>
> I'm not an expert of that part either. Jan and Andrew for sure know
> best how monitor/mwait works (both in general, and our own
> implementation).
>
> What I know (and can quickly infer from glancing at the code), is that
> timers are certainly involved.
>
> In fact, we wake up when the most imminent timer would expire (see
> mwait_idle_with_hints()), and a timer set by the scheduler fully
> qualifies as being the one (if it's the most imminent).
>
> My point was that, still from scheduling perspective, neither Credit1
> nor Credit2 sets a wakeup timer for idle pCPUs.
>
> Well, in Credit1, the master_ticker timer is never stopped (while,
> e.g., the per-pCPU tick is stopped before entering deep sleep,
> via sched_tick_suspend(), see commit 964fae8ac), but that's only 1
> pCPU.

The function sched_tick_suspend is never called on ARM. The power saving 
in Xen ARM is still very limited and this would need to be updated in 
the future.

So I guess that's why I still see interrupt coming on the idle pCPU when 
credit1 is used. Looking at credit2, the callback tick_suspend is not 
called. Does it mean there is no per-pCPU timer?

Now, from my understanding, if we decide to call sched_tick_suspend on 
ARM before idling. We will likely have the same problem with credit1 
because there is no more interrupt to wake-up the pCPU.

But I don't think this is an issue in the scheduler. IHMO, the problem 
is in the RCU. Indeed a CPU in lower power mode (i.e  wfi on ARM or 
pm_idle on x86 is been executed) will never get out to tell to the RCU : 
"I am quiet, go ahead". So the RCU will never be able to reclaim the 
memory and will result on a memory exhaustion if the pCPU never receive 
an interrupt (this could happen if pCPU has never ran a guest).

The question now, is how to fix it?

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-01-25 12:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 19:42 xen/arm: Domain not fully destroyed when using credit2 Julien Grall
2017-01-24  0:16 ` Stefano Stabellini
2017-01-24 12:52   ` Julien Grall
2017-01-24  8:20 ` Jan Beulich
2017-01-24 10:50   ` Julien Grall
2017-01-24 11:02     ` Jan Beulich
2017-01-24 12:30       ` Julien Grall
2017-01-24 12:53     ` Dario Faggioli
2017-01-24 13:04       ` Julien Grall
2017-01-24 13:05         ` Julien Grall
2017-01-24 13:19         ` Dario Faggioli
2017-01-24 13:24           ` Julien Grall
2017-01-24 13:40             ` Dario Faggioli
2017-01-24 13:49               ` Julien Grall
2017-01-24 14:16                 ` Dario Faggioli
2017-01-24 15:06                   ` Julien Grall
2017-01-25 11:10                     ` Dario Faggioli
2017-01-25 12:38                       ` Julien Grall [this message]
2017-01-25 12:40                         ` Andrew Cooper
2017-01-25 14:23                           ` Julien Grall
2017-01-25 16:00                         ` Dario Faggioli
2017-01-31 16:30                           ` Julien Grall
2017-01-31 22:10                             ` Stefano Stabellini
2017-02-01 18:21                             ` Wei Liu
2017-02-02 11:22                               ` Jan Beulich
2017-02-02 11:53                                 ` Wei Liu
2017-02-02 12:18                                   ` Julien Grall
2017-02-02 12:51                                     ` Dario Faggioli
2017-02-02 13:26                                       ` Julien Grall
2017-02-02 13:32                                         ` Dario Faggioli
2017-03-28 18:30                                           ` Julien Grall
2017-03-30  7:38                                             ` Dario Faggioli
2017-02-02 12:01                                 ` 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=0c19de52-e7f5-b97a-ec31-41b4284add32@arm.com \
    --to=julien.grall@arm.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.