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

RE: [PATCH v2 1/9] xen/x86: introduce a helper to update memory hotplug end


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Wed, 13 Jul 2022 09:55:01 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=J9txsKsPbDZzB2FRkjPadka9vdNHbyuA9a4+baEjCFc=; b=cRciNrOLWjOMyrisM6XG1uIU/Nh9SfvDcPNsmphC9jr92aNrua3JnApfmjQFKHUJX/0tqyLg5/gQ3WDjfJZ+lyvivqO8qagxCzgPhN3DB7LA9fw9eIaqgO7wZFU9Pu9MHMtuD1MRL8eQ72p5omqD/A9R2riX7bRIsgaS9Kb11k5Z/51+ac2mz1bRJsmov4UDjSLCg+6dB9erVELMNLpbwBIIqbbshQPkvp9gkaA8eWWiCSdcgxopBxwsyDAVI2dQCNh7xVo57GRA/5Se8NSChdIK4fhGNx8jvZhs5mCP/R9jUtpkpyM1ItPeDnOEkhkBXGRG24wIA3N3aPBpLCie6Q==
  • 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=J9txsKsPbDZzB2FRkjPadka9vdNHbyuA9a4+baEjCFc=; b=Gk8uDu78cgKkVCPf/kpzatYLyT0KtK3AQ8qe49tvVfHQfho73+8t8hfgadnKh/eRnh03bMNJsN38KkpaRFd3MTvfjFhsMIKoUwq3HR4M70Eh93Pwoln8FI3ka7LUkeQ065rOP/OlMT185DKHmJ9quaKdK/oGaa219qE0P1PeM/kbfi87LV0TCS7HfbmUY4ZITEzq5r8807InVtN6qPNzy1u8SDA5Nor8wOkt9IUquLAmb4wh+IsCWZ+phUM/czFWSl2ZYIofTxvXKQaLCt6uKR5zXNA8ogoPb4pgzgaTno/8M9vW+/F2eu8a07pr5a0+TJeu9CPLFCEFmxvLftb1uA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Bg9UAO2hlHOs0WLs9RkHB1+VLo1uDGr/AgtNxbwdNyFo5dkI5haG8bdXQXU71kqElFNr7PG1KCVSoN4dRbm3UqPjIQ5qRNzQ1q9d3c7PZ61qPhiazbCyQRUO7oBQMGJJZmgPvLF3dwCicb0W/F0qHavYkABrvqaIPJxd2y8oktBpKehEbEvXBgaZN4s0EjY/HucZtg6HWB2jPuJ57gMyraK76mME6LIvGaqgzkbyrCEy9M8Hn4+tWVVGr8lV8gF0OkDquPpxAHPlvm6/kKG2cCXJBgh/6C9DTLeo7y2l+fB76cgcYl8YWPqrXFEtm5fPHjlxKTcgbl7eNia6kv4+Ww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IU2WERTQciHB8cbPTmHzuFNt3ZG4CGr7clKz0/HdqbnAhNSuoLgGZR/ODA4eHYNBIit0xwruK8f5CZw6rb+Svtqch0WRHjd9wH/+In8E7d75yowvBcP1FBYZmuM8ZfqSTbWpR36EsvGzUIc+/T3HKRrkj/AGKWfcpn2tZfWY6MUJVg3y5wZtItGfDCPp7tYJeXGiAGqWauwr9zfCVjDZuOGZnTcfaWOZZAm4egwC0qhQOe4BY+KC4fKFr/U1yaqgMms+agllLsPjF/lIoS1y0FwSIeZjyXy4emJGKF1QLfmytrv39G0fiE6ChfoqAerW8rKyzWa6VTyeU3cOl9HZjA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: nd <nd@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 13 Jul 2022 09:55:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYktq36ViOQfJ5uUWUa1pA0oRKx616pmYAgAFNx1CAABATAIAAEM/w
  • Thread-topic: [PATCH v2 1/9] xen/x86: introduce a helper to update memory hotplug end

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 2022年7月13日 16:46
> To: Wei Chen <Wei.Chen@xxxxxxx>
> Cc: nd <nd@xxxxxxx>; Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; Roger Pau
> Monné <roger.pau@xxxxxxxxxx>; Wei Liu <wl@xxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2 1/9] xen/x86: introduce a helper to update memory
> hotplug end
> 
> On 13.07.2022 10:22, Wei Chen wrote:
> >> From: Jan Beulich <jbeulich@xxxxxxxx>
> >> Sent: 2022年7月12日 19:54
> >>
> >> On 08.07.2022 16:54, Wei Chen wrote:
> >>> x86 provides a mem_hotplug variable to maintain the memory hotplug
> >>> end address. We want to move some codes from x86 to common, so that
> >>> it can be reused by other architectures. But not all architectures
> >>> have supported memory hotplug. So in this patch, we introduce this
> >>> helper to replace mem_hotplug direct access in these codes. This
> >>> will give the ability of stubbing this helper to those architectures
> >>> without memory hotplug support.
> >>
> >> What remains unclear to me is why Arm can't simply gain the necessary
> >> variable. Sooner or later you'll want to support hotplug there anyway,
> >
> > I am not sure my limited memory hotplug knowledge can answer your
> question
> > or not. As memory hotplug depends on hardware and firmware support. Now
> > for Arm, we only have ACPI firmware that can notify OS through GED event
> > (not very sure). But ACPI and device tree couldn't be enabled at the
> same
> > time from OS booting. In device tree based NUMA, we will enable device
> > tree, ACPI service will not be initialized, that means we can not get
> > notification of memory hotplug events from ACPI firmware.
> >
> > Of course, adding GED device nodes to the device tree, and getting these
> > events through GED interrupts should not be a big technical problem. But
> > there may be other reasons, and no one is planning to add memory hotplug
> > support to the device tree (perhaps need an ACPI-like specification or a
> > firmware abstraction interface). So if we want to implement Xen Arm
> memory
> > hotplug, it should also start from ACPI. So currently even if we gain
> the
> > variable in Arm, it will not be used. Device tree does not have property
> > to indicate a memory block can be hotplug or not.
> 
> But ACPI is possible to be enabled for Arm64, and hence hotplug could be
> made work that way. Therefore I view the variable as potentially useful
> on Arm as well, and hence introducing the variable might be less trouble
> than introducing the per-arch helper.
> 

Ok, I will try to expose mem_hotplug to common/mm.c. As both Arm and x86
code can access it, we can move related NUMA code to common Without this
helper. And mem_hotplug will always be zero for Arm until Arm support
memory hotplug. This should be harmless for Arm.

> >> I suppose. Mechanically the change is fine. Albeit maybe "top" instead
> >> of "boundary", and maybe also pass "node" even if x86 doesn't need it?
> >>
> >
> > Sorry, I am not very clear about these comments:
> > It makes sense to use mem_hotplug_update_top instead
> > of mem_hotplug_update_boundary. But how can I understand pass "node"?
> > did you mean mem_hotplug_update_top(node, end)? But mem_hotplug is
> > a global top for memory hotplug ranges. I don't think pass "node"
> > to this function can be useful.
> 
> Please separate "current implementation" from "abstract model". In the
> latter it would seem quite reasonable to me to have per-node upper
> bounds (or even per-node ranges). Therefore adding node (and, on top
> of what I did suggest before, region start) to the parameters of the
> new per-arch hook would seem a good move to me, even if at present
> only / at most the "end" parameter would actually be used.
> 

As we will export mem_hotplug to common, I think these changes are
not needed any more?

Cheers,
Wei Chen

> Jan

 


Rackspace

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