Re: [PATCH RFC v7 1/5] ptr_ring: array based FIFO for pointers

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

 



On Thu, 2 Jun 2016 19:08:18 +0300 "Michael S. Tsirkin" <mst@xxxxxxxxxx> wrote:

> A simple array based FIFO of pointers.  Intended for net stack which
> commonly has a single consumer/producer.
> 
> Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
> ---
>  include/linux/ptr_ring.h | 264 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 264 insertions(+)
>  create mode 100644 include/linux/ptr_ring.h
> 
> diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h
> new file mode 100644
> index 0000000..d265d72
> --- /dev/null
> +++ b/include/linux/ptr_ring.h
[...]
> +static inline void *ptr_ring_consume_bh(struct ptr_ring *r)
                                       ^^^
> +{
> +	void *ptr;
> +
> +	spin_lock(&r->consumer_lock);

Ups! should have been spin_lock_bh()

> +	ptr = __ptr_ring_consume(r);
> +	spin_unlock(&r->consumer_lock);

and spin_unlock_bh()

> +
> +	return ptr;
> +}



-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux