DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Matthias Gatto <matthias.gatto@outscale.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vhost: try to shrink pfdset when fdset_add fails
Date: Wed, 22 Feb 2017 09:59:31 +0800	[thread overview]
Message-ID: <20170222015931.GK18844@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <20170221142530.31472-1-matthias.gatto@outscale.com>

On Tue, Feb 21, 2017 at 03:25:30PM +0100, Matthias Gatto wrote:
> fdset_add increment pfdset->num, but fdset_del doesn't decrement pfdset->num,
> so if we call fdset_add then fdset_del in a loop witout calling
> fdset_shrink, we can easily exceed MAX_FDS with only a few number of fds
> used.

I'm assuming you were doing some tests like following?

	while true; do
		ovs-vsctl add-port br vhost_n -- ...
		ovs-vsctl del-port vhost_n
	done

> So my solution is simply to call fdset_shrink in fdset_add
> when it exceed MAX_FDS.
> 
> Because fdset_shrink and fdset_add locks pfdset->fd_mutex we can't call
> fdset_shrink inside fdset_add because that would cause a dead lock,
> so this patch split fdset_shrink in two, fdset_shrink amd fdset_shrink_nolock.

Looks good to me.

	--yliu

  reply	other threads:[~2017-02-22  1:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 14:25 Matthias Gatto
2017-02-22  1:59 ` Yuanhan Liu [this message]
2017-02-22 10:01   ` Matthias Gatto
2017-02-23  4:37     ` Yuanhan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170222015931.GK18844@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=matthias.gatto@outscale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).