Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1382618imm; Thu, 4 Oct 2018 12:41:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV63AhG2U1HVxqQLRFgtrZviJIpLdLvGn0AkiCM6cNht1SF3LS4Ncf/MOlcNVYMDPFVpBNBof X-Received: by 2002:a63:2218:: with SMTP id i24-v6mr7016066pgi.238.1538682100651; Thu, 04 Oct 2018 12:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538682100; cv=none; d=google.com; s=arc-20160816; b=L8hEly/uLK0Ys14uzdWskEX3DMrfEKU4Pkpkqpad7CJXm644FIrY5qykLCFVpDyHgo OD7YevcyzCayXzLe+gAn6vXInvPPplRFqqLOR5PbSiH9QCaB44t2eCWkQDTSWsDVn5hp 0fJSMGcrcjSBKLvgNLE1YFkyA7B1ItsfdOaYyLhZupdtqoMCYKDpVZqtWevFVqv90IJ5 2MKagVBCAsiXZRT74cd9EdySR8X0CKYMrAsPgdahr1c/rEmqgJao59ViKHI8EATqeeDS ROf+Td8GuQ4kDe0sQYFuFVOLtYmntxkg6up0ffGnP9rseaaQSyPUteAaixn/n76Ak6LA n1Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:to:cc:dkim-signature; bh=zwsVKiAtZBpj9PhL9Hne0q0mlWGysGOGmVnhkIa7q2Y=; b=N/Ticp8o85t1gX85tKmX2gdTWo4u7YS8TXtBmaq0BiD1b2b3fj6Mi5AJ13mnTnbiGx Tpu1sqZU26PmvCBkS6bepO11WsKpwIDD+Dx4ofa8oDaPMxanY947AlUGqABgqInvU1z6 q/i8cPaLgTKHO9Aoqn+mteDbfU6RujMgcfTc7D9B3qsIfkcZihPY3GouIioadoXnWc8/ nc3fP1OKaoh8iWYDLXCF5pgWMjlw7zViYg0fgjiiDECjNqJ3JL0myh06X5eB/WA4CiK0 oPXe7CiwxhekDzENKrPA2XQlS9kEykd3dujX6+7GE9NpvPODSQxU8pIazdVRMu+9EyI6 ZPfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OyFRb5Vv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24-v6si6417566pgk.315.2018.10.04.12.41.25; Thu, 04 Oct 2018 12:41:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OyFRb5Vv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728094AbeJECfr (ORCPT + 99 others); Thu, 4 Oct 2018 22:35:47 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36668 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727787AbeJECfq (ORCPT ); Thu, 4 Oct 2018 22:35:46 -0400 Received: by mail-wm1-f67.google.com with SMTP id a8-v6so6158303wmf.1; Thu, 04 Oct 2018 12:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=zwsVKiAtZBpj9PhL9Hne0q0mlWGysGOGmVnhkIa7q2Y=; b=OyFRb5Vvh33JAV4Hot6/vcTWtTqmZUd8J0o45bO8BRICmghGsY/BpZiFJZbqNCsZ0W lQJ212F7cQIC9Hdl1qcjCV4TqputnK/29lASXGobgb5BXAeaVb8APk31pPBf0ieuLTBX dABlLu8bkXQiDsybChVj6M/mVifVYUkkVrjczZ0yyD+X9NfhC0C0leKnu23JhDuIaXQc Voe34RyTYT6+UHw0QZGYIe1yk7/ZdreY00gmqFQ8dBmSEg0oj9tuJhYu76wTIt5Ihr/1 ZPNUxn3G9RAs9yzBwbSaKbJro+PkUfcZMdF1sQGT/CkvjirPgFL4hHU8u/VXY8oiHqSV ASwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=zwsVKiAtZBpj9PhL9Hne0q0mlWGysGOGmVnhkIa7q2Y=; b=GjS/xvVuLfnpiD8Gk4bg1Cu/cfaymey1d6e/U5qup7vZ8Lnf+EAfa7R/vqvNMYUR5W Nr9oKP/MAf5teSK4XbvvmD/by27uwF+uWjmUNPSNycMNboj2gfoavZdDuvRAPWziqcEf Lk11VdL1mrtUDlGe2w+JdZ4w+zoc2wOeRkuHNZ9QHTT+LLkrPNxbXb8hx72adX5y5jfO Anvt95RaFvGivNIeW6yvI0C6iE7WGOBnTmeLe4pVkOXCImRH+UN045Uiglrk96t1vytu 2V4E7doagAlJyQStxUgzYwKcWdHaUshVaEw1a+oPWV7By/6w94fKaB0mfVIbj0aerISL VgIA== X-Gm-Message-State: ABuFfohwB2f2L9ZOtE0qMjhYXB2mAw4zNs3GmVMEOAAxHfbZtN7FKedW 0t4rEgdhIeTAwwbWv8jDIgrzyYTe X-Received: by 2002:a1c:a1c6:: with SMTP id k189-v6mr6044212wme.0.1538682061686; Thu, 04 Oct 2018 12:41:01 -0700 (PDT) Received: from ?IPv6:2001:a61:25ca:c200:9cfe:b5b3:4ec3:2c28? ([2001:a61:25ca:c200:9cfe:b5b3:4ec3:2c28]) by smtp.gmail.com with ESMTPSA id e7-v6sm6618954wra.37.2018.10.04.12.41.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Oct 2018 12:41:00 -0700 (PDT) Cc: mtk.manpages@gmail.com, "open list:CONTROL GROUP (CGROUP)" , "Serge E. Hallyn" , lkml To: Tejun Heo From: "Michael Kerrisk (man-pages)" Subject: Cgroup v2 thread mode oddity: "domain invalid" cgroup with threaded controller enabled Message-ID: Date: Thu, 4 Oct 2018 21:40:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Tejun, Suppose we have the following scenario: x [d] (pids) y [dt] (pids) p [t] q [t] r [t] z [d] Here, x/y is a "domain threaded root" with a threaded controller (the 'pids' controller) enabled. (In this scenario, there are no member processes in any of the cgroups.) Suppose we now convert x/z to "threaded" type: # echo threaded > x/z/cgroup.type Now we end up in the following state: x [dt] (pids) y [inv] (pids) p [t] q [t] r [t] z [t] This seems odd. x/y is now of "domain invalid" type with a controller enabled! This feels like a violation of the rules, since we can't in other circumstances do anything with a "domain invalid" cgroup except convert it to "threaded". In particular, we can't create child cgroups under a "domain invalid" cgroup, or add member processes to the cgroup, or *enable controllers in the cgroup*. In fact, when doing the # echo threaded > x/z/cgroup.type I had expected a write(2) error because the state of x/y should (I thought) not be permitted. Your thoughts? Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/