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.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 B9FDCC433DF for ; Fri, 9 Oct 2020 09:39:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76A122225F for ; Fri, 9 Oct 2020 09:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733157AbgJIJjx (ORCPT ); Fri, 9 Oct 2020 05:39:53 -0400 Received: from foss.arm.com ([217.140.110.172]:46158 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728014AbgJIJjw (ORCPT ); Fri, 9 Oct 2020 05:39:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 12BEED6E; Fri, 9 Oct 2020 02:39:52 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D177F3F66B; Fri, 9 Oct 2020 02:39:50 -0700 (PDT) Date: Fri, 9 Oct 2020 10:39:48 +0100 From: Qais Yousef To: Peter Zijlstra Cc: Morten Rasmussen , linux-arch@vger.kernel.org, Marc Zyngier , Will Deacon , Catalin Marinas , Greg Kroah-Hartman , Linus Torvalds , linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH 3/3] arm64: Handle AArch32 tasks running on non AArch32 cpu Message-ID: <20201009093948.jqaw5oepotggrev5@e107158-lin.cambridge.arm.com> References: <20201008181641.32767-1-qais.yousef@arm.com> <20201008181641.32767-4-qais.yousef@arm.com> <20201009072943.GD2628@hirez.programming.kicks-ass.net> <20201009081312.GA8004@e123083-lin> <20201009092559.GE2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201009092559.GE2628@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20171215 Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On 10/09/20 11:25, Peter Zijlstra wrote: > On Fri, Oct 09, 2020 at 10:13:12AM +0200, Morten Rasmussen wrote: > > On Fri, Oct 09, 2020 at 09:29:43AM +0200, Peter Zijlstra wrote: > > > > Fundamentally, you're not supposed to change the userspace provided > > > affinity mask. If we want to do something like this, we'll have to teach > > > the scheduler about this second mask such that it can compute an > > > effective mask as the intersection between the 'feature' and user mask. > > > > I agree that we shouldn't mess wit the user-space mask directly. Would it > > be unthinkable to go down the route of maintaining a new mask which is > > the intersection of the feature mask (controlled and updated by arch > > code) and the user-space mask? > > > > It shouldn't add overhead in the scheduler as it would use the > > intersection mask instead of the user-space mask, the main complexity > > would be around making sure the intersection mask is updated correctly > > (cpusets, hotplug, ...). > > IFF we _need_ to go there, then yes that was the plan, compose the > intersection when either the (arch) feature(set) mask or the userspace > mask changes. On such systems these tasks are only valid to run on a subset of cpus. It makes a lot of sense to me if we want to go down that route to fixup the affinity when a task is spawned and make sure sched_setaffinity() never allows it to go outside this range. The tasks can't physically run on those cpus, so I don't see us breaking user-space affinity here. Just reflecting the reality. Only if it moved to a cpuset with no intersection it would be killed. Which I think is the behavior anyway today. Thanks -- Qais Yousef 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.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 DBECBC433E7 for ; Fri, 9 Oct 2020 09:41:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 6350022258 for ; Fri, 9 Oct 2020 09:41:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3gZiYBFJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6350022258 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=e2of7BKYjROSal9gxujZuwiP3kZMVPDfV4CNsDVCx/Y=; b=3gZiYBFJF030vzowAgCKXx4hC emJ2iScfg+88Dgwc5u1QrfVMockVmU9xf8IH/FoNa8TFSX9qldeeAm2gyivVyewzEsLzlPwYlyHrf hg3OGBif/K/S4d5oJhjLFYgcUu0kTypsz/lepGwnBSH0ammt3lOQDqGf20IVjB816elyBDktTjhP8 uYRlBH8mKh3o9yQsJ/tTkbEnJtm2tpjC/Q79asYTDfebCm3l5mdGTOVd/Kqs1rkQnBeqj7ksd+l9M fN+HFvQRLUtpNYPTyh2IaBRbByq6t7HU+oD1llAy818zWsXCFhH6bEQAsVbxMpI1JRH19LqFq0PAJ k/Si7Y+Tg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQosX-0002WS-Rt; Fri, 09 Oct 2020 09:39:57 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQosV-0002Vg-6M for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2020 09:39:56 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 12BEED6E; Fri, 9 Oct 2020 02:39:52 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D177F3F66B; Fri, 9 Oct 2020 02:39:50 -0700 (PDT) Date: Fri, 9 Oct 2020 10:39:48 +0100 From: Qais Yousef To: Peter Zijlstra Subject: Re: [RFC PATCH 3/3] arm64: Handle AArch32 tasks running on non AArch32 cpu Message-ID: <20201009093948.jqaw5oepotggrev5@e107158-lin.cambridge.arm.com> References: <20201008181641.32767-1-qais.yousef@arm.com> <20201008181641.32767-4-qais.yousef@arm.com> <20201009072943.GD2628@hirez.programming.kicks-ass.net> <20201009081312.GA8004@e123083-lin> <20201009092559.GE2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201009092559.GE2628@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20171215 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201009_053955_295218_F0C425C7 X-CRM114-Status: GOOD ( 21.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Catalin Marinas , Marc Zyngier , Linus Torvalds , Greg Kroah-Hartman , Will Deacon , Morten Rasmussen , linux-arm-kernel@lists.infradead.org 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 10/09/20 11:25, Peter Zijlstra wrote: > On Fri, Oct 09, 2020 at 10:13:12AM +0200, Morten Rasmussen wrote: > > On Fri, Oct 09, 2020 at 09:29:43AM +0200, Peter Zijlstra wrote: > > > > Fundamentally, you're not supposed to change the userspace provided > > > affinity mask. If we want to do something like this, we'll have to teach > > > the scheduler about this second mask such that it can compute an > > > effective mask as the intersection between the 'feature' and user mask. > > > > I agree that we shouldn't mess wit the user-space mask directly. Would it > > be unthinkable to go down the route of maintaining a new mask which is > > the intersection of the feature mask (controlled and updated by arch > > code) and the user-space mask? > > > > It shouldn't add overhead in the scheduler as it would use the > > intersection mask instead of the user-space mask, the main complexity > > would be around making sure the intersection mask is updated correctly > > (cpusets, hotplug, ...). > > IFF we _need_ to go there, then yes that was the plan, compose the > intersection when either the (arch) feature(set) mask or the userspace > mask changes. On such systems these tasks are only valid to run on a subset of cpus. It makes a lot of sense to me if we want to go down that route to fixup the affinity when a task is spawned and make sure sched_setaffinity() never allows it to go outside this range. The tasks can't physically run on those cpus, so I don't see us breaking user-space affinity here. Just reflecting the reality. Only if it moved to a cpuset with no intersection it would be killed. Which I think is the behavior anyway today. Thanks -- Qais Yousef _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel