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

Re: [PATCH for-4.21 02/10] x86/HPET: disable unused channels


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 16 Oct 2025 18:31:15 +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=arcselector10001; 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=0LobABZ87hhmtMsqlRnIARfW8fgWpTdatDylMJpeNkQ=; b=xUj7kVaSvzYOKAJoZEGkZg/l1SSjZEPF2+JDPLJxqq+XMRpl2WRM0ouOnrc7e7QwaWdxm3YBk5HaW0iEpoloKxu+nq9j4HTz+6wPtbMCm+l/O7KXntD39ZZuFN+d57J0eteHmXtiNpE9HlMp/PxbHGSLgIIEAtnJtbKPujVKbbU2mOkfanrqbGOmE6XYulBrs0fg6cHsI9pzQmECHqTeaRYcCxRt3yNBY1TWtBfEWXZB52PlNJKwZDvk+qfhjMCAxLY3NGi1wX5TBGKPPhxcWKFzQjOZ3fG8dES+oJYKxjLHR15K7RqtlEQ4LtvGxooAv++6lS1kSwZIFJWxbCP7Eg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=es3pZMItNPEegeW4mSeR1oLEPrGZE67gTOF4RmQN3MXxw4/xF4pNirWt6ayROcnoPFlKQ6lQPIXx/j8ja4bhHm4nTWrnNIJbDrI7jc7LuXUiNUIXc1m+0joLuGKo8vVJ+wDEfGFewLHEdZ1op4CkOsrSXS54LOIqvN4+LQZ1OIehcOjesMZRAmhFYmzCcQ05VY1+2EkWy7yB/8LbDemuFmws/v6dBdFeInOGaEUrAFgBcgaMjzmMXE/Rz9sVtIV2dmxMKUNq6amznNsNo3FLaBbKJxR/rCU77eLFs19fgmofP4A8ALywRUYfV/IPjQnO7qIZzjM4fdZp1wE59w3dVw==
  • 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>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Thu, 16 Oct 2025 16:31:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Oct 16, 2025 at 09:31:42AM +0200, Jan Beulich wrote:
> Keeping channels enabled when they're unused is only causing problems:
> Extra interrupts harm performance, and extra nested interrupts could even
> have caused worse problems.
> 
> Note that no explicit "enable" is necessary - that's implicitly done by
> set_channel_irq_affinity() once the channel goes into use again.
> 
> Along with disabling the counter, also "clear" the channel's "next event",
> for it to be properly written by whatever the next user is going to want
> (possibly avoiding too early an IRQ).
> 
> Further, along the same lines, don't enable channels early when starting
> up an IRQ. This similarly should happen no earlier than from
> set_channel_irq_affinity() (here: once a channel goes into use the very
> first time). This eliminates a single instance of
> 
> (XEN) [VT-D]INTR-REMAP: Request device [0000:00:1f.0] fault index 0
> (XEN) [VT-D]INTR-REMAP: reason 25 - Blocked a compatibility format interrupt 
> request
> 
> during boot. (Why exactly there's only one instance, when we use multiple
> counters and hence multiple IRQs, I can't tell. My understanding would be
> that this was due to __hpet_setup_msi_irq() being called only after
> request_irq() [and hence the .startup handler], yet that should have
> affected all channels.)
> 
> Fixes: 3ba523ff957c ("CPUIDLE: enable MSI capable HPET for timer broadcast")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> ---
> A window still remains for IRQs to be caused by stale comparator values:
> hpet_attach_channel() is called ahead of reprogram_hpet_evt_channel().
> Should we also write the comparator to "far into the future"?

I think we can possibly live with this to avoid doing an extra MMIO
access?

Thanks, Roger.



 


Rackspace

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