Questions tagged [rcu]

Read-Copy-Update is a sync mechanism allowing reads to occur concurrently with updates. It maintains multiple versions of objects and ensures they aren't freed until all preexisting read-side crit-sections complete. Since write to aligned pointer is atomic, we can atomic insert, remove, replace data items in a linked struct without disrupting readers. Concurrent readers can then continue accessing the old version, new readers will see updated version.

52 questions
1
vote
2 answers

Why Linux kernel never implemented a per data object RCU mechanism?

The core RCU APIs in the Linux kernel applies to all clients in the kernel, which means any reader (even if they are accessing totally unrelated data structures) accessing rcu-backed data will be treated equally. And calls like synchronize_rcu()…
Vitt Volt
  • 337
  • 4
  • 17
1
vote
1 answer

Get a list of all rcus available in Oracle 12c?

In our development environment, developers have created too many RCU schemas for Weblogic Domain. Many of these developers have now left the organization, and we need to circulate the list of RCUs the DBA would be deleting, so that people can inform…
Mihir Mehta
  • 89
  • 1
  • 9
1
vote
1 answer

is possble protecting _____nf_conntrack_find() return value by RCU?

I wonder nf_conntrack_find_get() that really protect ct pointer by RCU in linux kernel. Read-Copy-Update(RCU) can protect to access(read) node rcu_read_side critical section when node is updating. But, it is not mean protect…
ManE
  • 21
  • 3
1
vote
1 answer

rcu_read_lock and x86-64 memory ordering

On a preemptible SMP kernel, rcu_read_lock compiles the following: current->rcu_read_lock_nesting++; barrier(); With barrier being a compiler directive that compiles to nothing. So, according to Intel's X86-64 memory ordering white paper: Loads…
Einheri
  • 957
  • 1
  • 9
  • 22
1
vote
1 answer

Lock Free stack implementation idea - currently broken

I came up with an idea I am trying to implement for a lock free stack that does not rely on reference counting to resolve the ABA problem, and also handles memory reclamation properly. It is similar in concept to RCU, and relies on two features:…
valenumr
  • 85
  • 5
1
vote
1 answer

Kernel address poising by clearing upper bits?

Is there some mechanism in Linux which is poisoning addresses by zeroing upper 16 bits? I am debugging a kernel crash on an Intel x86-64 machine. The instruction which is causing the crash tries to access an address of 0x880139f3da00: crash>…
ensc
  • 6,704
  • 14
  • 22
1
vote
1 answer

Is it okay to read either old version or new version in RCU lock?

I have a question about RCU lock. As far as I know, RCU allows some readers (which started before grace period and ends in grace period) to have either old version or new version. Look up the attached image. So Readers that starts before yellow…
invictus
  • 81
  • 5
1
vote
1 answer

Is there a linux header for hashtable with spinlock-protected buckets?

I write a code which rarely creates/removes objects (up to several thousands) but very frequently modifies them in soft IRQ context. These objects are also rarely read (and probably will also be rarely modified) from task context (via procfs: file…
ababo
  • 1,490
  • 1
  • 10
  • 24
1
vote
1 answer

rcu_dereference() vs rcu_dereference_protected()?

Can any one explain what is the difference between rcu_dereference() and rcu_dereference_protected()? rcu_dereference() contains barrier code and rcu_dereference_protected() do not contain. When to use rcu_dereference() and when to use…
ayyappa ch
  • 95
  • 2
  • 9
1
vote
0 answers

RCU usage in Process context and softirq context

I am learning the new RCU based lockless synchronization approach in the linux kernel. I already have a Kernel module which maintains hash_table (kernel hash api). Until now I was using spin_lock_irqsave() in order to synchronize process context…
Haswell
  • 1,573
  • 1
  • 18
  • 45
1
vote
1 answer

What should I do with nonexistent _bh RCU functions?

There are many RCU functions that don't have a _bh counterpart. Examples are: list_entry_rcu() list_for_each_entry_rcu() Is this because... they can be called from bottom halves just fine (think list_empty() vs list_empty_rcu())? Does this mean…
Yd Ahhrk
  • 1,088
  • 12
  • 24
1
vote
1 answer

How should I be mixing RCU reader and updater code?

I have a boilerplate function that finds a structure in a tree-like database: struct foo { struct foo *child1; /* RCU-protected. */ struct foo *child2; /* RCU-protected. */ ... /* Other stuff */ } static struct foo *find_foo(int…
Yd Ahhrk
  • 1,088
  • 12
  • 24
1
vote
1 answer

multiple list protect by rcu

Hi, I am new to rcu locking mechanism in linux kernel. While trying to understand how rcu works and the provided APIs, I see that rcu_read_lock(), rcu_synchronize() does not take any lock instance. So, lets say I have n independent lists which I…
CodeQ
  • 319
  • 1
  • 3
  • 13
1
vote
1 answer

publish-subscribe mechanism and read-side critical section in RCU lock

Question 1: In the article to introduce RCU lock, he writes a publish-subscribe mechanism. But I have a question about rcu_assign_pointer(), in this article, he said: 1 p->a = 1; 2 p->b = 2; 3 p->c = 3; 4 rcu_assign_pointer(gp, p); The…
yifan_z
  • 256
  • 1
  • 10
1
vote
0 answers

Does the function of smp_wmb() can prevent reordering the instructions by compiler and CPU?

the codes is: static inline void __list_add_rcu(struct list_head * new, struct list_head * prev, struct list_head * next) { new->next = next; new->prev = prev; smp_wmb(); next->prev =…
lxgeek
  • 1,732
  • 2
  • 22
  • 33