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 95424C4338F for ; Wed, 18 Aug 2021 11:14:03 +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 5B487606A5 for ; Wed, 18 Aug 2021 11:14:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5B487606A5 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=Gu+krJUIeEXNvTDu66HGKDh50346dC+ShqBpv9NsrDI=; b=JHdip4dyT4E3zN RFyx0P5H9TyMeicAAlLVzliPKHeAkZN3PKxf78KVJlznieZXH6PiuYUK0sEJMeP8N3z2zOmiTV6qE isWcYcT+sfZ0GkAVA1PLu0XJ1114aod2XOSNU18ZpAtuupA6r/fKWVZpwDbYA2C3UHrCoPJxbs/8v hWS3Umpv2bzyNYsbnoK15Q1dhHNLWVY7zPotbBqF9JjaSE3gs8IQ+rFu2oX4oKMkbfDYtqdHFcmVV ZPJ4prPCqgZTNcp/LeZIttsmOK7752JgDtyjVaq/YhDLzRGAbg5CvcKiZgoK2dm1kegE7lxh/6voU cjxm7x0QkjrBZxxDhsDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGJUK-005IAZ-Tw; Wed, 18 Aug 2021 11:12:05 +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 1mGJUG-005I9C-TW for linux-arm-kernel@lists.infradead.org; Wed, 18 Aug 2021 11:12:02 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2940261058; Wed, 18 Aug 2021 11:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629285120; bh=O5UMSQA6GpBj2EJn6x+svkI8YojZoSoRp7OiToO77gQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tr1DV6m7gqZHQi1Jia+eMgoIYmsG0BoKw1M8PPeZVNMJgzFyJbPV5qUVHxjF8Ti1C lcH2/MmWAJyZ974o0dTOSgZpCfYfWmazSrmpwztNstdscGrLRnqOLI3kWfvo7i4Qqc CSpu4W/nunsxjpWaRkQw/EAEz8R14ZQklw8szAqyFxLV433iCGp3BOMtOwxClRkvG0 Vq8jNd7s0g9XygCfc5QKTRXekiy+uXTb4DTYu94EpYlwrIDf5drsbS4bUSQrgWxfZ0 C63PmW3iOZANRK8FPBiY1UWv73zF6azpQnbOWt3Xc6raaFlv5mMR50aPI6leE5hmnP v67k/bLa75GqQ== Date: Wed, 18 Aug 2021 12:11:53 +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: <20210818111153.GA13999@willie-the-truck> References: <20210730112443.23245-1-will@kernel.org> <20210730112443.23245-8-will@kernel.org> <20210818105029.GC13828@willie-the-truck> 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_041201_065483_038EE1E8 X-CRM114-Status: GOOD ( 21.68 ) 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 Wed, Aug 18, 2021 at 12:56:24PM +0200, Peter Zijlstra wrote: > On Wed, Aug 18, 2021 at 11:50:30AM +0100, Will Deacon wrote: > > 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 > > Clearly that deserves a comment somewhere, because I keep trying to make > it more consistent than it can be :/ I'll see if I can find a spot. Agreed. The relax/force functions are already commented, so maybe alongside SCA_USER? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel