Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp699095yba; Fri, 26 Apr 2019 07:21:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEsxFVJdCMxWa6lkYMM3w2SDt89Lf8hSpZ5sjIBn28L1De85L/gB2vTvpiIFJjB5ird7tO X-Received: by 2002:a17:902:2a:: with SMTP id 39mr45832482pla.64.1556288513074; Fri, 26 Apr 2019 07:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556288513; cv=none; d=google.com; s=arc-20160816; b=BcUMJnwanFCH+n1ZHUS9LYEBlOKdI2mLfvsjHeSnQwMfeKR3Vw2I9VXxwwmGBk7Eje viRCN+KdgzN3W2n2PpuyRj9CcuZoZWINw0FzoT0vzLf0RsblkRcMQOnk9YilrdFdFnSJ egaypncbBfv5MbLmm3gYYJsemumCp6xuqgoMQOidg7L15OFrKCZuDxalvwg9TZPd6NYS lqL8foM5IVKdWmlZIWA0EanD5kqwSD+Fd7SWooaNqTDS6oOjZ9EaPDwIaYEOEbqi/EBj VOUl1G0afjZt1xpQUvo6s1Xw2Ul9aebtvu+gD9k5ylsB3VEHt1HQmrA6xjlZgFdP9XRy ftfA== 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; bh=dGT9k5N5oVOK7533m0gkj88HSJ+fl3ZJ/JLboONvsz4=; b=gPz/9YEYgJfaq+1clUJcLDwBTgVo1g5Z+09HcIM514zPu0YwJCJvE30IvbEfolrKpk JiLyT7gC/JDnlx5JrYne5MUUBUNnLkhJGmbyq5EXIo/f61i5BtjCKw6IrSq94QTun3OR fwdnpI1n/8OP2pAIK1U43PIJJCUgmn0H+pWvv+is6Leh+KrKgv0kUzE5mz1n22rkzUsp csBe9tR7HIrFDKYhKRbp/S4aVZF1JdDYtqjZzNPRjIEGdbsX57Cv4yxsOpyYgHo2GGAG xxevAZJEw0TpfZkGAjgIKhXgk4YzoNzXS7HGPFlK9udF9rSAsxouq8hBsFdK37U6oPBk Ru4g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si2109465plk.13.2019.04.26.07.21.37; Fri, 26 Apr 2019 07:21:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726409AbfDZOTY (ORCPT + 99 others); Fri, 26 Apr 2019 10:19:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36820 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbfDZOTX (ORCPT ); Fri, 26 Apr 2019 10:19:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B6113DBF8; Fri, 26 Apr 2019 14:19:20 +0000 (UTC) Received: from lorien.usersys.redhat.com (ovpn-116-103.phx2.redhat.com [10.3.116.103]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92C6860856; Fri, 26 Apr 2019 14:19:17 +0000 (UTC) Date: Fri, 26 Apr 2019 10:19:15 -0400 From: Phil Auld To: Peter Zijlstra 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: <20190426141915.GC16477@lorien.usersys.redhat.com> References: <20190425142652.GA979@pauld.bos.csb> <20190426141307.GB2623@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190426141307.GB2623@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 26 Apr 2019 14:19:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019 at 04:13:07PM +0200 Peter Zijlstra wrote: > 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; > > > > > > > > > > -- Yeah, I thought there was probably a better check. Thanks! --