From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 063BCC63697 for ; Thu, 19 Nov 2020 16:10:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BF5C22259 for ; Thu, 19 Nov 2020 16:10:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="AI2lVVKr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727981AbgKSQKF (ORCPT ); Thu, 19 Nov 2020 11:10:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbgKSQKE (ORCPT ); Thu, 19 Nov 2020 11:10:04 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C429C0613CF; Thu, 19 Nov 2020 08:10:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=gT+aycviSHZiSVl6jswLbLNrg/uiSiMYLbgQMN7rMto=; b=AI2lVVKrmsVKgsicoDpaTb0HIr OzOqlDqCZxXvpG7NHAX7weDFKlljBL6wnqCy//WM6TW/yMtdFKChH4FCSRKwES7Ff2+D5OmmmNjfY oUvepoJexunxdO7bbuqOVJhgpQpQ4vcQx8LiDhHixGr1ExZ3Lgsu2g8JAJGEhaHtkpH5xrGxzZE14 F/1gLv41pIiaiJpC69307E1sUnlFAdn8GscUktxjPy7nxrVQQ9kv4OipQAdoRugjFHmkfhseCvNPk SiHL1EpaFewLIJKCSdmywkJsRJUNmzPm42Q4EL9+w2qrefjfnVGh9BSe5w/4d2heVKdBt6EAvtvKS cicepZ8g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfmVI-0006ei-9y; Thu, 19 Nov 2020 16:09:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 228793019CE; Thu, 19 Nov 2020 17:09:45 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 01C5F200E0A45; Thu, 19 Nov 2020 17:09:44 +0100 (CET) Date: Thu, 19 Nov 2020 17:09:44 +0100 From: Peter Zijlstra To: Will Deacon Cc: Valentin Schneider , linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Li Zefan , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , kernel-team@android.com Subject: Re: [PATCH v3 07/14] sched: Introduce restrict_cpus_allowed_ptr() to limit task CPU affinity Message-ID: <20201119160944.GP3121392@hirez.programming.kicks-ass.net> References: <20201113093720.21106-1-will@kernel.org> <20201113093720.21106-8-will@kernel.org> <20201119131319.GE4331@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201119131319.GE4331@willie-the-truck> Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Thu, Nov 19, 2020 at 01:13:20PM +0000, Will Deacon wrote: > Sure, but I was talking about what userspace sees, and I don't think it ever > sees CPUs that have been hotplugged off, right? That is, sched_getaffinity() > masks its result with the active_mask. # for i in /sys/devices/system/cpu/cpu*/online; do echo -n $i ":"; cat $i; done /sys/devices/system/cpu/cpu1/online :0 /sys/devices/system/cpu/cpu2/online :1 /sys/devices/system/cpu/cpu3/online :1 /sys/devices/system/cpu/cpu4/online :1 /sys/devices/system/cpu/cpu5/online :1 /sys/devices/system/cpu/cpu6/online :1 /sys/devices/system/cpu/cpu7/online :1 # grep Cpus_allowed /proc/self/status Cpus_allowed: ff Cpus_allowed_list: 0-7 :-)