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

Re: [PATCH 2/2] xen/cpu: round up cpu_khz calculations


  • To: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 14 Apr 2026 13:56:02 +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=2M94bJv33gHFeqrysa14xF6+TDgzNfyA8CIlc/roGXA=; b=uZsAJ/NU1DQp/xjJYTfvjN/vULR9DmGkiXkUSfKrCtIqtTMqkJe2RJ5Kb48Cy8RIWKb6tp+DDrUULw8AEqHIE7XPEZHTaK48iZZSA6RMf2jdIw75/9g6MsC8OzfbbAjbLzOP2mCQEPSK3hNpPLZzv6uE/+OB+n3irfHDfpMvTrfSOLeFT/NIDeuUuP/rzO1peiMUXTJNe8U2PdG6Z/v2pMQ9h2qLFgECIAEbWZm+hjWVo0uiqxTieq2oY0fNXZJNyGxWPk0W5mO/Mqco1rjecKpWp2/pkzM/p75D7GXEFSan+Gm/rCZyBct0aY35kvtwPH2I+kizN7vaQ1cEj2yG4A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P0ScF8jZpRm1oL6n2F/p8MkC3vfzqQxKe8/VrCEaX2tj4NVHuDU7D8SsqKAn1CQoHgqHYml1vII3wJjbPsXDhjNKaH47PJ4ku4otMCXzgfMnKA8Bvqmvqw3SMKnormhrhdy3UJajXZQeHGxqg+G1e6iqHhZlISkjp5o8nNGx6E35/eguC9/i43RmldoFk6VgwikWlmEv2l6mUM7UrLdFGwyG3GlufsimjFaZJrHLVuLXteIFmhn9RSTPfjxogzuKJgywUpI0RxVJdjmC5Q9ig8tsQ0L/i+genbIe8ny1ype5jX9fL9MxX/MauENBeqHXoMKV7fy6GZJefmexc19p3A==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Tue, 14 Apr 2026 11:56:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Apr 14, 2026 at 11:36:22AM +0000, Tu Dinh wrote:
> On 14/04/2026 12:36, Roger Pau Monne wrote:
> > All arches truncate the cpu_khz without taking into account the less
> > significant digits.  Instead use DIV_ROUND_UP() when scaling from Hz to kHz
> > to get as more accurate kHz value.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Couldn't DIV_ROUND be used here instead for a round-to-closest?

My bad, I got confused with the macro names.

Roger.



 


Rackspace

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