Hi Leo....

On Fri, Sep 18, 2009 at 1:43 PM, Leonidas . <[email protected]> wrote:
>
> 1. My profiling functions might do following in worst case
> {
> Part 1
> spinlock
> populate a treeĀ  & search a tree & delete a node from tree
> spinunlock

Are you absolutely sure that populate+search+delete must be done
uninterruptible? OK, or at least, you need to make it as quick as
possible. Let's hope red black tree will serve your purpose well

>
> Part 2
> Lock
> Update an error buffer
> Unlock
> }
> Which might be quite an overhead for an ISR.
>
> 2. in_interrupt would do for me.
> 3. My module would be single threaded, unless I strictly required.
>
> The whole issue is to lock the update error buffer i.e. part 2 above.
> This buffer updated from part 2 would be read in read method of module.

Hmmm, that error buffer, IMO it might be made lockless i.e by using
ring buffer and the reader is positioned to read from the oldest
entry.


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to