On Fri, Mar 7, 2025 at 3:55 PM Dave Hansen dave.hansen@intel.com wrote:
On 3/7/25 05:12, Florent Revest wrote:
for_each_node(nid) {
cpu = cpumask_first(cpumask_of_node(nid));
mask = cpumask_of_node(nid);
if (cpumask_empty(mask))
continue;
cpu = cpumask_first(mask);
Would for_each_node_with_cpus() trim this down a bit?
Oh nice, I didn't notice this macro, thanks for pointing it out! :) I'm happy to respin a v2 using for_each_node_with_cpus(), I'll just leave a bit more time in case there are other comments.
One thing I'm not entirely sure about is that for_each_node_with_cpus() is implemented on top of for_each_online_node(). This differs from the current code which uses for_each_node(). I can't tell if iterating over offline nodes is a bug or a feature of load_microcode_amd() so this would be an extra change to the business logic which I can't really explain/justify.