Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp741302pxj; Thu, 10 Jun 2021 11:30:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8v8Z4xhfil1f7sbWblPp8mLYrD0m58MkDpq87bgQSN4odm95A3IBxROJd2+OQ61EOpBf5 X-Received: by 2002:a17:906:4dd1:: with SMTP id f17mr19901ejw.528.1623349859217; Thu, 10 Jun 2021 11:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623349859; cv=none; d=google.com; s=arc-20160816; b=tlVNAbBLN9/s3u4QPegyXh2JiDSKdzwiaK7m1gCu/uu8oMLt75OJ39C6rzEclr0O2j xdrIXJF/GhCT70U1udz46EbPajG1yTMHg/SxEmzLVMk/BKvJsih1szJQy4zhZh/9ZbRy jk11mLzCKhqw1DfCjPhlT4anl/yMEPMsrZ/4E1WExN2zU5f/aZ+Cs1nxu7sBJVu31Rf5 bY/aYaN+LOG21ndRpocqV4aHJZNqZ+z5+gdet0jy6ww9SocktKZ9IcLyoVsXjIz09cA8 U4D3AQx/2+TcfbmeQx97XqEgRc9IvjKiSQU+euN+feWOj+kowDcn9+jVVZrwSbnWY5iT i4/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=t0TPxWA7ipfHIetubiDR78m63mI7gsxVFOvJoDXyK+M=; b=XrlzthElp+YlLkTHjKDco9BNRfiGqh4t41DzYktSZ50pIyCe8+ZIoOPlBDAwlhdS3B lGV3LUXv9uq+4TJrcn0zqlsnNEaLB/iXJO4mKU1Pz9oIvoeGAPVmPzUz9iJyTTNBAbvt s3cyQIQLZcuQGVdkloVQpdcaiyFb8pikhBKsPsZCMyqRPO/1l5CHeiTtoK2fNt8LkEKM Qf8z8KP/oFFIu+OKGAaorIrCgXd/N4cVGniaPDLqmrg6vxmG56YK0b72arTJ6KHP+NSr YJ/vc3g6ESReBs7qOLK8Vzb6mZCRvDvtZYxm+kKjn4L/z0TyCvLrL3w7W31TRcQr0Jip ySeg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m12si2860941edi.558.2021.06.10.11.30.34; Thu, 10 Jun 2021 11:30:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230311AbhFJSbA (ORCPT + 99 others); Thu, 10 Jun 2021 14:31:00 -0400 Received: from foss.arm.com ([217.140.110.172]:38938 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230084AbhFJSbA (ORCPT ); Thu, 10 Jun 2021 14:31:00 -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 99DFC106F; Thu, 10 Jun 2021 11:29:03 -0700 (PDT) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0DCD73F719; Thu, 10 Jun 2021 11:29:02 -0700 (PDT) From: Valentin Schneider To: paulmck@kernel.org, frederic@kernel.org Cc: linux-kernel@vger.kernel.org Subject: Re: Question about a8ea6fc9b089 ("sched: Stop PF_NO_SETAFFINITY from being inherited by various init system threads") In-Reply-To: <20210610170435.GA2187550@paulmck-ThinkPad-P17-Gen-1> References: <20210610170435.GA2187550@paulmck-ThinkPad-P17-Gen-1> Date: Thu, 10 Jun 2021 19:28:57 +0100 Message-ID: <8735tpd15i.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/06/21 10:04, Paul E. McKenney wrote: Hi, > Hello, Frederic, > > This commit works well, but has the unfortunate side-effect of making > smp_processor_id() complain when used in a preemptible region even > though the kthread has been pinned onto a single CPU by a call to > set_cpus_allowed_ptr(). (Which did return success.) > On which tree are you encountering this? Looking at check_preemption_disabled() and CPU affinity, v5.13-rc5 has: /* * Kernel threads bound to a single CPU can safely use * smp_processor_id(): */ if (current->nr_cpus_allowed == 1) goto out; tip/sched/core additionally hinges that on PF_NO_SETAFFINITY: 570a752b7a9b ("lib/smp_processor_id: Use is_percpu_thread() instead of nr_cpus_allowed") The former shouldn't be affected by Frederic's patch, and the latter should only cause warnings if the pinned task isn't a "proper" kthread (thus doesn't have PF_NO_SETAFFINITY)... Exceptions that come to mind are things like UMH which doesn't use kthread_create(). > This isn't a big deal -- I can easily switch to raw_smp_processor_id(), > which is arguably a better choice anyway because it prevents the > complaints from flooding out any real warnings due to error returns > from set_cpus_allowed_ptr() or something else unpinning the kthread. > Which I am in the process of doing: > > 516e52e9f5ec ("scftorture: Avoid excess warnings") > 475d6d49f21d ("refscale: Avoid excess warnings in ref_scale_reader()") > > But I figured that I should check to see if this change was in fact > intentional. > > Thanx, Paul