Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2656383lqt; Mon, 22 Apr 2024 18:40:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeYdhxFcOWvw2rqWbXaUKyL5nsVQukwxhEPRFxuOVQeH8OxtvNa/CWMgVzt/d/OR/YYzuRlabfkCylKZCld0TuLtB3nWllWWO7bCdMdQ== X-Google-Smtp-Source: AGHT+IE6uTtfsg7MU//7MbO6VYOxW/wdUa24RD+XovxIoUws7k0c7bTbr4CDo5JOv0FkqqPzY+dB X-Received: by 2002:a17:902:c40c:b0:1e4:2b90:7282 with SMTP id k12-20020a170902c40c00b001e42b907282mr16766938plk.14.1713836422878; Mon, 22 Apr 2024 18:40:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713836422; cv=pass; d=google.com; s=arc-20160816; b=mwkAXIeL65JNFhY2RlewRetWiPcn+qt9kN/rVrgv6kF3XMT9fhOQ/bDHGEouok8zs4 32p6bkZR2ZeVUT22qrM2qQCX99g0Go/AJixGrcyeQGR+NJCz9JpbUysKaT1JhM57Su1N 1Qk6kgzlMUoULjq5oJVifj5OYypb+b8OOqijEhh+222KfE/BRFL9H6B3i8axOFw+WG9F pBapOqoO7jpYcwja6BPzJ3AxVDVNmIoQRVq9zL2eAlj5WKG5AbZbUwTi35HXWcLEcZ/A DYwnjnqPSatQu234Uedw/TQ631lPpKqLSLIVpYdSOM0HMB7eFkWneWfxrqiAdbbOwhki Fdzw== 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:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=EE2BYXsJ8LiH2P5yqWH0Qe2Q79z72Yl0fHpEK51q+ZM=; fh=cQW/UGznpqN2YEHv6NiC522wJs8w8+kjwnLCcqq1zJ4=; b=eHHl65BkX5eebk0hJmJ5KzrLa20hKxdzs5BWINscswWBHt8uF2rG7w6+LTpMBRCEA5 WAdPa37Y1+jTpCduJU7gESgDYypcYkgo1jzk555WcjSdoj+fCTCiLeteRvLoyE3rs0z7 mGDb7cjyAxZi6V66j3/3kg3P57ir0RgfsILDksnh5oac6U7L9gS4h/oy3071lkj14Pwb jc9BzXqUS9aR8WqJMy5juDufV/qfAwWmNZX7NelKU2O28mnNIALMYd3lsBv4zeEKGIVH cm1o1QY+1rD2ETQ8XcTHr99MGZDQK696CiGcIMDUAdD/Vn58a0zpcTBMun3TbV2wigri gQAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-154397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b9-20020a170903228900b001e264881bc3si8827241plh.130.2024.04.22.18.40.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 18:40:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-154397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7812A2856FD for ; Tue, 23 Apr 2024 01:40:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71555134B2; Tue, 23 Apr 2024 01:40:16 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 11441FC18; Tue, 23 Apr 2024 01:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713836416; cv=none; b=hzcPrne4HKsmsi5U3o1fGyZgMtYRKJp44+J97eXuiZuX+ry7bXB/ccIy9iX5GWABoKs+UX3Ivy9v8jtNIKDXYGpBXvebZQ+D8+y+KLC/gORWOdhPYkRF7SWSgr10yVSHPkLojklSDnlRTMR4Hu5A2cKqv4nkT8NpSWC+B4ELTnU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713836416; c=relaxed/simple; bh=C3q9CN1Aw3AQlHj+PYz1Ias/ZokIKQ8/J+ECE84ngOQ=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=OnY3usF3yqLGDtai4TkZaHlZROfV9TJVw6ezSoxQwi6+reGTmOskBjW8oIgV3Z13ZdFymv6dh4W5REf/+c2Ft+SVtqf3NNakgYlzctw9OAdBvkbcQsbh0KQXEBUwxg/GO6VVc6kanCgg84x/z/8sXsQAsGdONCg26V1MGgKaQCQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VNl8V6cMvzXmKG; Tue, 23 Apr 2024 09:36:42 +0800 (CST) Received: from dggpeml500023.china.huawei.com (unknown [7.185.36.114]) by mail.maildlp.com (Postfix) with ESMTPS id 4E15E140136; Tue, 23 Apr 2024 09:40:10 +0800 (CST) Received: from [10.67.110.112] (10.67.110.112) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 23 Apr 2024 09:40:10 +0800 Message-ID: <8bfc0013-8268-0e7e-1ee0-99ad04b0b467@huawei.com> Date: Tue, 23 Apr 2024 09:40:09 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice Content-Language: en-US To: Waiman Long , , , CC: , References: <20240420094713.1028579-1-xiujianfeng@huawei.com> From: xiujianfeng In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500023.china.huawei.com (7.185.36.114) On 2024/4/23 2:38, Waiman Long wrote: > 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. Sure, thanks for explanation, will do in v2. > > Thanks, > Longman >