lkml.org 
[lkml]   [2011]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 0/2] jump label: 2.6.38 updates
FromPeter Zijlstra <>
DateFri, 11 Feb 2011 22:38:17 +0100
On Fri, 2011-02-11 at 16:13 -0500, Mathieu Desnoyers wrote:
>
> Thoughts ?

#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
+
+struct jump_label_key {
+ void *ptr;
+};
struct jump_label_entry {
struct hlist_node hlist;
struct jump_entry *table;
- int nr_entries;
/* hang modules off here */
struct hlist_head modules;
unsigned long key;
+ u32 nr_entries;
+ int refcount;
};
#else

+struct jump_label_key {
+ int state;
+};
#endif



So why can't we make that jump_label_entry::refcount and
jump_label_key::state an atomic_t and be done with it?

Then the enabled case uses if (atomic_inc_return(&key->ptr->refcount) ==
1), and the disabled atomic_inc(&key->state).


\
 
 \ /
  Last update: 2011-02-11 22:39    [from the cache]
©2003-2010