Re: [PATCH 3/6] bio: add allocation cache abstraction

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

 



[adding Thomas for a cpu hotplug questions]

> +static void bio_alloc_cache_destroy(struct bio_set *bs)
> +{
> +	int cpu;
> +
> +	if (!bs->cache)
> +		return;
> +
> +	preempt_disable();
> +	cpuhp_state_remove_instance_nocalls(CPUHP_BIO_DEAD, &bs->cpuhp_dead);
> +	for_each_possible_cpu(cpu) {
> +		struct bio_alloc_cache *cache;
> +
> +		cache = per_cpu_ptr(bs->cache, cpu);
> +		bio_alloc_cache_prune(cache, -1U);
> +	}
> +	preempt_enable();

If I understand the cpu hotplug state machine we should not get any new
cpu down callbacks after cpuhp_state_remove_instance_nocalls returned,
so what do we need the preempt disable here for?

> +	/*
> +	 * Hot un-plug notifier for the per-cpu cache, if used
> +	 */
> +	struct hlist_node cpuhp_dead;

Nit, even if we don't need the cpu up notifaction the node actually
provides both.  So I'd reword the comment drop the _dead from the
member name.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux