Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 May 2009 23:41:17 +0200
From:      Ed Schouten <ed@80386.nl>
To:        vasanth raonaik <vasanth.raonaik@gmail.com>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>, jt@0xabadba.be
Subject:   Re: concurrent sysctl implementation
Message-ID:  <20090508214117.GY58540@hoeg.nl>
In-Reply-To: <d9f479c10905050239u5d6d8304y1f63e41eabee8624@mail.gmail.com>
References:  <a0806f900905050107u4cbf0624oc83aafa54ae651f0@mail.gmail.com> <d9f479c10905050239u5d6d8304y1f63e41eabee8624@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--wrbmJCjDMpeEYJph
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

* vasanth raonaik <vasanth.raonaik@gmail.com> wrote:
> Hello Jt,
>=20
> I am a newbee in this alias. I am having a very basic question. It would =
be
> really good if you could give me some of this information.
> Could you please elaborate on what is the current architecture of sysctl
> implementation and How the concurrency would benefit us.

Right now sysctl is synchronized using the sysctl lock. The problem is
that certain sysctls just block for a very long time (especially some of
the GEOM ones). We also call sysctl when we execute new processes, to
obtain a random number for the stack protector. This means we have quite
a lot of contention on it. This lock needs to be there, because sysctls
can be added and removed on demand.

I think I discussed this with John Baldwin (right?) and I think we also
have the issue that we cannot allow an unbounded amount of concurrent
calls to sysctl, because sysctl wires memory.

A solution would be to solve it as follows:

- Use a semaphore, initialized to some insane high value to put an upper
  limit on the amount of concurrent sysctl calls. I'm not sure whether
  this is really needed. Maybe this issue is not as serious as we think
  it is.

- Use an rw/rm/sxlock to protect the sysctl tree, but only pick up
  the lock when we traverse parts of the sysctl tree that has
  dynamically created entries.

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--wrbmJCjDMpeEYJph
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkoEpv0ACgkQ52SDGA2eCwUhWQCeNfDTUrL1RV9JgxoWHfNDPeEP
UwYAnRjuuIZe2F1m9EW5dZz8+pgwTxBT
=wI4p
-----END PGP SIGNATURE-----

--wrbmJCjDMpeEYJph--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090508214117.GY58540>