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

Re: [PATCH v4] xen: move per-cpu area management into common code


  • To: <oleksii.kurochko@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 3 Oct 2024 11:41:04 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=q+GlfTuyCcRlG6HAwCrHTSEasIZQnqrq4e/lxe3027o=; b=LS/MvAcIa7q4eJOlu0ewNwKkELJsL1ivvFq19qAwq7Wb/wCnJ2TbrubO1oE1vgqBynTzjJRctZNPLIt1XGzDoq8c9p0vQmTCKg35fU/dA58wEZtiVaeDKlHMwfCUJgF5MH+uQvrErZ7FWm15/D+CxhNmjZysTzDf/q97oCqK4oH3PV153Ha5PCFOaZpevBQQEpabcYT8Si0S9vvDn1h3hFxoCh0KZrsVFyZ7gDNbK8chpTu26RKjG1DyEC30awQmiWPuDLUqNnzfmUPRoIeKBD8VQ4UHSJIPm4e+tfB63kUXroFGZ0bBPVdbSuPvCn9XfK3aEoq0Tz+CHhSHZiRGzw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YtwwlqijsXrHYhxDLYqXUGoHwiaVh0z5GZBw2+bGGl8sWj2xf7s+RkHD36cpGKEHJcVkxKU1hS9jvlFNgM1fo5LjkBfV/R3ityYfNkB2s9gd0eiH9myvreAyhj3/EaZb6N8gqJY0VoSwcQp+Faj2Z2HRPP+PIQL4Y70oi+cupp8FbG7wZk4OEYAc1X7BKqlXrSd6hsxfQxZ6a9HG7ZpvLPPzM11GK1f5MkiKDdrS1qGnlWeTuEgcqOR79VOVPGw/NBP55dGgSstJV1+0WolG/vSOmznXnafOe7YK3LzFjbdfAiCZ8DYWDKoJii84AmkCLsfqRMF0gF7LuPEwN8ieXg==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, "Connor Davis" <connojdavis@xxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 03 Oct 2024 09:41:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 03/10/2024 11:35, oleksii.kurochko@xxxxxxxxx wrote:
> 
> 
> On Wed, 2024-10-02 at 15:41 +0200, Michal Orzel wrote:
>>
>>
>> On 30/09/2024 18:39, Oleksii Kurochko wrote:
>>>
>>>
>>> Centralize per-cpu area management to reduce code duplication and
>>> enhance maintainability across architectures.
>>>
>>> The per-cpu area management code, which is largely common among
>>> architectures, is moved to a shared implementation in
>>> xen/common/percpu.c. This change includes:
>>>  * Remove percpu.c from the X86 and Arm architectures.
>>>  * For x86, define INVALID_PERCPU_AREAS and PARK_OFFLINE_CPUS_VAR.
>>>  * Drop the declaration of __per_cpu_offset[] from stubs.c in
>>>    PPC and RISC-V to facilitate the build of the common per-cpu
>>> code.
>>>
>>> No functional changes for x86.
>>>
>>> For Arm add support of CPU_RESUME_FAILED, CPU_REMOVE and freeing of
>>> percpu in the case when system_state != SYS_STATE_suspend.
>> Behaviorwise there is no change for Arm given that none of these
>> actions can be executed.
>> That said, by looking at the code I realized that we never call
>> CPU_REMOVE so it is effectively
>> a dead code.
> There is no change for now but what I mean by this message if one day,
> for example, enable_nonboot_cpus() will be called and park_offline_cpus
> will be enabled/implemented for Arm then CPU_RESUME_FAILED will be
> handled differently in comparison with original Arm code. In original
> Arm code it will do just break but for common code it will do
> free_percpu_area().
> And the similar for CPU_REMOVE if park_offline_cpus is enabled and
> cpu_notifier_call_chain(..., CPU_REMOVE,...) will be called then the
> behaviour of common code will be different from Arm code.
> 
> Do you think it would be better just drop this part of the commit
> message?
> Or would it be better to add:
>   ...(what I wrote before), however, there is no change in behavior for
> Arm at this time.
Yes, this one lgtm.

~Michal



 


Rackspace

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