Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28470326rwd; Tue, 4 Jul 2023 20:37:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5yHijQ4xq0ZIT3At0nqclk8EjL/YUcQtOHgX11HDDbqmkcgSEb8g99g9OnbhSsIVyQWRuH X-Received: by 2002:a05:6808:3096:b0:39a:bd0e:43d with SMTP id bl22-20020a056808309600b0039abd0e043dmr15143006oib.36.1688528236198; Tue, 04 Jul 2023 20:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688528236; cv=none; d=google.com; s=arc-20160816; b=c0qdNcqanttzgPFieyO6uzvzFbiiL8zpRblXRXSQkTaZ5NmdQJkW3UkBWqkMc+Xc33 B35kSgpNFntDfmc1BnKp+HlXyYA2F7/dE/FXZvSFSfcU6lRyi1gIX7tJM6AdVWnIajMT 0J3AQhnXIJU/+yBUIdoyxBg51il+hx9M5B6apkOF9U83Nbx7/zPFDCrXbGmCNV07i1w/ hH7ZaNXvLNmlFG6U+LHQv6iRxV5CddxJXuoRIHKcTpWBZ6WlmPWDKzqTCbCt9GfKoymt 87i9DX3y/FHPx1+xbRsZR/VJglQYva9FeSaGPKE/2LigG9X1Iv9pJ5owX02+dpghFWaC uKtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nrkEIq6dhRR9ar//G8iVT0D1nMSlQSq+xiDuYGm9BDg=; fh=Az4CujeiZkDGBseNht6ZjBZsJdetflSrZYMud3jhLds=; b=i2uc2id0b9NY+MPw5VjDShUesoiKMqayzyOrPsDs1BgQSRUv3fl74b0JeoWgZ1y+jQ BXsp+67JcRtMQzUWRMNW5q8KYIBcfiq4bOMy6cXeLWJiDbJznuR2DK6hmI4IaGBQy7Dc qn4w3dBjQbravNsB/rXJoozymhfONws3MzqSgow90Dj5g1tFDJRaELuqwe4DbA2vYATv H2LRe+jBiwTEjK4rq/HCFQ3Uk+JRQJst5v491d2T2IKwwBrhANaTBKGaZcRuCQ9aZ9N1 9DvyV8uVAVLyDeiwZNlyHOumcsrAeyUvxpX+UjfazT1BLPMWzqIrwuBycNL/BaArx4iP qWOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hcZF4f+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a056a0022c400b006724753efe8si21612197pfj.192.2023.07.04.20.36.59; Tue, 04 Jul 2023 20:37:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hcZF4f+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230305AbjGEDOz (ORCPT + 99 others); Tue, 4 Jul 2023 23:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbjGEDOx (ORCPT ); Tue, 4 Jul 2023 23:14:53 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 073CE1B6 for ; Tue, 4 Jul 2023 20:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688526846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nrkEIq6dhRR9ar//G8iVT0D1nMSlQSq+xiDuYGm9BDg=; b=hcZF4f+B+aGPV4zsvmbDuRpL2WQXvk/HdzXSiWpJQdUpFdRuiglLVimMtlOEkWMazizC9m 7ZaxaHiBlVfE2jWKeqjgIu2ZdBtJDdOthrBAOI3evvdsL/jQn9I82oUNIgbh4H8zBhIhZB UdBv1ZV8BSuKNO6ZVWXTynINoh1XqxI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-111-67tYLv16ODq-ae5T52CHXA-1; Tue, 04 Jul 2023 23:14:02 -0400 X-MC-Unique: 67tYLv16ODq-ae5T52CHXA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 95B3D3806060; Wed, 5 Jul 2023 03:14:01 +0000 (UTC) Received: from [10.22.16.39] (unknown [10.22.16.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51F374087C6A; Wed, 5 Jul 2023 03:14:01 +0000 (UTC) Message-ID: Date: Tue, 4 Jul 2023 23:14:01 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] cgroup/cpuset: simplify the percpu kthreads check in update_tasks_cpumask() Content-Language: en-US To: Miaohe Lin , tj@kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230704113049.1019118-1-linmiaohe@huawei.com> From: Waiman Long In-Reply-To: <20230704113049.1019118-1-linmiaohe@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/4/23 07:30, Miaohe Lin wrote: > kthread_is_per_cpu() can be called directly without checking whether > PF_KTHREAD is set in task->flags. So remove PF_KTHREAD check to make > code more concise. > > Signed-off-by: Miaohe Lin > --- > kernel/cgroup/cpuset.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index 58e6f18f01c1..601c40da8e03 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -1230,7 +1230,7 @@ static void update_tasks_cpumask(struct cpuset *cs, struct cpumask *new_cpus) > /* > * Percpu kthreads in top_cpuset are ignored > */ > - if ((task->flags & PF_KTHREAD) && kthread_is_per_cpu(task)) > + if (kthread_is_per_cpu(task)) > continue; > cpumask_andnot(new_cpus, possible_mask, cs->subparts_cpus); > } else { The initial intention was to ignore only percpu kthreads. The current code likely ignore all the kthreads. Removing the PF_KTHREAD flag, however, may introduce unexpected regression at this point. I would like to hold off for now until more investigation are done. Thanks, Longman