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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 3D50CC47082 for ; Wed, 26 May 2021 16:31:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18F13613CD for ; Wed, 26 May 2021 16:31:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234144AbhEZQd0 (ORCPT ); Wed, 26 May 2021 12:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233336AbhEZQdX (ORCPT ); Wed, 26 May 2021 12:33:23 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92887C061574; Wed, 26 May 2021 09:31:51 -0700 (PDT) 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=sOL3BvHKeXuTa8i7Byc9prFY//hqK/wPv2ycrlvaUAM=; b=ZYJ8C3RxiGEPbWFtIXjRPkM59W sru2KByW3HIzP2hQPaAyW4Cw6bKx2JjtYevRI7O+wrSriourpVabI7o2eSa5miBvEGeZuX15BkUC2 omEq4h1sV5ayhhk2SBAN+MJFZKhao90FjW/wyW3Z9DsuaFMHR4Ai28EHerkMQoi4WYXJ1lQSl+iN7 UAvoqI/ZQ0JpAPRCD8tE/8hKYgtTRjSVdA5Yy1PIT+Va9pfJoTPqpIHO8BNUGs8k8wrfM7ff02/tJ 0ze/wAL9+MPwmPcI1rac1i4GaqYSFDoUuPWRBXYRRXfUJM4E0rvl6SWQ85PCtAK9hRe6cNOpS1lUF jSd/7+Ig==; 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.94 #2 (Red Hat Linux)) id 1llwQ5-004hNf-HH; Wed, 26 May 2021 16:30:18 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E071430022A; Wed, 26 May 2021 18:30:08 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C6453201D301D; Wed, 26 May 2021 18:30:08 +0200 (CEST) Date: Wed, 26 May 2021 18:30:08 +0200 From: Peter Zijlstra To: Will Deacon Cc: 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 , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , Dietmar Eggemann , Daniel Bristot de Oliveira , kernel-team@android.com Subject: Re: [PATCH v7 13/22] sched: Allow task CPU affinity to be restricted on asymmetric systems Message-ID: References: <20210525151432.16875-1-will@kernel.org> <20210525151432.16875-14-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210525151432.16875-14-will@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 25, 2021 at 04:14:23PM +0100, Will Deacon wrote: > @@ -2426,20 +2421,166 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, > > __do_set_cpus_allowed(p, new_mask, flags); > > - return affine_move_task(rq, p, &rf, dest_cpu, flags); > + if (flags & SCA_USER) > + release_user_cpus_ptr(p); > + > + return affine_move_task(rq, p, rf, dest_cpu, flags); > > out: > - task_rq_unlock(rq, p, &rf); > + task_rq_unlock(rq, p, rf); > > return ret; > } So sys_sched_setaffinity() releases the user_cpus_ptr thingy ?! How does that work? I thought the intended semantics were somethings like: A - 0xff B restrict(0xf) // user: 0xff eff: 0xf sched_setaffinity(A, 0x3c) // user: 0x3c eff: 0xc relax() // user: NULL, eff: 0x3c 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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 0EF60C47082 for ; Wed, 26 May 2021 17:41:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C5785613B5 for ; Wed, 26 May 2021 17:41:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5785613B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=db+7gGaJ0AZ8cjldGEQ3QxFlrD545udPd78Ekq/35+0=; b=3w3zBMsSnYwx0o K92mJVi7AfwA1j0NRrMQaHEBD8jwrOvbOkqBH4h+0zo2zCWDsZMlQHRWLrL1KAbWeCwg2FylD1Hgy l8zVfEX3sGlEloJEonERPdUOE+02YXxA4ueHTVjyIozFF8JQrfzliXR7b1cP/+x9/5OR5h+r9tPq9 ed5e0FXfu2P7HN+S6AzHjxh0FtRiXyBKwk64vHDSyaKotIG3DBsTu9O6E8U9O2r9zWLF4FD1K7Avw b0d+EwhcEMYuFsGEYTE0uCvRxikajxtzHWaVjZIeZyXcUPxoetbfr/wqAFr8U12QJgZDTY5aEqzZJ 6mqj42nAD4DqQ98VyCJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1llxUQ-00GBQE-Sa; Wed, 26 May 2021 17:38:43 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1llwQi-00FkaT-MQ for linux-arm-kernel@bombadil.infradead.org; Wed, 26 May 2021 16:30:48 +0000 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=sOL3BvHKeXuTa8i7Byc9prFY//hqK/wPv2ycrlvaUAM=; b=ZYJ8C3RxiGEPbWFtIXjRPkM59W sru2KByW3HIzP2hQPaAyW4Cw6bKx2JjtYevRI7O+wrSriourpVabI7o2eSa5miBvEGeZuX15BkUC2 omEq4h1sV5ayhhk2SBAN+MJFZKhao90FjW/wyW3Z9DsuaFMHR4Ai28EHerkMQoi4WYXJ1lQSl+iN7 UAvoqI/ZQ0JpAPRCD8tE/8hKYgtTRjSVdA5Yy1PIT+Va9pfJoTPqpIHO8BNUGs8k8wrfM7ff02/tJ 0ze/wAL9+MPwmPcI1rac1i4GaqYSFDoUuPWRBXYRRXfUJM4E0rvl6SWQ85PCtAK9hRe6cNOpS1lUF jSd/7+Ig==; 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.94 #2 (Red Hat Linux)) id 1llwQ5-004hNf-HH; Wed, 26 May 2021 16:30:18 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E071430022A; Wed, 26 May 2021 18:30:08 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C6453201D301D; Wed, 26 May 2021 18:30:08 +0200 (CEST) Date: Wed, 26 May 2021 18:30:08 +0200 From: Peter Zijlstra To: Will Deacon Cc: 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 , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , Dietmar Eggemann , Daniel Bristot de Oliveira , kernel-team@android.com Subject: Re: [PATCH v7 13/22] sched: Allow task CPU affinity to be restricted on asymmetric systems Message-ID: References: <20210525151432.16875-1-will@kernel.org> <20210525151432.16875-14-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210525151432.16875-14-will@kernel.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 25, 2021 at 04:14:23PM +0100, Will Deacon wrote: > @@ -2426,20 +2421,166 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, > > __do_set_cpus_allowed(p, new_mask, flags); > > - return affine_move_task(rq, p, &rf, dest_cpu, flags); > + if (flags & SCA_USER) > + release_user_cpus_ptr(p); > + > + return affine_move_task(rq, p, rf, dest_cpu, flags); > > out: > - task_rq_unlock(rq, p, &rf); > + task_rq_unlock(rq, p, rf); > > return ret; > } So sys_sched_setaffinity() releases the user_cpus_ptr thingy ?! How does that work? I thought the intended semantics were somethings like: A - 0xff B restrict(0xf) // user: 0xff eff: 0xf sched_setaffinity(A, 0x3c) // user: 0x3c eff: 0xc relax() // user: NULL, eff: 0x3c _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel