Re: [patch] reduce IPI noise due to /dev/cdrom open/close

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

 



Keith Owens wrote:
>> static void invalidate_bh_lrus(void)
>> {
>> -	on_each_cpu(invalidate_bh_lru, NULL, 1, 1);
>> +	/*
>> +	 * Need to hand down a copy of the mask or we wouldn't be run
>> +	 * anywhere due to the original mask being cleared
>> +	 */
>> +	cpumask_t mask = lru_in_use;
>> +	cpus_clear(lru_in_use);
>> +	schedule_on_each_cpu_mask(invalidate_bh_lru, NULL, mask);
>> }
> 
> Racy?  Start with an empty lru_in_use.
> 
> Cpu A                         Cpu B
> invalidate_bh_lrus()
> mask = lru_in_use;
> preempted
>                               block I/O
> 			      bh_lru_install()
> 			      cpu_set(cpu, lru_in_use);
> resume
> cpus_clear(lru_in_use);
> schedule_on_each_cpu_mask() - does not send IPI to cpu B

I guess the real question is whether the device is still valid for new
IO by the time we hit the invalidate function. If not, and that was my,
possibly flawed, assumption, then it's not an issue. Whatever bh's are
left in the lrus from other devices will be handled on the next hit.

Cheers,
Jes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux