Re: [PATCH 38/39] cpumask: Add enabled cpumask for present CPUs that can be brought online
Andy Shevchenko <[email protected]>
| Newsgroups | gmane.linux.ports.parisc,gmane.linux.power-management.general,gmane.linux.acpi.devel,gmane.linux.kernel.cross-arch,gmane.linux.kernel,gmane.linux.ports.arm.kernel,gmane.linux.ports.riscv,gmane.linux.documentation,gmane.linux.ports.ia64 |
|---|---|
| Organization | Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo |
| Message-ID | <ZTfjmM3nmeh+D5w/@smile.fi.intel.com> |
On Tue, Oct 24, 2023 at 04:19:24PM +0100, Russell King wrote: > From: James Morse <[email protected]> > > The 'offline' file in sysfs shows all offline CPUs, including those > that aren't present. User-space is expected to remove not-present CPUs > from this list to learn which CPUs could be brought online. > > CPUs can be present but not-enabled. These CPUs can't be brought online > until the firmware policy changes, which comes with an ACPI notification > that will register the CPUs. > > With only the offline and present files, user-space is unable to > determine which CPUs it can try to bring online. Add a new CPU mask > that shows this based on all the registered CPUs. ... > +static ssize_t print_cpus_enabled(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(cpu_enabled_mask)); > +} > +static DEVICE_ATTR(enabled, 0444, print_cpus_enabled, NULL); Hmm... DEVICE_ATTR_RO() ? -- With Best Regards, Andy Shevchenko