search for: ida_pcpu_size

Displaying 7 results from an estimated 7 matches for "ida_pcpu_size".

2013 Aug 20
5
[PATCH-v3 1/4] idr: Percpu ida
...IDA */ > + > +/* > + * Number of tags we move between the percpu freelist and the global freelist at > + * a time "between a percpu freelist" would be more accurate? > + */ > +#define IDA_PCPU_BATCH_MOVE 32U > + > +/* Max size of percpu freelist, */ > +#define IDA_PCPU_SIZE ((IDA_PCPU_BATCH_MOVE * 3) / 2) > + > +struct percpu_ida_cpu { > + spinlock_t lock; > + unsigned nr_free; > + unsigned freelist[]; > +}; Data structure needs documentation. There's one of these per cpu. I guess nr_free and freelist are clear enough. The presence of...
2013 Aug 20
5
[PATCH-v3 1/4] idr: Percpu ida
...IDA */ > + > +/* > + * Number of tags we move between the percpu freelist and the global freelist at > + * a time "between a percpu freelist" would be more accurate? > + */ > +#define IDA_PCPU_BATCH_MOVE 32U > + > +/* Max size of percpu freelist, */ > +#define IDA_PCPU_SIZE ((IDA_PCPU_BATCH_MOVE * 3) / 2) > + > +struct percpu_ida_cpu { > + spinlock_t lock; > + unsigned nr_free; > + unsigned freelist[]; > +}; Data structure needs documentation. There's one of these per cpu. I guess nr_free and freelist are clear enough. The presence of...
2013 Aug 28
0
[PATCH] percpu ida: Switch to cpumask_t, add some comments
...r a * percpu freelist does have tags. */ - unsigned long *cpus_have_tags; + cpumask_t cpus_have_tags; struct { spinlock_t lock; diff --git a/lib/idr.c b/lib/idr.c index 26495e1..15c021c 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -1178,7 +1178,13 @@ EXPORT_SYMBOL(ida_init); #define IDA_PCPU_SIZE ((IDA_PCPU_BATCH_MOVE * 3) / 2) struct percpu_ida_cpu { + /* + * Even though this is percpu, we need a lock for tag stealing by remote + * CPUs: + */ spinlock_t lock; + + /* nr_free/freelist form a stack of free IDs */ unsigned nr_free; unsigned freelist[]; }; @@ -1209,21 +1215,...
2013 Aug 16
0
[PATCH-v3 1/4] idr: Percpu ida
...DR_SHIFT) @@ -1159,3 +1162,300 @@ void ida_init(struct ida *ida) } EXPORT_SYMBOL(ida_init); + +/* Percpu IDA */ + +/* + * Number of tags we move between the percpu freelist and the global freelist at + * a time + */ +#define IDA_PCPU_BATCH_MOVE 32U + +/* Max size of percpu freelist, */ +#define IDA_PCPU_SIZE ((IDA_PCPU_BATCH_MOVE * 3) / 2) + +struct percpu_ida_cpu { + spinlock_t lock; + unsigned nr_free; + unsigned freelist[]; +}; + +static inline void move_tags(unsigned *dst, unsigned *dst_nr, + unsigned *src, unsigned *src_nr, + unsigned nr) +{ + *src_nr -= nr; + memcpy(dst + *ds...
2013 Aug 16
6
[PATCH-v3 0/4] target/vhost-scsi: Add per-cpu ida tag pre-allocation for v3.12
From: Nicholas Bellinger <nab at linux-iscsi.org> Hi folks, This is an updated series for adding tag pre-allocation support of target fabric descriptor memory, utilizing Kent's latest per-cpu ida bits here, along with Christoph Lameter's latest comments: [PATCH 04/10] idr: Percpu ida http://marc.info/?l=linux-kernel&m=137160026006974&w=2 The first patch is a
2013 Aug 16
6
[PATCH-v3 0/4] target/vhost-scsi: Add per-cpu ida tag pre-allocation for v3.12
From: Nicholas Bellinger <nab at linux-iscsi.org> Hi folks, This is an updated series for adding tag pre-allocation support of target fabric descriptor memory, utilizing Kent's latest per-cpu ida bits here, along with Christoph Lameter's latest comments: [PATCH 04/10] idr: Percpu ida http://marc.info/?l=linux-kernel&m=137160026006974&w=2 The first patch is a
2013 Aug 28
0
[PATCH-v3 1/4] idr: Percpu ida
...'re stealing tags we always grab all of the remote percpu freelist's tags - IDA_PCPU_BATCH_MOVE is only used when moving to/from the global freelist. > > > + */ > > +#define IDA_PCPU_BATCH_MOVE 32U > > + > > +/* Max size of percpu freelist, */ > > +#define IDA_PCPU_SIZE ((IDA_PCPU_BATCH_MOVE * 3) / 2) > > + > > +struct percpu_ida_cpu { > > + spinlock_t lock; > > + unsigned nr_free; > > + unsigned freelist[]; > > +}; > > Data structure needs documentation. There's one of these per cpu. I > guess nr_free and...