lkml.org 
[lkml]   [2008]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/4] fib_trie: print statistics for multiple tables
    On Tue, 12 Feb 2008 16:50:45 -0800 Stephen Hemminger <shemminger@vyatta.com> wrote:

    > +/**
    > + * hlist_for_each_entry_continue_rcu - iterate over rcu hlist after current point
    > + * @tpos: the type * to use as a loop cursor.
    > + * @pos: the &struct hlist_node to use as a loop cursor.
    > + * @member: the name of the hlist_node within the struct.
    > + */
    > +#define hlist_for_each_entry_continue_rcu(tpos, pos, member) \
    > + for (pos = (pos)->next; \
    > + rcu_dereference(pos) && ({ prefetch(pos->next); 1;}) && \
    > + ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
    > + pos = pos->next)

    Is the compiler allowed to look at a term such as

    ({ prefetch(pos->next); 1;})

    and, when it is used as a truth value, say "hey, that's always true" and
    then elide the call to prefetch()? We've no way of telling because this
    remains gcc-specific territory, afaik.

    (cc Paul for rcu stuff)


    \
     
     \ /
      Last update: 2008-02-13 03:39    [W:2.837 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site