Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12377

What's the best linux kernel locking mechanism for a specific scenario

$
0
0

I need to solve a locking problem for this scenario:

  1. A multi CPU system.
  2. All of the CPU's use a common (software) resource.
  3. Read only access to the resource is very common. (Processing of incoming network packets)
  4. Write access is a lot less frequent. (Pretty much configuration changes only).

Currently I use the read_lock_bh, write_lock_bh (spinlocks) mechanism. The problem is that the more CPU's, the more I get soft lockups in a writer context.

I read the concurrency chapter in this book, But couldn't quite understand whether the reader or the writer will get priority when using spin locks.

So the questions are:

  1. Does the Linux spinlock mechanism give priority the reader/writer/none of them?
  2. Is there a better mechanism I can use in order to avoid those soft lockups in my scenario, or maybe a way for me to give priority to the writer whenever it tries to obtain the lock, while using my current solution?

Thanks, Nir


Viewing all articles
Browse latest Browse all 12377

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>