lkml.org 
[lkml]   [2006]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: FOR REVIEW: New x86-64 vsyscall vgetcpu()
    Date
    On Friday 16 June 2006 14:36, Zoltan Menyhart wrote:
    > Just to make sure I understand it correctly...
    > Assuming I have allocated per CPU data (numa control, etc.) pointed at by:
    >
    > void *per_cpu[MAXCPUS];


    That is not how user space TLS works. It usually has a base a register.

    >
    > Assuming a per CPU variable has got an "offset" in each per CPU data area.
    > Accessing this variable can be done as follows:
    >
    > err = vgetcpu(&my_cpu, ...);
    > if (err)
    > goto ....
    > pointer = (typeof pointer) (per_cpu[my_cpu] + offset);
    > // use "pointer"...
    >
    > It is hundred times more long than "__get_per_cpu(var)++".

    14 cycles is not a 100 times longer.

    > My idea is to map the current task structure at an arch. dependent
    > virtual address into the user space (obviously in RO).
    >
    > #define current ((struct task_struct *) 0x...)

    This means it cannot be cache colored (because you would need a static
    offset) and you couldn't share task_structs on a page.

    Also you would make task_struct part of the userland ABI which
    seems like a very very bad idea to me. It means we couldn't change
    it anymore.

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

    \
     
     \ /
      Last update: 2006-06-16 16:59    [W:0.021 / U:60.044 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site