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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 85CFEC4338F for ; Wed, 18 Aug 2021 10:52:31 +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 515EF60F58 for ; Wed, 18 Aug 2021 10:52:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 515EF60F58 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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=8u4kUau9BlL77VGvgVCaJ61y6bIDnQO7wOGJT0iXZLQ=; b=M2AAfjlUOEWzhl EqovnyYvL8qFx5NNT6hapgi7DUpR4HU+oG6xi5jyVH4zwEjLIY9cAAGDe18TOnkhg/YTSXz70BZP6 /iWnGouSOLrW+996jjXz7Y3lqn7G284zp//elpSyQcDhkwyiXELr/zSg2qW6q0Xn265cve6zIcMn7 kFx+qu3k3TzU6Q2v/+ha3UtseekabrdB3hDAbo8i0/c9NyL+OPcBhCXerW6yzNaBJIMj69Z8WScIQ BJ1kEWcheQCazdcMSrKBne5AzakDaehl0SdjM/8cu4s3KrU7fJ8XfYS9FvNOSClf1x/OtwVLbu2bP EgM68vc8MEGTjbWAW2tA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGJ9d-005ECt-PB; Wed, 18 Aug 2021 10:50:41 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGJ9Z-005EBy-OT for linux-arm-kernel@lists.infradead.org; Wed, 18 Aug 2021 10:50:39 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 96ACC60FE6; Wed, 18 Aug 2021 10:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629283837; bh=XJJfqGaPKfZfagBQ927PihOmY2pne9eerFWpT3CGI8E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kPFj3oNMMBS61IZ+/x/n1lPqaD2WApPac4c/9QLZHaQOID4+TPfvozGIH0QziDPpF XSUP6TSX9lKydwgjpwEJKeNjQBPERgiW3kUoT+cL/H0MMLXpuPmEkQ4Isz28lWcAfh FBMyLVDcouPuEjZCuTDnllR4t6Upmxn37yLBm4B6wBOFqbWm/dAt8kBQKKhDCkg74G Z74Pg8yJ883UCwH2oHW17D5zyEj3gecruyx1rhdmLA/X0cx6SH3mW0YCV4Vi64PPQJ xaSbgb+v4V0DjJgiBCr+s6uReBdal1b8MJY39gEO/b/UK+QJA/antzNXauFCI6eYve WS9J7Fi+0uHvg== Date: Wed, 18 Aug 2021 11:50:30 +0100 From: Will Deacon To: Peter Zijlstra 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 , Valentin Schneider , Mark Rutland , kernel-team@android.com Subject: Re: [PATCH v11 07/16] sched: Split the guts of sched_setaffinity() into a helper function Message-ID: <20210818105029.GC13828@willie-the-truck> References: <20210730112443.23245-1-will@kernel.org> <20210730112443.23245-8-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210818_035037_880772_5EACCED3 X-CRM114-Status: GOOD ( 14.95 ) 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, Aug 17, 2021 at 05:40:24PM +0200, Peter Zijlstra wrote: > On Fri, Jul 30, 2021 at 12:24:34PM +0100, Will Deacon wrote: > > In preparation for replaying user affinity requests using a saved mask, > > split sched_setaffinity() up so that the initial task lookup and > > security checks are only performed when the request is coming directly > > from userspace. > > > > Reviewed-by: Valentin Schneider > > Signed-off-by: Will Deacon > > Should not sched_setaffinity() update user_cpus_ptr when it isn't NULL, > such that the upcoming relax_compatible_cpus_allowed_ptr() preserve the > full user mask? The idea is that force_compatible_cpus_allowed_ptr() and relax_compatible_cpus_allowed_ptr() are used as a pair, with the former setting ->user_cpus_ptr and the latter restoring it. An intervening call to sched_setaffinity() must _clear_ the saved mask, as we discussed before at: https://lore.kernel.org/r/YK53kDtczHIYumDC@hirez.programming.kicks-ass.net Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel