Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2473181lqt; Mon, 22 Apr 2024 11:39:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQfhZVo3OOgYGCIdfIuY0zitT3W68JwJINTFQXOHWPBVyP5C/yFxOiHCiySc57s1yL+MqdE428mbtkPCjpgZFWpFxWoUtDFTjxw3v0Dg== X-Google-Smtp-Source: AGHT+IGhULyxXCFGHHZrkhQWlnhrnP7p/Goq02eggZ5psYKLM4EXT1PW+lx0r81VKMAn7HY9rsv1 X-Received: by 2002:a05:6a20:4aa9:b0:1aa:411d:a8e with SMTP id fn41-20020a056a204aa900b001aa411d0a8emr11276551pzb.62.1713811161326; Mon, 22 Apr 2024 11:39:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713811161; cv=pass; d=google.com; s=arc-20160816; b=U+GC/G2PdD3vIP40IxOQRbSkqSMDswcG91kez5VBTVRGrO1lGNUPulTHY6shqgqcki SWBKvb+6vlUngO3Zutq9BPXsCeCJUqTr0s9ZYN0Fyy9mcqgXcFbSTjo1tT81Yyglok8V 23UHsPEfo94EkFrvJ8n6qdjdSiaiRFK9IE4gADcTaW2tVDbDDL7J8zUc28inJRp4wJLm Ut0x2Z3PbR9NOXDK35mYyrYLA6vvLSq1QUEisqzYL5lHXh+EY8DbBG+f7wo1HMGggxNA EBPviv2bmC/1JIMqTbUREddxjB+QY1trXos8EHQO4CAWyr0sx32emvqiu/G8x9QEdYuI HWMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=YOsdhDWuSUFMXxTqd4Lt3sQHh6IbAPnGtwXA6iPfEJ8=; fh=H4UMJDtxejWT8MoSRyTn71QzRR5CrCcXuRBwqCo5b8s=; b=evr1nUB5hVzNqoXLKSc9zYD/mHDhfri4g1tqt194BlxheHiypDP5m51AQVoNFHNQCT rl6E+W2qndnnHYLiD9LvRUIrnaBWpCGbcIxhKHbYA1cFueeG6EKWF7Emw8TbdWaJI0Zi 1RYWYkBCD1JE2TAGeLmDeduwUwiwKJvrIAnTihYFVS8HJ5blHfrp7wJveiNDKYJjfLb0 d8yxHJNEVXp5NFKdIeBt5QQ0RzZ3Kv+v36UrCC/9VkLgG6RmnqbV2cVWPYdi6K7THbzt M1/ng1GgEARw64GvwA1AUJHPDJ4Iu72/XZ/4cs22VOwEzfjN4ChuuzOEQPRakNliyut5 EAXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KFknq1a0; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-153845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bw7-20020a056a02048700b0060337f1d7c1si102896pgb.462.2024.04.22.11.39.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 11:39:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KFknq1a0; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-153845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 78D29B21959 for ; Mon, 22 Apr 2024 18:39:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F5DA154BFF; Mon, 22 Apr 2024 18:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KFknq1a0" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58450153837 for ; Mon, 22 Apr 2024 18:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713811132; cv=none; b=rNe9adfZoioF+21mg+WT4zBO/7rIYFyaUAGiOV07j0RzVjIczDYZVBt1nUwOvZ+WWketaWPLxao07Wgk9d8uH139bR1l0kK/SiTNUUz3jf+YyAZIIdBB2aNuk0e2HoQde8NEe5vdsWOD+gUs2GPJ9bk4m8MVTAsvWWiIWpOX858= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713811132; c=relaxed/simple; bh=twuLgGtiggTWXRs+LZFj1YP8jXpFbLjDXPzT7EG9VOg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oAuxk9Tqsz/d84XRqVljQd1jHiK57R1MS2IOCjC61IIZGL7odtbIZvUi3LXKCyjuPuacEr9O/v96NYlWOPfSI406pzbz0XGvRb7z8RuWSP53wxfAHlBNey7ZTy4hAoXMTfy5b+oVjzFA//0pBVGHMBYKcjiSDeJVeORMEImYTeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KFknq1a0; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713811130; 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=YOsdhDWuSUFMXxTqd4Lt3sQHh6IbAPnGtwXA6iPfEJ8=; b=KFknq1a0rxtFoh0cVfYGWOts777nD5hdiUB8OeDdNDKTlmC1Yfes1jeuG4/rMBgLwJT/qM qK54YNMg5gucTMIwHiXLqHdVB/P6EO8JL4IIHf/Cgbz9ei1cFwTYBL1dm7MBk1wJK49vXS Mic36PY8kAAfEN1yYN8QgP/Lo2LFJho= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-ptsEVJUbNAKkKg-J4OfEiQ-1; Mon, 22 Apr 2024 14:38:45 -0400 X-MC-Unique: ptsEVJUbNAKkKg-J4OfEiQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 390A980591B; Mon, 22 Apr 2024 18:38:45 +0000 (UTC) Received: from [10.22.32.240] (unknown [10.22.32.240]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1232200AE7F; Mon, 22 Apr 2024 18:38:44 +0000 (UTC) Message-ID: Date: Mon, 22 Apr 2024 14:38:44 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice To: Xiu Jianfeng , lizefan.x@bytedance.com, tj@kernel.org, hannes@cmpxchg.org Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240420094713.1028579-1-xiujianfeng@huawei.com> Content-Language: en-US From: Waiman Long In-Reply-To: <20240420094713.1028579-1-xiujianfeng@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 On 4/20/24 05:47, Xiu Jianfeng wrote: > In cpuset_css_online(), CS_SCHED_LOAD_BALANCE has been cleared in the > is_in_v2_mode() case under the same condition, don't do it twice. > > Signed-off-by: Xiu Jianfeng > --- > kernel/cgroup/cpuset.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index e70008a1d86a..159525cdaeb9 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -4059,13 +4059,6 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) > clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags); > } > > - /* > - * For v2, clear CS_SCHED_LOAD_BALANCE if parent is isolated > - */ > - if (cgroup_subsys_on_dfl(cpuset_cgrp_subsys) && > - !is_sched_load_balance(parent)) > - clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags); > - > spin_unlock_irq(&callback_lock); > > if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags)) Thanks for catching this duplication. Could you remove the check inside is_in_v2_mode() instead? is_in_v2_mode() can be true for cgroup v1 if the"cpuset_v2_mode" mount option is specified. That balance flag change isn't appropriate for this particular case. Thanks, Longman