search for: spinlock_t

Displaying 20 results from an estimated 1345 matches for "spinlock_t".

2016 Jun 13
0
[PATCH v8 2/5] ptr_ring: ring test
...nclude <limits.h> + +#define SMP_CACHE_BYTES 64 +#define cache_line_size() SMP_CACHE_BYTES +#define ____cacheline_aligned_in_smp __attribute__ ((aligned (SMP_CACHE_BYTES))) +#define unlikely(x) (__builtin_expect(!!(x), 0)) +#define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a)) +typedef pthread_spinlock_t spinlock_t; + +typedef int gfp_t; +static void *kzalloc(unsigned size, gfp_t gfp) +{ + void *p = memalign(64, size); + if (!p) + return p; + memset(p, 0, size); + + return p; +} + +static void kfree(void *p) +{ + if (p) + free(p); +} + +static void spin_lock_init(spinlock_t *lock) +{ + int r = p...
2016 Jun 13
0
[PATCH v8 2/5] ptr_ring: ring test
...nclude <limits.h> + +#define SMP_CACHE_BYTES 64 +#define cache_line_size() SMP_CACHE_BYTES +#define ____cacheline_aligned_in_smp __attribute__ ((aligned (SMP_CACHE_BYTES))) +#define unlikely(x) (__builtin_expect(!!(x), 0)) +#define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a)) +typedef pthread_spinlock_t spinlock_t; + +typedef int gfp_t; +static void *kzalloc(unsigned size, gfp_t gfp) +{ + void *p = memalign(64, size); + if (!p) + return p; + memset(p, 0, size); + + return p; +} + +static void kfree(void *p) +{ + if (p) + free(p); +} + +static void spin_lock_init(spinlock_t *lock) +{ + int r = p...
2014 Jun 22
2
[PATCH v1 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...a); > Does it work much worse if we just use as many queues as hardware supports, allocating as much memory as necessary? > @@ -24,8 +26,8 @@ static struct workqueue_struct *virtblk_wq; > struct virtio_blk > { > struct virtio_device *vdev; > - struct virtqueue *vq; > - spinlock_t vq_lock; > + struct virtqueue *vq[MAX_NUM_VQ]; > + spinlock_t vq_lock[MAX_NUM_VQ]; array of struct { *vq; spinlock_t lock; } would use more memory but would get us better locality. It might even make sense to add padding to avoid cacheline sharing between two unrelated VQs. Want to t...
2014 Jun 22
2
[PATCH v1 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...a); > Does it work much worse if we just use as many queues as hardware supports, allocating as much memory as necessary? > @@ -24,8 +26,8 @@ static struct workqueue_struct *virtblk_wq; > struct virtio_blk > { > struct virtio_device *vdev; > - struct virtqueue *vq; > - spinlock_t vq_lock; > + struct virtqueue *vq[MAX_NUM_VQ]; > + spinlock_t vq_lock[MAX_NUM_VQ]; array of struct { *vq; spinlock_t lock; } would use more memory but would get us better locality. It might even make sense to add padding to avoid cacheline sharing between two unrelated VQs. Want to t...
2001 Nov 11
1
problems when patching 2.4.14
...Hunk #1 FAILED at 399. Hunk #2 succeeded at 519 (offset 30 lines). 1 out of 2 hunks FAILED -- saving rejects to file include/linux/sched.h.rej this is the output from that file *************** *** 399,404 **** u32 self_exec_id; /* Protection of (de-)allocation: mm, files, fs, tty */ spinlock_t alloc_lock; }; /* --- 399,407 ---- u32 self_exec_id; /* Protection of (de-)allocation: mm, files, fs, tty */ spinlock_t alloc_lock; + + /* journalling filesystem info */ + void *journal_info; }; /*
2013 Mar 29
3
[PATCH v2 0/2] virtio: console: add locking around control out-vq
The in-vq operations were protected by a lock, but the out-vq operations were not. This caused panics / errors as described in patch 2. Fix that. The first patch renames the existing cvq_lock to c_ivq_lock to match c_ivq. The second patch introduces the c_ovq_lock for the c_ovq. Please apply. I also believe this is a candidate for stable. v2: * Use spin_lock instead of spin_lock_irq.
2013 Mar 29
3
[PATCH v2 0/2] virtio: console: add locking around control out-vq
The in-vq operations were protected by a lock, but the out-vq operations were not. This caused panics / errors as described in patch 2. Fix that. The first patch renames the existing cvq_lock to c_ivq_lock to match c_ivq. The second patch introduces the c_ovq_lock for the c_ovq. Please apply. I also believe this is a candidate for stable. v2: * Use spin_lock instead of spin_lock_irq.
2013 Mar 28
5
[PATCH 0/2] virtio: console: add locking around control out-vq
The in-vq operations were protected by a lock, but the out-vq operations were not. This caused panics / errors as described in patch 2. Fix that. The first patch renames the existing cvq_lock to c_ivq_lock to match c_ivq. The second patch introduces the c_ovq_lock for the c_ovq. Please apply. I also believe this is a candidate for stable. Amit Shah (2): virtio: console: rename cvq_lock
2013 Mar 28
5
[PATCH 0/2] virtio: console: add locking around control out-vq
The in-vq operations were protected by a lock, but the out-vq operations were not. This caused panics / errors as described in patch 2. Fix that. The first patch renames the existing cvq_lock to c_ivq_lock to match c_ivq. The second patch introduces the c_ovq_lock for the c_ovq. Please apply. I also believe this is a candidate for stable. Amit Shah (2): virtio: console: rename cvq_lock
2018 Mar 20
1
[PATCH] ptr_ring: fix build
...ringtest/ptr_ring.c +++ b/tools/virtio/ringtest/ptr_ring.c @@ -17,6 +17,8 @@ #define likely(x) (__builtin_expect(!!(x), 1)) #define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a)) #define SIZE_MAX (~(size_t)0) +#define KMALLOC_MAX_SIZE SIZE_MAX +#define BUG_ON(x) assert(x) typedef pthread_spinlock_t spinlock_t; @@ -57,6 +59,9 @@ static void kfree(void *p) free(p); } +#define kvmalloc_array kmalloc_array +#define kvfree kfree + static void spin_lock_init(spinlock_t *lock) { int r = pthread_spin_init(lock, 0); -- MST
2006 Mar 15
0
Zaptel compile errors on x86_64 - DEFINE_SPINLOCK???
Hi, (sorry for my mistake in not deleting the rest of the message just now) The problem seems to be here in zaptel.c (and torisa.c) #ifdef DEFINE_SPINLOCK static DEFINE_SPINLOCK(zaptimerlock); static DEFINE_SPINLOCK(bigzaplock); #else static spinlock_t zaptimerlock = SPIN_LOCK_UNLOCKED; static spinlock_t bigzaplock = SPIN_LOCK_UNLOCKED; #endif If I remark out as follows: //#ifdef DEFINE_SPINLOCK //static DEFINE_SPINLOCK(zaptimerlock); //static DEFINE_SPINLOCK(bigzaplock); //#else static spinlock_t zaptimerlock = SPIN_LOCK_UNLOCKED; static spinl...
2014 Jun 23
0
[PATCH v1 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...8PM +0300, Michael S. Tsirkin wrote: > On Fri, Jun 20, 2014 at 11:29:40PM +0800, Ming Lei wrote: > > @@ -24,8 +26,8 @@ static struct workqueue_struct *virtblk_wq; > > struct virtio_blk > > { > > struct virtio_device *vdev; > > - struct virtqueue *vq; > > - spinlock_t vq_lock; > > + struct virtqueue *vq[MAX_NUM_VQ]; > > + spinlock_t vq_lock[MAX_NUM_VQ]; > > array of struct { > *vq; > spinlock_t lock; > } > would use more memory but would get us better locality. > It might even make sense to add padding to avoid > cach...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...r/virtio_console.c > > +++ b/drivers/char/virtio_console.c > > @@ -1325,24 +1325,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols) > > port->cons.ws.ws_col = cols; > > } > > > > -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) > > +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) > > { > > struct port_buffer *buf; > > - unsigned int nr_added_bufs; > > + int nr_added_bufs; > > int ret; > > > > nr_added_bufs = 0; > > do { > > buf...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...r/virtio_console.c > > +++ b/drivers/char/virtio_console.c > > @@ -1325,24 +1325,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols) > > port->cons.ws.ws_col = cols; > > } > > > > -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) > > +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) > > { > > struct port_buffer *buf; > > - unsigned int nr_added_bufs; > > + int nr_added_bufs; > > int ret; > > > > nr_added_bufs = 0; > > do { > > buf...
2016 Dec 01
1
[PATCH v4 1/1] crypto: add virtio-crypto driver
...:) > > # ./scripts/checkpatch.pl 0001-crypto-add-virtio-crypto-driver.patch > total: 0 errors, 0 warnings, 1873 lines checked > > 0001-crypto-add-virtio-crypto-driver.patch has no obvious style problems and is ready for submission. Looks like a bug in checkpatch.pl: # check for spinlock_t definitions without a comment. if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ || $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) { my $which = $1; if (!ctx_has_comment($first_line, $linenr)) { CHK("UNCOMMENTED_DEFINITION", "$1 defi...
2016 Dec 01
1
[PATCH v4 1/1] crypto: add virtio-crypto driver
...:) > > # ./scripts/checkpatch.pl 0001-crypto-add-virtio-crypto-driver.patch > total: 0 errors, 0 warnings, 1873 lines checked > > 0001-crypto-add-virtio-crypto-driver.patch has no obvious style problems and is ready for submission. Looks like a bug in checkpatch.pl: # check for spinlock_t definitions without a comment. if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ || $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) { my $which = $1; if (!ctx_has_comment($first_line, $linenr)) { CHK("UNCOMMENTED_DEFINITION", "$1 defi...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
....c index 7270e7b69262..9e6534fd1aa4 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1325,24 +1325,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols) port->cons.ws.ws_col = cols; } -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) { struct port_buffer *buf; - unsigned int nr_added_bufs; + int nr_added_bufs; int ret; nr_added_bufs = 0; do { buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); if (!buf) - break; + return -ENOMEM; spin_lock_i...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
....c index 7270e7b69262..9e6534fd1aa4 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1325,24 +1325,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols) port->cons.ws.ws_col = cols; } -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) { struct port_buffer *buf; - unsigned int nr_added_bufs; + int nr_added_bufs; int ret; nr_added_bufs = 0; do { buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); if (!buf) - break; + return -ENOMEM; spin_lock_i...
2020 Aug 05
2
[PATCH V5 1/6] vhost: introduce vhost_vring_call
On 2020/8/4 ??5:21, Michael S. Tsirkin wrote: >>>>> ? +struct vhost_vring_call { >>>>> +??? struct eventfd_ctx *ctx; >>>>> +??? struct irq_bypass_producer producer; >>>>> +??? spinlock_t ctx_lock; >>>> It's not clear to me why we need ctx_lock here. >>>> >>>> Thanks >>> Hi Jason, >>> >>> we use this lock to protect the eventfd_ctx and irq from race conditions, >> We don't support irq notification from vDPA...
2020 Aug 05
2
[PATCH V5 1/6] vhost: introduce vhost_vring_call
On 2020/8/4 ??5:21, Michael S. Tsirkin wrote: >>>>> ? +struct vhost_vring_call { >>>>> +??? struct eventfd_ctx *ctx; >>>>> +??? struct irq_bypass_producer producer; >>>>> +??? spinlock_t ctx_lock; >>>> It's not clear to me why we need ctx_lock here. >>>> >>>> Thanks >>> Hi Jason, >>> >>> we use this lock to protect the eventfd_ctx and irq from race conditions, >> We don't support irq notification from vDPA...