Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3418878pxj; Mon, 7 Jun 2021 10:07:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylDLQ00E3/LfPY1/+TtlRS5PzrC1NKWbdL3azEr/84bJLEnG0yPlhUqOy9FxlfMW+m1OI1 X-Received: by 2002:a17:906:b104:: with SMTP id u4mr18778866ejy.211.1623085620588; Mon, 07 Jun 2021 10:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623085620; cv=none; d=google.com; s=arc-20160816; b=uOGhBgHdZz2JyaR9YQQ9eYQl/e8UZ9b7Vjfc8RThEMdTSnCxKaFzJNrmh6XPvBXqgR QGkT6JCPjzi+OoxG6+hFUDCQ2XjDtZL9BBT0cYSYaR687dut7H4upxvQnUmEegBm+M2W CPwfdS6sY8MhQw7B2+r2Y9GW4vN2tG8Z6XrKH9q9xZWhPiF/Whb69gD8i4x1tdM74zFv f9CiPT+Ae2guCmRtSQbaSsv8XAyCXf6cKbP8VNgk4yKuzjiraAHez1XbLw1V1qo/QGXi T8O0tqDpQ4kKGcOzTK0QEfFP2Hfv/4OW29dmeKOkdFy1gjMm2v2q/BwJU66g0xWtE9px tzBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Vg0C3Hz9Mg7iCC+UgxdW1nbrprXRyWFgY1w8ojNt5LM=; b=m6+mRgjuCh23GH0SNEeZ3YUzv4XPH2C37pbaqKv9OGQ8nl4IV8QeY82NZcAujpzxyC 9YslTjcx4G0Xy8PdhQl7reeOxS2SuqBmWKYerqJnLQdKLTLhJ+YkQ3i639ka9ImclZDu fqwzI2k3vUoN/cGkNL8B/sMYJ4E4MgyzVatC+6KBoqnX4fx/s6APiKnzTmi5zoFKCrrQ fu7I9K3V8A6QVItQsNaa1pL6uml4SKEDhdqQQMajg4OsTmX7dOkf7GYhYVnzsmUZ9p+T hyXnpXwBGWVLgkjnRiYmiv6WPIIxt5dJ7HSFNL6P5fv9mgjrBWnA59+UaubWJ22UIMZL q0Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="WJR0xm+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si12308343edq.137.2021.06.07.10.06.29; Mon, 07 Jun 2021 10:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="WJR0xm+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230395AbhFGRGB (ORCPT + 99 others); Mon, 7 Jun 2021 13:06:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:56986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230241AbhFGRGB (ORCPT ); Mon, 7 Jun 2021 13:06:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C0D9461029; Mon, 7 Jun 2021 17:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623085450; bh=zzJQore+lowtcv9O6JHxDMZEcl4v02jxhUQCoAvfyv0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WJR0xm+/yPCNzt4iDQlYCm2qtSjaU1XWDaEE6B6p9XKO2C26x9DHdooWSxqDsDRT+ AWID0+IdNcriBy360Z0sX07evETUwSvycTZwLsKRiXQXcforpxx6R7eboVitosTEFB LYV7HX3VldkR0gQ8vCNok+/jaRY0yYu7WetiSbhbcGf3o/xTnkQNE98877KqzxgI/e 1xshDzdYPfCxJz7RPE5rygSyGkucTOGBHCZv0hSGHT9Bk4iF1Jwwj5a6j6jNJiGaXQ IIRurX4C0zKIhGUEFhRDpJyBzHtKSEhHO9MDksr4j4uPPAEOb56qa9OeLmXeeqqKsh 2uIOjoW37m6dw== Date: Mon, 7 Jun 2021 18:04:03 +0100 From: Will Deacon To: Valentin Schneider Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , 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 v8 05/19] sched: Introduce task_cpu_possible_mask() to limit fallback rq selection Message-ID: <20210607170403.GA7650@willie-the-truck> References: <20210602164719.31777-1-will@kernel.org> <20210602164719.31777-6-will@kernel.org> <878s3peesp.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878s3peesp.mognet@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 06:10:46PM +0100, Valentin Schneider wrote: > On 02/06/21 17:47, Will Deacon wrote: > > Asymmetric systems may not offer the same level of userspace ISA support > > across all CPUs, meaning that some applications cannot be executed by > > some CPUs. As a concrete example, upcoming arm64 big.LITTLE designs do > > not feature support for 32-bit applications on both clusters. > > > > On such a system, we must take care not to migrate a task to an > > unsupported CPU when forcefully moving tasks in select_fallback_rq() > > in response to a CPU hot-unplug operation. > > > > Introduce a task_cpu_possible_mask() hook which, given a task argument, > > allows an architecture to return a cpumask of CPUs that are capable of > > executing that task. The default implementation returns the > > cpu_possible_mask, since sane machines do not suffer from per-cpu ISA > > limitations that affect scheduling. The new mask is used when selecting > > the fallback runqueue as a last resort before forcing a migration to the > > first active CPU. > > > > Nit: Some uses of this mask (cpu_is_allowed(), __set_cpus_allowed_ptr()) > don't apply to kthreads. This makes sense for the 32-bit@EL0 faff, but it > wouldn't hurt to point this out somewhere IMO. That's a good point: even after these patches, we still assume the kernel (and therefore kthreads) can run on all CPUs. I'll expand the comment. > Also, that's an odd place for the definitions, but IIRC there isn't a much > better choice. Short of adding a new header just for this, I couldn't find anything, no. > Reviewed-by: Valentin Schneider Thanks! Will