Re: /sys/devices/system/cpu/possible is immutable?

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

 



>
> That sysfs value itself will not change for the single system while the
> kernel is running, but your program could be moved from a system with
> one value for that file, to another system with a different value while
> it is running without knowing that you were migrated.
>

Running process migration to another system? Wow, I never knew that.
If migration happens between the time of reading
/sys/devices/system/cpu/possible and the time of calling
`bpf_lookup_elem`, TOCTOU(Time of check to Time of Use) problem would
arise. HaHa.

> So be careful here, and use the "normal" api to deal with cpu values and
> numbers, never assume that once you start, that the number of cpus your
> program has access to will not change.

Thank you Kroah-Hartman for your advice.

regards,
Junyeong

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux