[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 4/5] x86/mwait-idle: disable IBRS during long idle


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 13 Oct 2022 15:10:17 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qDqh2Rf1Yz6c8xWjGs5H/0qgjIMDyFMeIaVeWoElRLM=; b=PsU7RSLiu56UPdBqd00GnL+4ukr5VLDAYdJ7j5sk4mkuNmqLtufCdN5OiRzYq2iLgT3Gh8Muc/ms3XfNSctPaNRFI26PVYvVJgnjFMV/PpiJHOrq1A43TXgnBjCp0KPN7DA+mTKodKfUK6D+wpsEb71s/ROifnonCIbAYtytF0f5ZbBptABGzUQ8hwuU48wjIkrpTGH3JZZuSwJvD2ApJJ9bqSXj12dCmG2BqcMQqWTHFMp1fMal8AkTfkdiLDGI7dt4q3E7DFeS51dQ48ihxgzhymKKDpDd3rrKc8B155sa17JqV3MExBublnikfjDxF+NAHZ7TaqajiJ5nR1J4+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dWiAuTw88XCfU2n1LVu3wtzR+AYv/SnFnjY7SKKdYd8YgClwLpGcneo6SjUNuGCiqZ+xR2TEdz5xsiaoCt7mQL6y3ro/x7EmDT7DzItfxYUzTgo8UQdCGjOo+3Y14esZTJyMhJEVj3BUlzHF/MBM+b/Y+MyOwpMuEbehLKt50ObYnEt0rm3FhE0Rr985OVm+6DUfl9JJXiG3n+v0hPVfCYsHqDI6CcSh5x8/P+18/+qQ+LmJeSwA/CVQBEmBJpp/b3BSvsYIfMiL0ofRo5SSNGGbVuE00KgI++8Io9W6KswiI8b74Fg01bEBfNat2yYtcyAS/tdWprun2RMkfOXgyw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 13 Oct 2022 13:10:35 +0000
  • Ironport-data: A9a23:NCrQgKM1Y1CrLefvrR2+lsFynXyQoLVcMsEvi/4bfWQNrUok0GMBy jQdWTiDM63eNzD3eo0jPoSw9xsO6p7Vm9BlQAto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6j+fQLlbFILasEjhrQgN5QzsWhxtmmuoo6qZlmtH8CA6W0 T/Ii5S31GSNhnglbwr414rZ8Ek15ayr42tB1rADTasjUGH2xiF94K03fcldH1OgKqFIE+izQ fr0zb3R1gs1KD90V7tJOp6iGqE7aua60Tqm0xK6aID76vR2nQQg075TCRYpQRw/ZwNlPTxG4 I4lWZSYEW/FN0BX8QgXe0Ew/ypWZcWq9FJbSJQWXAP6I0DuKhPRL/tS4E4ebLQ4y7h8CE910 +0/GG5ScheOpMDr6efuIgVsrpxLwMjDGqo64ysl5xeJSPEsTNbEXrnA4sJe0HEonMdSEP3CZ s0fLz1ycBDHZB4JMVASYH48tL7w2j+jLHsF9RTM+vRfD2v7lWSd1JD3N9XYYJqSTNh9lUeEv GPWuW/+B3n2MfTPlGParin33IcjmwvjAYEAFrSa/8RRkXuLz1UdODwVVkGk9KzRZkmWHog3x 1Yv0igkoLU29UerZsLgRBD+q3mB1jYMVtwVH+Ak5QWlzqvP/x3fFmUCViRGatEtqIkxXzNC/ kCNt8PkA3poqrL9dJ6G3rKdrDf3My5FK2YHPHUAVVFcvIelp5wvhBXSSNolCLSyktD+BTD3x XaNsTQ6gLIQy8UM0s1X4Gz6vt5lnbCRJiZd2+kddjnNAt9RDGJ9W7GV1A==
  • Ironport-hdrordr: A9a23:PwktUKwQc/WQeF7izleAKrPwKr1zdoMgy1knxilNoRw8SKOlfq eV7ZMmPH7P+U8ssR4b+OxoVJPsfZqYz+8W3WBzB8bHYOCFgguVxehZhOOIqQEIWReOk9K1vZ 0QFZSWY+efMbEVt6rHCXGDYrUd/OU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Oct 13, 2022 at 02:17:54PM +0200, Jan Beulich wrote:
> On 13.10.2022 14:03, Roger Pau Monné wrote:
> > On Thu, Aug 18, 2022 at 03:04:51PM +0200, Jan Beulich wrote:
> >> From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> >>
> >> Having IBRS enabled while the SMT sibling is idle unnecessarily slows
> >> down the running sibling. OTOH, disabling IBRS around idle takes two
> >> MSR writes, which will increase the idle latency.
> >>
> >> Therefore, only disable IBRS around deeper idle states. Shallow idle
> >> states are bounded by the tick in duration, since NOHZ is not allowed
> >> for them by virtue of their short target residency.
> >>
> >> Only do this for mwait-driven idle, since that keeps interrupts disabled
> >> across idle, which makes disabling IBRS vs IRQ-entry a non-issue.
> >>
> >> Note: C6 is a random threshold, most importantly C1 probably shouldn't
> >> disable IBRS, benchmarking needed.
> >>
> >> Suggested-by: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>
> >> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> >> Signed-off-by: Borislav Petkov <bp@xxxxxxx>
> >> Reviewed-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> >> Signed-off-by: Borislav Petkov <bp@xxxxxxx>
> >> Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> >> bf5835bcdb96
> >> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> > 
> > Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Thanks.
> 
> > One unrelated comment below.
> > [...]
> >> @@ -932,8 +939,6 @@ static void cf_check mwait_idle(void)
> >>                    pm_idle_save();
> >>            else
> >>            {
> >> -                  struct cpu_info *info = get_cpu_info();
> >> -
> >>                    spec_ctrl_enter_idle(info);
> >>                    safe_halt();
> >>                    spec_ctrl_exit_idle(info);
> > 
> > Do we need to disable speculation just for the hlt if there's no
> > C state change?
> > 
> > It would seem to me like the MSR writes could add a lot of latency
> > when there's no C state change.
> 
> HLT enters (at least) C1, so is a C-state change to me as well. Plus
> we may remain there for a while, and during that time we'd like to
> not unduly impact the other thread.

OK, but it's not a "deeper C state" as mentioned in the commit
message.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.