Ok,
I found it, but unfortunately it is working for Linux kernel 2.4, but I am sure it can gives us insight to find it in kernel 2.6
Here is text for 2.4 :
-----------------------------------------------------------------------------------
The set of processes on the Linux system is represented as a collection of struct task_struct structures which are linked in two ways:
1. as a hashtable, hashed by pid, and
2. as a circular, doubly-linked list using p->next_task and p->prev_task pointers.
The hashtable is called pidhash[] and is defined in include/linux/sched.h:
/* PID hashing. (shouldnt this be dynamic?) */
#define PIDHASH_SZ (4096 >> 2)
extern struct task_struct *pidhash[PIDHASH_SZ];
#define pid_hashfn(x) ((((x) >>

^ (x)) & (PIDHASH_SZ - 1))
The tasks are hashed by their pid value and the above hashing function is supposed to distribute the elements uniformly in their domain (0 to PID_MAX-1). The hashtable is used to quickly find a task by given pid, using find_task_pid() inline from include/linux/sched.h:
static inline struct task_struct *find_task_by_pid(int pid)
{
struct task_struct *p, **htable = &pidhash[pid_hashfn(pid)];
for(p = *htable; p && p->pid != pid; p = p->pidhash_next)
;
return p;
}
-----------------------------------------------------------------------------------
So, I looked code for include/linux/sched.h on Linux online code site [lxr]
There is no more hashtable called pidhash[] there, but there is
extern struct task_struct *find_task_by_pid_ns(pid_t nr,
struct pid_namespace *ns);
Try to use this and let me know what happens. I will try it myself but at the moment I am little busy,
regards !