login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
December
»
16
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Peter Zijlstra
Subject:
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
Date: Thursday, December 16, 2010 - 12:10 pm
On Thu, 2010-12-16 at 13:25 -0500, Jason Baron wrote:
quoted text
> Previously, I allowed any variable type to be used as the 'key' for > the jump label. However, by enforcing a type, we can make use of the > contents of the 'key'. This patch thus introduces: > > struct jump_label_key { > void *ptr; > }; > > The 'ptr' is used a pointer into the jump label table of the > corresponding addresses that need to be updated. Thus, when jump labels > are enabled/disabled we have a constant time algorithm. There is no > longer any hashing. > > When jump lables are disabled we simply have: > > struct jump_label_key { > int state; > }; > > I've also defined an analogous structure for ref counted jump labels as > per a request from Peter. > > struct jump_label_keyref { > void *ptr; > }; > > And for the jump labels disabled case: > > > struct jump_label_keyref { > atomic_t refcount; > }; > > The reason I've introduced an additional structure for the reference counted > jump labels is twofold: > > 1) For the jump labels disabled case, reference counted jump labels use an > atomic_read(). I didn't want to impact the jump labels disabled case for > tracepoints which simply accesses an 'int'. > > 2) By introducing a second type, we have two parallel APIs: > > extern void jump_label_enable(struct jump_label_key *key); > extern void jump_label_disable(struct jump_label_key *key); > > static inline void jump_label_inc(struct jump_label_keyref *key) > static inline void jump_label_dec(struct jump_label_keyref *key) > > In this way, we can't mix up the reference counted API, with the straight > enable/disable API since they accept different types.
But why do we want to have two APIs? --
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH/RFC 0/2] jump label: simplify API
, Jason Baron
, (Thu Dec 16, 11:25 am)
[PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Jason Baron
, (Thu Dec 16, 11:25 am)
[PATCH/RFC 2/2] jump label: introduce unlikely_switch()
, Jason Baron
, (Thu Dec 16, 11:25 am)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Peter Zijlstra
, (Thu Dec 16, 12:10 pm)
Re: [PATCH/RFC 0/2] jump label: simplify API
, Mathieu Desnoyers
, (Thu Dec 16, 12:22 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Jason Baron
, (Thu Dec 16, 12:23 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Peter Zijlstra
, (Thu Dec 16, 12:33 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Jason Baron
, (Thu Dec 16, 12:36 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Peter Zijlstra
, (Thu Dec 16, 12:41 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Jason Baron
, (Thu Dec 16, 12:48 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Steven Rostedt
, (Thu Dec 16, 1:09 pm)
Re: [PATCH/RFC 0/2] jump label: simplify API
, Steven Rostedt
, (Thu Dec 16, 1:18 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Mathieu Desnoyers
, (Thu Dec 16, 1:36 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Peter Zijlstra
, (Thu Dec 16, 1:43 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Mathieu Desnoyers
, (Thu Dec 16, 1:45 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Mathieu Desnoyers
, (Thu Dec 16, 1:50 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Peter Zijlstra
, (Thu Dec 16, 1:56 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Jason Baron
, (Fri Dec 17, 1:07 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, David Daney
, (Fri Dec 17, 1:51 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Steven Rostedt
, (Fri Dec 17, 2:12 pm)
Re: [PATCH/RFC 1/2] jump label: make enable/disable o(1)
, Jason Baron
, (Fri Dec 17, 2:32 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset
Tony Breeds
[LGUEST] Look in object dir for .config
git
:
Brian Downing
Re: Git in a Nutshell guide
John Benes
Re: master has some toys
Matthias Lederhofer
[PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree
Alexander Sulfrian
[RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set
Junio C Hamano
Re: Rss produced by git is not valid xml?
git-commits-head
:
Linux Kernel Mailing List
iSeries: fix section mismatch in iseries_veth
Linux Kernel Mailing List
ixbge: remove TX lock and redo TX accounting.