MASK_DECLARE_8(48), MASK_DECLARE_8(56),#endif}; staticinlineconststructcpumask *get_cpu_mask(unsignedintcpu) {constunsignedlong*p = cpu_bit_bitmap[1+ cpu %BITS_PER_LONG]; p-= cpu /BITS_PER_LONG;returnto_cpumask(p); } #defineto_cpumask(bitmap) \((structcpumask *)(1?(bitmap...
const struct cpumask *affinity_mask) { return tags->cpumask; int queue = -1, cpu = 0;set->mq_map = kzalloc_node(sizeof(*set->mq_map) * nr_cpu_ids, GFP_KERNEL, set->numa_node); if (!set->mq_map) return -ENOMEM;if
The getaffinity() system call uses 'cpumask_size()' to decide how big the CPU mask is - so far so good. It is indeed the allocation size of a cpumask. But the code also assumes that the whole allocation is initialized without actually doing so itself. That's wrong, because we might...
On success, the rawsched_getaffinity() system call returns the number of bytes placed copied into themaskbuffer; this will be the minimum ofcpusetsizeand the size (in bytes) of thecpumask_tdata type that is used internally by the kernel to represent the CPU set bit mask. ...
get_cpu_mask /*cpu_bit_bitmap[0] is empty - so we can back into it*/#defineMASK_DECLARE_1(x) [x+1][0] = (1UL << (x))#defineMASK_DECLARE_2(x) MASK_DECLARE_1(x), MASK_DECLARE_1(x+1)#defineMASK_DECLARE_4(x) MASK_DECLARE_2(x), MASK_DECLARE_2(x+2)#defineMASK_DECLA...