Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp130051lqd; Tue, 23 Apr 2024 18:01:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX37tFgdQ7BM4VSgEE5Ce348WJVpd5PebJ7uQOruU+0hcDTS5D0H0pX9ZkzoFRA2iUfsgHKxYvhpp4qhKAM1QO5Kj12OV9kYOVvRZ6h7w== X-Google-Smtp-Source: AGHT+IH/BMBNLqEH/+9M75IBvAc+Vm19RGerfwbwTo0Q1jyRXxjX92C6ycgyT0ep9E8wPGxZMxyN X-Received: by 2002:a05:620a:571a:b0:78e:9714:b097 with SMTP id wi26-20020a05620a571a00b0078e9714b097mr337173qkn.62.1713920462988; Tue, 23 Apr 2024 18:01:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713920462; cv=pass; d=google.com; s=arc-20160816; b=sG7/OxIiWprJRdWFScAPrEQ+qaT2yvm/KJdMmwU6IJXPGYrzuToSS5GikLnqtLk2sb TaNip/oGL9rLGWcLk4O5gNntScB311+FZSKSqJkS5ZWu9An1LUj2wy0fvloBFzfTbryT ADgxXd0BYhPOUvOTV3KmSe/2gxnG7omDneUdVV3lkFLYU+HLO6Gx9vaxZiq3kpHDUg6f D2/HVdII4PgKE5PfTkqQqMdcrGw9h3p06kUaYBSmDDHeJ8a03y4MOMAqj3yKNDgvV1T7 ZgHpdvXfuqCgbkN4ZBk2j/zjqj8ZckCvGW5GgO67zoHeQuFufKl7f54ftseRru1tyRCO YbBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=/a5fhFSmdofMCiLnLbJwkC2x6hk67MrQy10O1DXKAP4=; fh=PBDRE0AFKmm6BYQOWxF/ebhIK85+BsS/A2oKSqHDpyM=; b=I/BpTszNGDPRvV6F0QQk49luW3D0h7p9DrMCdxx1WaxM5AKnDNPwx2SJSthEdVd1AW 0jfhw6Wg/cOH9CQvObMZDWFl7v78pk2XzdT3YBdswcghz4OnVNe7XSlNt8i+T5BneurU mJs2dcP/gHfC+uyWiaV01f80paYGWyLwqDpF15PmlzjUI25bGj6stwPH4A6dG/LfFeuF WBfdBFKKNQsFhAFb77LnTvhVzp9wuQUfmYbhQh8B49sjc0to98PySDEJXfWpGeQfkNlh zdsxIHM+CvuIdEAHTK/9LfZK67RrcQotkz3vebW1j2sL1iankkxZcHy8doAJD8hhxaGV RHEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QSU3tD8g; 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-156069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156069-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z37-20020a05620a262500b0079064cd59f8si10277760qko.96.2024.04.23.18.01.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 18:01:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QSU3tD8g; 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-156069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156069-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B45511C220EB for ; Wed, 24 Apr 2024 01:01:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CAD34C8D; Wed, 24 Apr 2024 01:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QSU3tD8g" 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 EF8F923BE for ; Wed, 24 Apr 2024 01:00:54 +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=1713920456; cv=none; b=uEnUUAWik9hE0zKx+guBbb0GAT65OMHmGsW282/0XQL7O8FfQ7DmBySt0/Y8fpgWAORqR/p/5zT0w4wAx3LyhrArWVn6b7jV8BJZvxwgu3Y7UlkPdyaqwaZOAOAnx8GPMOYeRSLocmjdf+FWQ8qiJt0F42goR+JOZ0dSkPrqnCQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713920456; c=relaxed/simple; bh=S+0/yfWEbTG33zVAf3a7JUyadtPHjguQhf9rNUpBUYU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=YMkfH/y3faka01wFDzkf765Y1RAtK8FK7yKTy0tNf7VUv82o70NsvS4WWODFD0zt3e+aflzvcY7mRoN9R6N8CcVH27jsEpHkKu9dCiXr7Ej3Gpn7QW9eSMXxfqTfHMZ8AfywNTukhqFO809QBTmxRrZ19thagJ5bKEze+Vw7nkA= 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=QSU3tD8g; 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=1713920453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/a5fhFSmdofMCiLnLbJwkC2x6hk67MrQy10O1DXKAP4=; b=QSU3tD8gtBkaPxftav6dtF9IOJgPuA4IGoaoKFOBGhAyasQwTnXGeZJ3usKQy3bOkHb2T+ Uh8IYQrvmhcuJPsuEp5tpFarKqFnUYTB5aRz+2UXEpMJ8E9ozw+94l69REukxCJCQUoyAN 2S6azcBoL15gQISEDnpMNCmJqZ4dyfw= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-131-Ou3fZRdJMUu6vLcO4XX7Uw-1; Tue, 23 Apr 2024 21:00:49 -0400 X-MC-Unique: Ou3fZRdJMUu6vLcO4XX7Uw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 3E5CB385A185; Wed, 24 Apr 2024 01:00:49 +0000 (UTC) Received: from llong.com (unknown [10.22.33.184]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5757C13FA3; Wed, 24 Apr 2024 01:00:47 +0000 (UTC) From: Waiman Long To: Tejun Heo , Zefan Li , Johannes Weiner Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Xiu Jianfeng , Waiman Long Subject: [PATCH-cgroup] cgroup/cpuset: Fix incorrect top_cpuset flags Date: Tue, 23 Apr 2024 21:00:20 -0400 Message-Id: <20240424010020.181305-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Commit 8996f93fc388 ("cgroup/cpuset: Statically initialize more members of top_cpuset") uses an incorrect "<" relational operator for the CS_SCHED_LOAD_BALANCE bit when initializing the top_cpuset. This results in load_balancing turned off by default in the top cpuset which is bad for performance. Fix this by using the BIT() helper macro to set the desired top_cpuset flags and avoid similar mistake from being made in the future. Fixes: 8996f93fc388 ("cgroup/cpuset: Statically initialize more members of top_cpuset") Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index e70008a1d86a..b0a97efa5f20 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -368,8 +368,8 @@ static inline void notify_partition_change(struct cpuset *cs, int old_prs) } static struct cpuset top_cpuset = { - .flags = ((1 << CS_ONLINE) | (1 << CS_CPU_EXCLUSIVE) | - (1 << CS_MEM_EXCLUSIVE) | (1 < CS_SCHED_LOAD_BALANCE)), + .flags = BIT(CS_ONLINE) | BIT(CS_CPU_EXCLUSIVE) | + BIT(CS_MEM_EXCLUSIVE) | BIT(CS_SCHED_LOAD_BALANCE), .partition_root_state = PRS_ROOT, .relax_domain_level = -1, .remote_sibling = LIST_HEAD_INIT(top_cpuset.remote_sibling), -- 2.39.3