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.

46 questions
7
votes
1 answer

Linux RCU and double linked list

I'm reading about Read-copy-update (RCU). I'm not sure if I understood it correctly in case of SMP. As far as I know RCU ensures that Update is executed atomically. In case for example single linked list it is obvious that exchanging old element…
user2699113
  • 3,465
  • 3
  • 18
  • 33
7
votes
1 answer

RCU as an alternative to conventional garbage collection

Read-Copy-Update (RCU) is a technique for manual memory management that is growing ever more popular in the Linux kernel. Is it possible to design a language and VM that uses RCU instead of a conventional garbage collector to reclaim unreachable…
J D
  • 46,493
  • 12
  • 162
  • 266
6
votes
3 answers

Is it necessary invoke rcu_read_lock in softirq context

The implement of rcu_read_lock is disable preempt and barrier. And the softirq context will not be preempted. So is it necessary to invoke the rcu_read_lock in softirq context. Is the barrier important?
linuxer
  • 316
  • 4
  • 14
4
votes
1 answer

What does rcu_read_lock() actually do (Linux Kernel)

I'm trying to understand rcu_read_lock() synchronization mechanism. From what I understand, rcu_read_lock() is used, where there are several read threads and one write thread, that read/writes the same data, and reading is performed under…
4
votes
1 answer

Is it safe to use rcu_dereference() inside local_bh_disable()/local_bh_enable()?

The local_bh_disable-function changes per-cpu (in case of x86 and recent kernels) __preempt_count or current_thread_info()->preempt_count otherwise. Anyway that gives us a grace period, so we can assume that it will be redundant to do…
red0ct
  • 4,231
  • 3
  • 14
  • 37
4
votes
2 answers

How RCU reader section is protected from preemption?

(From an article on LWN) 1 rcu_read_lock(); 2 list_for_each_entry_rcu(p, head, list) { 3 do_something_with(p->a, p->b, p->c); 4 } 5 rcu_read_unlock(); The RCU update operation will do synchronize_rcu() in order to assert each CPU switched…
4pie0
  • 27,469
  • 7
  • 70
  • 110
3
votes
1 answer

ORA-12528, TNS:listener: all appropriate instances are blocking new connections

Hi when trying to create Repository Creation Utility by Data Connection details are not excepting.it throws the Exception is Listener refused the connection with the following error: ORA-12528, TNS:listener: all appropriate instances are blocking…
nag
  • 617
  • 4
  • 23
  • 43
2
votes
1 answer

For Linux RCU, during the grace period, is it possible that a new writer update the new data?

I am new to Linux and studying RCU section. I saw there is a grace period during operation. Just want to know if some new writer want to update the data during a grace period, is it possible? I guess there are two ways: During a grace period, it…
2
votes
1 answer

Why does list_add_rcu only protect "prev->next"?

Following is the implementation of __list_add_rcu in include/linux/rculist.h: static inline void __list_add_rcu(struct list_head *new, struct list_head *prev, struct list_head *next) { new->next = next; new->prev = prev; …
Yan Zhu
  • 3,168
  • 3
  • 17
  • 31
2
votes
1 answer

Does hlist_for_each_entry_rcu need additional pointer to be passed into it?

LWN gives the following example on RCU: Subscribing to an RCU-protected hlist is also similar to the circular list: 1 rcu_read_lock(); 2 hlist_for_each_entry_rcu(p, q, head, list) { 3 do_something_with(p->a, p->b, p->c); 4 } 5…
4pie0
  • 27,469
  • 7
  • 70
  • 110
2
votes
0 answers

delete all entries from concurrent hashmap in linux kernel

I'm writing a kernel module, that uses a module-wide hashmap to store connections. I want to release all these connections, when the module is unloaded, delete them from the hashmap and then delete the whole map. I defined the hashmap: #define…
kaidowei
  • 75
  • 8
2
votes
0 answers

spin_lock_irqsave and alloc inside rcu_read_lock

Hi, I have a driver code which is supposed to work on certain packets received on the interface.The driver uses spin_lock_irqsave to manage parallel such requests before giving it to the hardware. To work on the packet, it requires some context…
CodeQ
  • 309
  • 1
  • 3
  • 13
1
vote
1 answer

Race conditions due to speculative reordering / Linux RCU facility

The following excerpt is taken from the website https://lwn.net/Articles/262464/ and it is dealing with read-inconsistencies of shared data structures (for which there was the RCU created): p = gp; if (p != NULL) { do_something_with(p->a, p->b,…
Vroomfondel
  • 2,156
  • 1
  • 12
  • 24
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
  • 91
  • 3
  • 8
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
  • 11
  • 2
1
2 3 4