[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v4 02/15] xen/cpufreq: extract _PSD info from "struct xen_processor_performance"
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: "Penny, Zheng" <penny.zheng@xxxxxxx>
- Date: Fri, 16 May 2025 06:20:07 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=D1gER049XH5tfAxH57l+8H5nqgqxlb0iHbjwo8NwD00=; b=Ysca3WoFgJOJMMLQ33Gfzb7VOlsqfMWm4n1TULd1sje9otvXDUuxRzd+Y/g4icyUZbhqyOzFB6uOKJnTQP4+loYlBklD4C9DHFS/xoWqRec01pjo+0Os8IMLVs4TeVFg2pvOeYooFyuPossUFwowBfF5GyUf8aF+NVZiGGsCNvbXcXac1B42wiv+YWu7ZKa63PR8uTOIC6TNb1CutnPNrQ/10V52s4zbhdDKPTlWIdXFJV8TilUUnZxgrtwOlMgFgAMdZp3Q7izkflHK0buuH5+ga53fKgvZK9gXC/g/NevrD9eyChy4l5j4lTpt4rkck6t/bZ+bm46q7hG82m0qRA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=k2Np5no9uGuDHcutzpApYfO9LiyoriaQK3q+HG57l8ubOtbVmuCq5Q1nAmzlKV6Cxf4nIMFME8m0PQIcBM9EUZ5YPkFvtIFv7qcESdowKfP7LDnx492CwuxFlKYA0YlGyLoRxJ3davSTuq2QU4vaKSTMENRM3Wmeyk5rX74IsPwbAYxp0+jG4pmAXbD+FS0bnXiaBEWcR4hTUQOosD4FEQ9BFtE3XdNcvbA3bc89zptxep5iGqNLf1qnOOR0pzS9HEHT7Um6/qrJ/XeJITwsDJqkBwc5GLSvgxCXNKC1JyKnRHGLwIxwEEcVYrcE6X7pDY/tm9oFzLGdXP8Io3m6UA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: "Huang, Ray" <Ray.Huang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 16 May 2025 06:20:33 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Msip_labels: MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ActionId=26c142fd-afdb-428e-8017-6090b17d9672;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_ContentBits=0;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Enabled=true;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Method=Privileged;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Name=Open Source;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SetDate=2025-05-16T06:18:47Z;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_f265efc6-e181-49d6-80f4-fae95cf838a0_Tag=10, 0, 1, 1;
- Thread-index: AQHbrRCjQUXzVZg75kKZW3IeVU/v2LO5SzoAgAv/ooCACgTDgIAFqcOw
- Thread-topic: [PATCH v4 02/15] xen/cpufreq: extract _PSD info from "struct xen_processor_performance"
[Public]
> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Monday, May 12, 2025 11:45 PM
> To: Penny, Zheng <penny.zheng@xxxxxxx>
> Cc: Huang, Ray <Ray.Huang@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Anthony PERARD <anthony.perard@xxxxxxxxxx>;
> Orzel, Michal <Michal.Orzel@xxxxxxx>; Julien Grall <julien@xxxxxxx>; Roger Pau
> Monné <roger.pau@xxxxxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>;
> xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v4 02/15] xen/cpufreq: extract _PSD info from "struct
> xen_processor_performance"
>
> On 06.05.2025 09:22, Penny, Zheng wrote:
> >> -----Original Message-----
> >> From: Jan Beulich <jbeulich@xxxxxxxx>
> >> Sent: Monday, April 28, 2025 11:32 PM
> >>
> >> On 14.04.2025 09:40, Penny Zheng wrote:
> >>> --- a/xen/drivers/cpufreq/cpufreq.c
> >>> +++ b/xen/drivers/cpufreq/cpufreq.c
> >>> + {
> >>> + case XEN_PX_INIT:
> >>> + if ( shared_type )
> >>> + *shared_type = processor_pminfo[cpu]->perf.shared_type;
> >>> + if ( domain_info )
> >>> + *domain_info = processor_pminfo[cpu]->perf.domain_info;
> >>
> >> Does this need to be a structure copy? Can't you hand back just a
> >> pointer, with the function parameter being const struct xen_psd_package **?
> >>
> >
> > I've considered handing backing a pointer, then maybe we need to
> > allocate space for "struct xen_psd_package **domain_info =
> > xvzalloc(struct xen_psd_package *);", and XVFREE(xxx) it in each exit,
> especially cpufreq_add_cpu() has a lot exits, which could be a few code churn.
> > So I chose the struct copy to have the smallest change.
>
> I fear I don't see why such allocations (of space holding a single pointer)
> would be
> necessary. Afaict all you need is a local variable of the specific
> (pointer) type, the address of which you pass into here.
>
```
struct xen_psd_package *domain_info;
struct xen_psd_package **domain_info_ptr = &domain_info;
```
Oh, right, I could create a local variable to avoid nullptr initialization.
> Jan
|