From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755928AbdJLV5c (ORCPT ); Thu, 12 Oct 2017 17:57:32 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:45908 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752536AbdJLV5a (ORCPT ); Thu, 12 Oct 2017 17:57:30 -0400 X-Google-Smtp-Source: AOwi7QDv8YKjfoe/kAItVbSZEcZ8UyKbzjKSyRyDgtJsHxribrgTJw0Zd85V7fJJfu3XJDwCBRJ7Yg== Date: Thu, 12 Oct 2017 14:57:29 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Peter Zijlstra cc: Roman Gushchin , linux-kernel@vger.kernel.org, Tejun Heo , Oleg Nesterov , Linus Torvalds , Andrew Morton , Thomas Gleixner , Chris Mason , kernel-team@fb.com Subject: Re: [RFC 1/2] cgroup, kthread: do not allow moving kthreads out of the root cgroup In-Reply-To: <20171012192445.xdyrueypbncvappq@hirez.programming.kicks-ass.net> Message-ID: References: <20171012173723.13381-1-guro@fb.com> <20171012192445.xdyrueypbncvappq@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Oct 2017, Peter Zijlstra wrote: > > Attaching kernel threads to a non-root cgroup is generally a bad > > idea. Kernel threads are generally performing the work required > > to keep the system working and healthy, and applying various > > resource limits may affect system stability and performance. > > > > Some examples of dangerous behavior are limiting CPU time available > > to rcu stuff, memory limits applied to almost all kthreads, etc. > > > > To prevent this dangerous behavior, let's deny all kthread > > movements between cgroups. Right now only kthreads bounded > > to CPUs are not allowed to move, which is not sufficient. > > > > If there are examples of kthreads which can be limited, > > and it's guaranteed to be safe, we can allow explicit > > exceptions further. > > The traditional use-case is stuffing all the unbound kthreads into a > system cpuset in order to limit 'crap' on the rest of the CPUs. > This setup is typically found in HPC and RT environments. > > So NAK. This needs to stay working in as far as it still works. > +1, I originally introduced PF_THREAD_BOUND to cpusets in 2008 to prevent migration threads and software watchdog threads from being able to access the cpus they work on. We also move unbound kthreads to a system cpuset.