Re: [PATCH 5/6] workqueue: introduce NR_WORKER_POOLS andfor_each_worker_pool()

From: Tejun Heo
Date: Sat Jul 14 2012 - 01:07:46 EST


Hey, Linus.

On Fri, Jul 13, 2012 at 10:00:10PM -0700, Linus Torvalds wrote:
> On Fri, Jul 13, 2012 at 9:44 PM, Tejun Heo <tj@xxxxxxxxxx> wrote:
> >
> > nr_running is atomic_t (*nr_running)[2]. Ignoring the pointer to
> > array part, it's just returning the address of N'th element of the
> > array. ARRAY + N == &ARRAY[N].
>
> None of this matters one whit.
>
> You did "&(x)[0]".
>
> That's insane. It's crazy. It doesn't even matter what "x" is in
> between, it's crazy regardless.

Eh, from my previous reply.

| Ah okay, you're looking at the fifth patch in isolation. Upto this
| point, the index is always 0. I'm puttin it in as a placeholder for
| the next patch which makes use of non-zero index. This patch is
| supposed to prepare everything for multiple pools and thus non-zero
| index.

The patch is about converting stuff to handle size-1 array without
introducing any actual behavior change so that the next patch can bump
the array size and just change the index.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/