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

Re: [PATCH v4 01/15] cpufreq: Allow restricting to internal governors only


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 15 Jun 2023 15:21:00 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • 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=v6w/X1faUS+IaYNpp6Kv691yIk7tfGh0yQQ6AgYPbok=; b=kMqhMLbUGHcdsgVDQGPBdrrmByCLAMz2hf5shUm33Bs7+nbxR+EH09uq4TAUC51KNu4bZ0ywu8ORoeD07ZftxdrAHhkRvYXD6RXTdJFf99A3iHT2TRNvF02IXdDF83vNdk4HldWkwf4OKkOmqfY8TsQAqEQ8Q+BxRbtmlSK//PgPnuuHjQB6EoXhkL8yYX2feYKv5USHJ7+LyGlF8uM8ftDV8gxmZ288EF32yTn0kGGTJpibMSp6k6gAqZ24ICI4Ijgs93nf9XEGqbgqpL3fZ3n1KvAC4npy93j2XZREUKQyKWbMyPYzSs/1LnpNeTR81CvTpR3eKvtEJ8I4U2FJcA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dckts8ly34m1e07NR0DcGADDdCtPrk86CiNL/c/P6IDSg5uf0rqWECUG4dmJCCeuEHkKNqM2c4HJ7aSfwoqv+3zbk3AK8yWcIXuG2ONnD6h7MDYkVM3WQf+PRgOTEtumTOCDDZQENub+hxyjrMEnNzkWn11eyPfyVWrUzjMisHPxu8SMMljdRR2TBkOLzFfmIGB5P7ylY31nkmTxhO5+4HAbRfefOu9+V3vfFnsNSSym2ogoejemZETlotnDz1mTUWwNSr3knYj0/QhhEaxmL1lUaosXfp1mkOGanB+8JV5KFaaka9VxyIbHLK7HxMqkZz4ACWna01nV7PKSf9rEjQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 15 Jun 2023 13:21:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.06.2023 20:02, Jason Andryuk wrote:
> @@ -121,6 +122,12 @@ int __init cpufreq_register_governor(struct 
> cpufreq_governor *governor)
>      if (!governor)
>          return -EINVAL;
>  
> +    if (cpufreq_governor_internal && !governor->internal)
> +        return -EINVAL;
> +
> +    if (!cpufreq_governor_internal && governor->internal)
> +        return -EINVAL;

First just a nit: Why not simply 

    if (cpufreq_governor_internal != governor->internal)
        return -EINVAL;

?

Yet then I find this approach a little odd anyway. I think the
registration attempts would better be suppressed, thus also not
resulting in (apparently) failed init-calls. Especially for the
userspace governor this would then also mean / allow to avoid
registering of the CPU notifier.

Jan



 


Rackspace

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