Hi Ben, I read the comments and codes about ovs-rcu. Each thread is added into ovsrcu_threads in the thread start routine.
And most of threads quiesce in the poll_block/ xsleep/ ovsrcu_quiesce/ ovsrcu_quiesce_start+ ovsrcu_quiesce_end. Only one thread "afsync_thread" may not be in the ovsrcu_threads list, because it invokes ovsrcu_quiesce_start but does not call ovsrcu_quiesce_end. But this thread does not update/free rcu memory, so no writer is in the quiescent state. I am sorry to make an incorrect comment for Haifeng's patch. He has a correct description in original patch. Please help to correct. https://patchwork.ozlabs.org/project/openvswitch/patch/4099de2e54afad489356c6c9161d53339735a...@dggeml522-mbs.china.huawei.com/ Best Regards, Wei Yanqin > -----Original Message----- > From: Ben Pfaff <[email protected]> > Sent: Wednesday, June 3, 2020 8:48 AM > To: Yanqin Wei <[email protected]> > Cc: Linhaifeng <[email protected]>; [email protected]; nd > <[email protected]>; Lilijun (Jerry) <[email protected]>; chenchanghu > <[email protected]>; Lichunhe <[email protected]> > Subject: Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first > > Oh, I apologize that I made a mistake about the author. > > I appreciate feedback from anyone. > > On Wed, Jun 03, 2020 at 12:37:27AM +0000, Yanqin Wei wrote: > > Hi Ben, > > > > This patch is from Linhai, but I have the same concern about this. I will > > read > ovs-rcu comments and feedback. > > Thanks for your time. > > > > Best Regards, > > Wei Yanqin > > > > > -----Original Message----- > > > From: Ben Pfaff <[email protected]> > > > Sent: Wednesday, June 3, 2020 8:35 AM > > > To: Yanqin Wei <[email protected]> > > > Cc: Linhaifeng <[email protected]>; [email protected]; nd > > > <[email protected]>; Lilijun (Jerry) <[email protected]>; > > > chenchanghu <[email protected]>; Lichunhe > <[email protected]> > > > Subject: Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer first > > > > > > This is not how RCU works in OVS. Every thread is by default considered > active. > > > They rarely quiesce except implicitly inside poll_block(). > > > Please read the large comment at the top of ovs-rcu.h. > > > > > > Is your patch based on actual bugs that you have found, or is it > > > just some kind of precaution? If it is the latter, then it is not needed. > > > > > > On Tue, Jun 02, 2020 at 11:22:57PM +0000, Yanqin Wei wrote: > > > > Hi Ben, > > > > > > > > If my understanding is correct, the writer could not be a rcu > > > > thread because it > > > does not need report holding or not holding pointers. > > > > So old memory will be freed after all rcu thread report quiesce. > > > > > > > > Best Regards, > > > > Wei Yanqin > > > > > > > > > -----Original Message----- > > > > > From: Ben Pfaff <[email protected]> > > > > > Sent: Wednesday, June 3, 2020 1:28 AM > > > > > To: Linhaifeng <[email protected]> > > > > > Cc: Yanqin Wei <[email protected]>; [email protected]; nd > > > > > <[email protected]>; Lilijun (Jerry) <[email protected]>; > > > > > chenchanghu <[email protected]>; Lichunhe > > > <[email protected]> > > > > > Subject: Re: [ovs-dev] [PATCH v2] ovs rcu: update rcu pointer > > > > > first > > > > > > > > > > On Tue, Jun 02, 2020 at 07:27:59AM +0000, Linhaifeng wrote: > > > > > > We should update rcu pointer first then use ovsrcu_postpone to > > > > > > free otherwise maybe cause use-after-free. > > > > > > e.g.,reader indicates momentary quiescent and access old > > > > > > pointer after writer postpone free old pointer and before setting > > > > > > new > pointer. > > > > > > > > > > > > Signed-off-by: Linhaifeng <[email protected]> > > > > > > > > > > I don't see how that's possible, since the writer hasn't quiesced. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
