Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp693317yba; Fri, 26 Apr 2019 07:16:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1ZFf2rc9Kcg/W5aYkchI+G8V/YoGfmP7yDak+PRheAcphN9zbo+Yv9ceOxGIG2hnm/PHU X-Received: by 2002:a17:902:e182:: with SMTP id cd2mr46437394plb.240.1556288176300; Fri, 26 Apr 2019 07:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556288176; cv=none; d=google.com; s=arc-20160816; b=hyTdVmTwbFlVLwWdr70We564tDYmimOhYqfVzZeaQVVKAMAg5HZYYyqL3oWABKVKiH 97rPjDrq9W+eC95NYltuVtrVCP90SNc/vQ/hmvLAtsTHc90V1rknbNMhqZBx61QMEjMQ MfttMIqaaXFtlXj02jXlu8LQtcgEC6k6SYf9dbSaLij6WGVvbkHhgn0iuEd7JTZFgTnt CBIkE0T6yFPEeIGCG14CUiLIe72kEc+tkUMMAnq+7NBsykLER0iQ4y458gqm55CvWcJU g5K/xsjX8CrBT9AT9oiGmFVF737DXxyHLVIHfV8R39IKRRzJyPLY7ItVmhKmylzkXuJ2 wxpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8loiSRaoh42DXeIQjNbiN1USZ8a/MszR2dkFDWexf7M=; b=RVnoS5vVBxjJaURSmYh9JMJgBZbVV2Jt9cq3iP3oL8dNiIz3FBtS0I9A6Bu7nnAn3p wV6p9IkX+LnYAHgvu0Dh+JB4H2tNYWsxhatKnad3OSuPkscbYCPhhMuarQd3C0lsJmOb CtHEipGrdzaC6h5TRgmSbZ2nrXQViKDmTkoiv2aLqGS+6+xhUClvb+cSWQCg7FxxCDid AL+qcde5Mwz4cQYq8AmNY5YSp5y33Q8E/cytU41INNMo0yV6D9v0upCjYS3+M1TFyq1E GvBufAZ5GjMd2f7oiInZeI4fXr3yUk72gn2c7zegvsLu3Kdpq7EPKyzYlYwC/0SPiDQs Kdiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=C7bZ9Z6F; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si9415471pgi.59.2019.04.26.07.16.01; Fri, 26 Apr 2019 07:16:16 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=C7bZ9Z6F; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726229AbfDZONm (ORCPT + 99 others); Fri, 26 Apr 2019 10:13:42 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33906 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbfDZONm (ORCPT ); Fri, 26 Apr 2019 10:13:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8loiSRaoh42DXeIQjNbiN1USZ8a/MszR2dkFDWexf7M=; b=C7bZ9Z6FeUKzezmLte/+hl18t WPZPTSc/CNVYLtOHh+QwJ9EhnP+5MRcFpeXW/VL/H/IshT0ASW/jIcigeiwlZenHmKkkubIVdfTHd 1PeBE4jgon6yovfndpr2GVv4WeNQwAJnip69qn7vfTrr+2khfzwSdm+furkG8jshuob0pdrEJ7N5/ kpTNq5WFvD+63NZ7DcH0ShNEJmIZarFdWO2V+xTIpByKIqau12/RZKhtwH0YdA57jnXi/x4IilPZ5 vP+CjAlbf54tfy8R0VLDmmiEvADfLtS+cHETma56rZLdZZVovrgJiXGJzlJ21qRrt2Fj6AJxNPy5P d0ugIAUgA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hK1bB-0000qi-CT; Fri, 26 Apr 2019 14:13:09 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D69DF28B70B85; Fri, 26 Apr 2019 16:13:07 +0200 (CEST) Date: Fri, 26 Apr 2019 16:13:07 +0200 From: Peter Zijlstra To: Phil Auld Cc: Vineeth Remanan Pillai , Nishanth Aravamudan , Julien Desfossez , Tim Chen , mingo@kernel.org, tglx@linutronix.de, pjt@google.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, subhra.mazumdar@oracle.com, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Aaron Lu , Aubrey Li , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Subject: Re: [RFC PATCH v2 12/17] sched: A quick and dirty cgroup tagging interface Message-ID: <20190426141307.GB2623@hirez.programming.kicks-ass.net> References: <20190425142652.GA979@pauld.bos.csb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190425142652.GA979@pauld.bos.csb> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 10:26:53AM -0400, Phil Auld wrote: > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index e8e5f26db052..b312ea1e28a4 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -7541,6 +7541,9 @@ static int cpu_core_tag_write_u64(struct cgroup_subsys_state *css, struct cftype > if (val > 1) > return -ERANGE; > > + if (num_online_cpus() <= 1) > + return -EINVAL; We actually know if there SMT on the system or not, which is much better indication still: if (!static_branch_likely(&sched_smt_present)) return -EINVAL; > if (tg->tagged == !!val) > return 0; > > > > > --