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_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 18FCCC432BE for ; Wed, 18 Aug 2021 10:59:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02E386108E for ; Wed, 18 Aug 2021 10:59:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235126AbhHRK7l (ORCPT ); Wed, 18 Aug 2021 06:59:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235519AbhHRK7h (ORCPT ); Wed, 18 Aug 2021 06:59:37 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DC88C0617A8; Wed, 18 Aug 2021 03:59:02 -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=SBtDwSLN4ZP4oN8nC7bQ74uVN27LxCyARNgZcE6t0bU=; b=vS0WEdliZ6cTSfKSm4x9AVOA/D MFfJWMSetPkCBvvwH9fUWhUH/JxmoB9Ip/4JTyGAYeT0oZ869mmqjIG2MPHWF+QFQ5cJ83RXk5Ph4 XtN1cPPg7Y/OFO3qKPIljD9pLxUCV44ntTa0VzzAgAQO09oTJzmED47r7T+wXQCVao7Bg3NHU3Moh ZvpyDMsJxqDsdY3DEucu9YId3QzoITxCgmg7/abq6U7Wytly+fRgIbXOLuOLWySWQ1+acnQQeVuei I8835gNNV6QXTOGtyAUv17jFf6Pl60nI88yv0MhZE5C45J6MVTch2Nw7heYBJACZzYT41OC6bGJlP idM17XKA==; 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 #2 (Red Hat Linux)) id 1mGJFC-003jXO-Fu; Wed, 18 Aug 2021 10:56:32 +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) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0004730009A; Wed, 18 Aug 2021 12:56:24 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D156D2027DC66; Wed, 18 Aug 2021 12:56:24 +0200 (CEST) Date: Wed, 18 Aug 2021 12:56:24 +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 , 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: References: <20210730112443.23245-1-will@kernel.org> <20210730112443.23245-8-will@kernel.org> <20210818105029.GC13828@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210818105029.GC13828@willie-the-truck> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A6DEEC432BE for ; Wed, 18 Aug 2021 10:58:57 +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 785156108E for ; Wed, 18 Aug 2021 10:58:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 785156108E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.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=mszgpLGuG3K9gEOHjB7y6dunvazmSgmd6DmGCMranmM=; b=EK50p8q8WMfYyX 2Ry2eDpKNwDaOcs8WnrH6mGsY+AWUrymwpWZoxQV4r/JWI9munYgYj1y+HJeaWvqH/CeuIziX6Gs/ +OQTLDaLdFJUPrG0ZPL1He3ya+fYcBVJ3PF17UMLCibjcHerojJBnhQm3La+D7clUqnaZvpr/OHis 4w699/Bt6+0hDCPEpohuyyTbR5UgMvSr0rAG3expIAU7Nl22jyYSuO6CGeTZnNM/GQtQ/ckX2fUd1 y7Ky8Aeq5lTRREwvhQbILEQuNemL0VOupj9k3pv3q5PkNUwb4n4D4aJz9a7P+yM5Q7mVahkSvIw3Y A/vPZNb5hdPv7Cg5ICvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGJFj-005F7k-VH; Wed, 18 Aug 2021 10:57:00 +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 1mGJFf-005F6z-LF for linux-arm-kernel@bombadil.infradead.org; Wed, 18 Aug 2021 10:56:55 +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=SBtDwSLN4ZP4oN8nC7bQ74uVN27LxCyARNgZcE6t0bU=; b=vS0WEdliZ6cTSfKSm4x9AVOA/D MFfJWMSetPkCBvvwH9fUWhUH/JxmoB9Ip/4JTyGAYeT0oZ869mmqjIG2MPHWF+QFQ5cJ83RXk5Ph4 XtN1cPPg7Y/OFO3qKPIljD9pLxUCV44ntTa0VzzAgAQO09oTJzmED47r7T+wXQCVao7Bg3NHU3Moh ZvpyDMsJxqDsdY3DEucu9YId3QzoITxCgmg7/abq6U7Wytly+fRgIbXOLuOLWySWQ1+acnQQeVuei I8835gNNV6QXTOGtyAUv17jFf6Pl60nI88yv0MhZE5C45J6MVTch2Nw7heYBJACZzYT41OC6bGJlP idM17XKA==; 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 #2 (Red Hat Linux)) id 1mGJFC-003jXO-Fu; Wed, 18 Aug 2021 10:56:32 +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) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0004730009A; Wed, 18 Aug 2021 12:56:24 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D156D2027DC66; Wed, 18 Aug 2021 12:56:24 +0200 (CEST) Date: Wed, 18 Aug 2021 12:56:24 +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 , 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: 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: <20210818105029.GC13828@willie-the-truck> 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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel