[ovs-dev] [PATCH] bridge: Complete initial configuration even with empty database.
Ben Pfaff
blp at nicira.com
Thu Apr 11 22:47:24 UTC 2013
Thanks! I'll push this and the other commit in a minute.
On Thu, Apr 11, 2013 at 03:46:40PM -0700, Ansis Atteka wrote:
> Acked-by: Ansis Atteka <aatteka at nicira.com>
>
> Thanks for fixing the other bug too.
>
>
> On Thu, Apr 11, 2013 at 3:06 PM, Ben Pfaff <blp at nicira.com> wrote:
>
> > I think that is an unrelated problem. I sent out a fix:
> > http://openvswitch.org/pipermail/dev/2013-April/026581.html
> >
> > On Thu, Apr 11, 2013 at 02:46:28PM -0700, Ansis Atteka wrote:
> > > If ovsdb-server is not running and I try to start single ovs-vswitchd
> > > instance without any init scripts, then I am still seeing 100% CPU
> > > utilization and multiple ovs-vswitchd instances in "ps" output. Still
> > > trying to understand what is going on...
> > >
> > > aatteka at aatteka-MacBookPro:~/openvswitch$ ps -Af | grep ovs-vs
> > > root 8187 26324 0 14:38 pts/3 00:00:00 sudo ovs-vswitchd
> > > unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info
> > > --mlockall --no-chdir --log-file=/var/log/openvswitch/ovs-vswitchd.log
> > > --pidfile=/var/run/openvswitch/ovs-vswitchd.pid --detach --monitor
> > > root 8188 8187 0 14:38 pts/3 00:00:00 ovs-vswitchd
> > > unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info
> > > --mlockall --no-chdir --log-file=/var/log/openvswitch/ovs-vswitchd.log
> > > --pidfile=/var/run/openvswitch/ovs-vswitchd.pid --detach --monitor
> > > root 8189 8188 0 14:38 ? 00:00:00 ovs-vswitchd
> > > unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info
> > > --mlockall --no-chdir --log-file=/var/log/openvswitch/ovs-vswitchd.log
> > > --pidfile=/var/run/openvswitch/ovs-vswitchd.pid --detach --monitor
> > > root 8190 8189 87 14:38 ? 00:01:43 ovs-vswitchd
> > > unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info
> > > --mlockall --no-chdir --log-file=/var/log/openvswitch/ovs-vswitchd.log
> > > --pidfile=/var/run/openvswitch/ovs-vswitchd.pid --detach --monitor
> > > root 8191 8190 0 14:38 ? 00:00:00 ovs-vswitchd: worker
> > > process for pid
> > > 8190
> > >
> > > aatteka 8219 26488 0 14:40 pts/4 00:00:00 grep --color=auto ovs-vs
> > > aatteka at aatteka-MacBookPro:~/openvswitch$ top
> > >
> > > top - 14:41:50 up 4:47, 6 users, load average: 1.31, 1.18, 1.14
> > > Tasks: 224 total, 2 running, 222 sleeping, 0 stopped, 0 zombie
> > > %Cpu(s): 4.1 us, 2.1 sy, 0.0 ni, 93.1 id, 0.6 wa, 0.0 hi, 0.1 si,
> > > 0.0 st
> > > KiB Mem: 8087432 total, 4069712 used, 4017720 free, 277992 buffers
> > > KiB Swap: 8298492 total, 0 used, 8298492 free, 1593760 cached
> > >
> > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+
> > > COMMAND
> > >
> > > 8190 root 20 0 23288 6796 6180 R 104.1 0.1 3:03.01
> > > ovs-vswitchd
> > >
> > > ...
> > >
> > >
> > > On Thu, Apr 11, 2013 at 2:03 PM, Ben Pfaff <blp at nicira.com> wrote:
> > >
> > > > If the database was empty, that is, it did not even contain an
> > Open_vSwitch
> > > > top-level configuration record, at ovs-vswitchd startup time, then
> > > > OVS failed to detach and used 100% CPU. This commit fixes the problem.
> > > >
> > > > This problem was introduced by commit 63ff04e82623e765 (bridge: Only
> > > > complete daemonization after db commits initial config.).
> > > >
> > > > This problem did not manifest if the initscripts supplied with Open
> > vSwitch
> > > > were used, because those initscripts always initialize the database
> > before
> > > > starting ovs-vswitchd, so this problem affects only users with
> > hand-rolled
> > > > local OVS startup scripts.
> > > >
> > > > Bug #16090.
> > > > Reported-by: Pravin Shelar <pshelar at nicira.com>
> > > > Tested-by: Pravin Shelar <pshelar at nicira.com>
> > > > Reported-by: Paul Ingram <paul at nicira.com>
> > > > Reported-by: Amre Shakimov <ashakimov at vmware.com>
> > > > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > > > ---
> > > > AUTHORS | 1 +
> > > > vswitchd/bridge.c | 34 +++++++++++++++++-----------------
> > > > 2 files changed, 18 insertions(+), 17 deletions(-)
> > > >
> > > > diff --git a/AUTHORS b/AUTHORS
> > > > index 07dce20..e3568bd 100644
> > > > --- a/AUTHORS
> > > > +++ b/AUTHORS
> > > > @@ -103,6 +103,7 @@ Alex Yip alex at nicira.com
> > > > Alexey I. Froloff raorn at altlinux.org
> > > > Amar Padmanabhan amar at nicira.com
> > > > Amey Bhide abhide at nicira.com
> > > > +Amre Shakimov ashakimov at vmware.com
> > > > André Ruß andre.russ at hybris.com
> > > > Andreas Beckmann debian at abeckmann.de
> > > > Atzm Watanabe atzm at stratosphere.co.jp
> > > > diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> > > > index 1fcf547..09f98d5 100644
> > > > --- a/vswitchd/bridge.c
> > > > +++ b/vswitchd/bridge.c
> > > > @@ -2269,25 +2269,25 @@ bridge_run(void)
> > > > }
> > > >
> > > > if (reconfiguring) {
> > > > - if (cfg) {
> > > > - if (!reconf_txn) {
> > > > - reconf_txn = ovsdb_idl_txn_create(idl);
> > > > - }
> > > > - if (bridge_reconfigure_continue(cfg)) {
> > > > + if (!reconf_txn) {
> > > > + reconf_txn = ovsdb_idl_txn_create(idl);
> > > > + }
> > > > +
> > > > + if (bridge_reconfigure_continue(cfg ? cfg : &null_cfg)) {
> > > > + reconfiguring = false;
> > > > +
> > > > + if (cfg) {
> > > > ovsrec_open_vswitch_set_cur_cfg(cfg, cfg->next_cfg);
> > > > - reconfiguring = false;
> > > > -
> > > > - /* If we are completing our initial configuration for
> > > > this run
> > > > - * of ovs-vswitchd, then keep the transaction around
> > to
> > > > monitor
> > > > - * it for completion. */
> > > > - if (!initial_config_done) {
> > > > - initial_config_done = true;
> > > > - daemonize_txn = reconf_txn;
> > > > - reconf_txn = NULL;
> > > > - }
> > > > }
> > > > - } else {
> > > > - bridge_reconfigure_continue(&null_cfg);
> > > > +
> > > > + /* If we are completing our initial configuration for
> > this run
> > > > + * of ovs-vswitchd, then keep the transaction around to
> > > > monitor
> > > > + * it for completion. */
> > > > + if (!initial_config_done) {
> > > > + initial_config_done = true;
> > > > + daemonize_txn = reconf_txn;
> > > > + reconf_txn = NULL;
> > > > + }
> > > > }
> > > > }
> > > >
> > > > --
> > > > 1.7.2.5
> > > >
> > > > _______________________________________________
> > > > dev mailing list
> > > > dev at openvswitch.org
> > > > http://openvswitch.org/mailman/listinfo/dev
> > > >
> >
More information about the dev
mailing list