From owner-freebsd-jail@freebsd.org Fri Nov 20 21:21:25 2020 Return-Path: Delivered-To: freebsd-jail@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D6FB46E421 for ; Fri, 20 Nov 2020 21:21:25 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cd8cP3pkXz4f9g; Fri, 20 Nov 2020 21:21:25 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 705E122BC0; Fri, 20 Nov 2020 21:21:25 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f47.google.com with SMTP id q7so5347257qvt.12; Fri, 20 Nov 2020 13:21:25 -0800 (PST) X-Gm-Message-State: AOAM532I7D6mN8MrKi/eZa5UFX1vkzaErbCB7db5obVNfB8kXV2nf4lj yQ7xV3HKiS6E0Lnx+Hs9MY9az0p9w++ZdwgPEiE= X-Google-Smtp-Source: ABdhPJwJPgeb0g4gZlbjV9XSbXHUmoUU2++PV8d9O3GRv4Hfcl0I4ysdEJo+hPDzmHVb++Lz833xbS8xuev18xOpI6M= X-Received: by 2002:a0c:b59a:: with SMTP id g26mr17713802qve.26.1605907285069; Fri, 20 Nov 2020 13:21:25 -0800 (PST) MIME-Version: 1.0 References: <08c97ed86c3d64fea1cedbc111841b7a@freebsd.org> <8fc33f4feb1d002d71676c51f00bb9ac@freebsd.org> In-Reply-To: <8fc33f4feb1d002d71676c51f00bb9ac@freebsd.org> From: Kyle Evans Date: Fri, 20 Nov 2020 15:21:10 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: cpuset/jail creation To: James Gritton Cc: freebsd-jail Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2020 21:21:25 -0000 On Fri, Nov 20, 2020 at 3:09 PM James Gritton 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