Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5114269pxj; Wed, 26 May 2021 03:12:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVCmflqiJTpUgECdDWZt9KP3iHyZwOQRRCXPRjc1Cvgqv2o1U9X8GM5xaX2hToSXnZxtpE X-Received: by 2002:a02:cb04:: with SMTP id j4mr2339576jap.45.1622023961490; Wed, 26 May 2021 03:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622023961; cv=none; d=google.com; s=arc-20160816; b=G/FwUQ++eOFYiOpOJGXxXEourD/3kFtzVthTmY45yotoqj9/8QuaEdnRmWRl7Arxhf C0LRcvRts2UHT3C2v4xwhZzQ/SD2over4hArLC02n0bGH77TFePP7HRfbP9dY1p+Nkil 5+i8t6WKFqp76yNyT15kjjy+sulizFNskCs6Yqno6WuYzFV+44/CYVt5h6wJgAz8OPTG 9A/06M64FUBpxPpLhy8DsOU5NJhBIKyxBY7nsA8M3FGv81a4GjHazF1liTq3w46PLv7x AN2vTuaWY/cV1Zq9AzILhvAFsklM0xUgvNcwc3qfVxcJrVjrIcH0h6nKrbjssoJb4JCi Q0kA== 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=3QzXzv+77o6lFTXw+OfXqTizXKPmV5jNwKl9gTh1JlY=; b=tSrXaOzP8JQhs690Chn3mAcspLq/DyjCf+UqKOclJCXAfHqcHJ4EdpqCmNSJ7yIiMs NQ3ZzjEJ17f13AvQLfW4XDFmBw0TVtRye8Z8lPvECdj+2s9HrCoP9Kagnce21JfrDsgk PlE2HRfq05u1JU2E1Icuz84Jbo6OBIvtgA/q0X+Hf2eNZXIBTs4hVRlRStnD1vXeb5jq 6mMYjsORKfqsBxsDnAjP5MMKmMTErl+9c7+y7yRy7xyBuZdeiDik4ppSBVPWyo/p0dJr dJBhCMMVKVEbzX1tSlOZ0w5eJYDeL50PydE7tGcT1Juqbzd1/2DpUeTv7z11wWhVx6Qs ZGCg== 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 h21si21028072jav.99.2021.05.26.03.12.25; Wed, 26 May 2021 03:12:41 -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 S233789AbhEZKLv (ORCPT + 99 others); Wed, 26 May 2021 06:11:51 -0400 Received: from foss.arm.com ([217.140.110.172]:42482 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233758AbhEZKLu (ORCPT ); Wed, 26 May 2021 06:11:50 -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 ED71E1516; Wed, 26 May 2021 03:10:18 -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 B3B833F73B; Wed, 26 May 2021 03:10:17 -0700 (PDT) From: Valentin Schneider To: Frederic Weisbecker , Peter Zijlstra , Ingo Molnar Cc: LKML , Frederic Weisbecker , Thomas Gleixner , "Paul E . McKenney" , Daniel Bristot de Oliveira , Yejune Deng Subject: Re: [PATCH] sched: Fix PF_NO_SETAFFINITY blind inheritance In-Reply-To: <20210525235849.441842-1-frederic@kernel.org> References: <20210525235849.441842-1-frederic@kernel.org> Date: Wed, 26 May 2021 11:10:07 +0100 Message-ID: <87a6ohhklc.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Frederic, Sorry about that one; thanks for having dug into it. On 26/05/21 01:58, Frederic Weisbecker wrote: > One way to solve the PF_NO_SETAFFINITY issue is to not inherit this flag > on copy_process() at all. The cases where it matters are: > > * fork_idle(): explicitly set the flag already. > * fork() syscalls: userspace tasks that shouldn't be concerned by that. > * create_io_thread(): the callers explicitly attribute the flag to the > newly created tasks. > * kernel_thread(): > _ Fix the issues on init/1 and kthreadd > _ Fix the issues on kthreadd children. > _ Usermode helper created by an unbound workqueue. This shouldn't > matter. In the worst case it gives more control to userspace > on setting affinity to these short living tasks although this can > be tuned with inherited unbound workqueues affinity already. > (I just saw it got shoved into tip already, but in any case:) That makes sense to me. Regarding the UMH point, I don't believe there are others like it creeping around; otherwise we might've had to go with e.g. p->flags &= ~(... | (PF_NO_SETAFFINITY * !!(p->flags & PF_IDLE))) but per the above that doesn't seem necessary. Reviewed-by: Valentin Schneider