Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 2020 15:21:10 -0600
From:      Kyle Evans <kevans@freebsd.org>
To:        James Gritton <jamie@freebsd.org>
Cc:        freebsd-jail <freebsd-jail@freebsd.org>
Subject:   Re: cpuset/jail creation
Message-ID:  <CACNAnaG2aV193WEDHgYCHQDeuvz7n3R9Kg4go508ayEqq7F_8Q@mail.gmail.com>
In-Reply-To: <8fc33f4feb1d002d71676c51f00bb9ac@freebsd.org>
References:  <CACNAnaFC4fhYTC7T3zWzEsHO=M-7Ny9KNxh47-Jdi_4yha%2BzZg@mail.gmail.com> <08c97ed86c3d64fea1cedbc111841b7a@freebsd.org> <CACNAnaF1U_R5wNrLyDc2KkdzsgmyWVeewrrOs4w7J-8vVUoC4g@mail.gmail.com> <8fc33f4feb1d002d71676c51f00bb9ac@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 20, 2020 at 3:09 PM James Gritton <jamie@freebsd.org> wrote:
>
> On 2020-11-19 20:56, Kyle Evans wrote:
> > The basic premise of this patch is that we shouldn't use the set
> > passed to cpuset_setproc directly if it has a different root than
> > whatever root the process has [*]. More importantly, the process
> > should not lose the identity of its base in the move. Currently, in
> > the scenario that I'm going through, the process and its single thread
> > goes from having its own cpuset 5 that was just created with a
> > different affinity to an anonymous set hanging off of the jail's
> > cpuset.
>
> It will always be the case when attaching to a jail, that the process'
> current cpuset base is different from the jails.
>
> Considering that the only processes that run in a jail are those that
> have attached, making sure all attached processes don't have the
> jail's cpuset base removes much of the jail cpuset's usefulness.
> I would expect that changing a jail cpuset's mask to apply to
> processes within that jail, but now it seems all processes in the
> jail are guaranteed *not* to be within the jail's cpuset.
>
> I'll admit that I hadn't considered affinities at all, only masks.
> It make sense to preserve the process' cpuset affinity.  I suppose
> theoretically that can be said of the jail's affinity as well, though
> a jail is less likely to have such a thing in its cpuset.
>
> Anyway, by the time I got around to replying, I see D27297 and D27298
> have shown up.  So I guess the conversation moves there.  And I'll
> have an actual look at the code before I muse anymore in a possibly
> irrelevant direction.
>

Heh, sorry. :-) With the latest patch, only those that deviated from
the jail they were in prior aren't using the new cpuset. If they used
the previous root set, they will simply accept the new root set.

Said differently, if you modified a process you can expect it to
continue being unique once attached. If a process was part of the
hivemind in its previous jail, it's part of the hivemind in its new
jail.

Thanks,

Kyle Evans



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