From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 EA88436D4E8 for ; Tue, 25 Nov 2025 01:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764032978; cv=none; b=XuDZz7WGQgJd9lt8YZpWRCmg6SRgwlejsx1C7Y87gFsSruPZzsSsbrxPTqemTzC+hJZRjj/vottNO/R6tNEaamQUlV1u5s3hvnMWoQN7y8Yx7Us44mJV/YnBGMlloimvDfTcLqKU4xbezK1QEkbDY2CysMAPTHe18BzHWcZ82GE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764032978; c=relaxed/simple; bh=6Z1BDcw1KlB4F6PpLLVbr9RimvJrrz5j4t3fEvmprvw=; h=From:Message-ID:Date:MIME-Version:Subject:To:Cc:References: In-Reply-To:Content-Type; b=dcsRU8ApszwyW/XgUc2mn3rCjTNeCFR9aCcit3NZqOMgnFZYr7CSZJThiyuH2C68W5rnO1wzkYv8Toi4Vv5tHfv6uH9Blvjt+2MQdXsPNAc9JAzPol73wJUnZ9FxD18y58n4Xr+ejWfd54+ygcbzc5ZAWOzt00aQE+k+2Z5xfx8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=Ol/qskY+; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=L7rFWSwY; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ol/qskY+"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="L7rFWSwY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764032975; 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=Nx/23Bwfo1PUIBqHCTdUdrkLmvnnrvsRIe7fjcVL5wo=; b=Ol/qskY+c2GD+iscXDaP0FqgZE6FQjv558iukBYaGRtTjaSI6wmkkV0HKRtPTiMw1mU3Ij a8KpuZWXCAQcUGXddFS0/yJ+EdCylYRh5EoWX1C1vn/9eyZkmzBof8/so1KHe9caMTRyNI 1onV5QZnG/htpbeDhlvGHOgt3WtyLPI= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-lDLHs97mORuA8QlPGz1w2g-1; Mon, 24 Nov 2025 20:09:34 -0500 X-MC-Unique: lDLHs97mORuA8QlPGz1w2g-1 X-Mimecast-MFC-AGG-ID: lDLHs97mORuA8QlPGz1w2g_1764032974 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-4ee27e24711so105494261cf.1 for ; Mon, 24 Nov 2025 17:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1764032974; x=1764637774; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:from:to :cc:subject:date:message-id:reply-to; bh=Nx/23Bwfo1PUIBqHCTdUdrkLmvnnrvsRIe7fjcVL5wo=; b=L7rFWSwYfPPYPcH3lh58efpmFljTsUbxQ/fs6lV5ppp0AJSyLd/vo+HBVkHNZM6eHH H9GmKAZBXJJlpnfoCqRTiuXOXPDhTFq1JjbNo122nEN6jrt7D4AXsWWbaGM7S989voGe Wv6Jm7m67khojFinKwq2uJacTweC7LM8bCOOZihE5KZDtKuY76OiLpMSLp+zymTS1bk2 J1vgdBZJ/RmITMQsZUvuC62p8ip04OMeRBXqDZeAE6eyHBVu2teQregTksEmv51o0TAq /rf4hHinQ1oOOOS0eVaTO296cpmAcCZabNL490NbkzQ+GOWTKUjJ82T22b1BVT/kYJl4 i14Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764032974; x=1764637774; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Nx/23Bwfo1PUIBqHCTdUdrkLmvnnrvsRIe7fjcVL5wo=; b=JTxLl63CLMFoacyq3+LCM7/s+aQoLzUUb0ZcyWoGM8N/xrsqoN7atZaycbj8q+g7vX NBdT3MxjSn8BkrY+5/gzNuVQFPMcY1js6HXWWW2u+R+LNnWw9AQIaAEHBqlLMpEP9wny 1MGZwNVC1L/aQz4XQje8sRqj6a0oyTxjooPMo4EJZiwOQ5YA6aaMRpS52G+0HJQhCQac arj+EW4MF7upmDF+WsiEPOvg1UuhcPUp8yE3xXdQkpzy8UF+UPARQ2Wpul15OaZ6H/VP UItQenbQJmmK9feO3PxcNnp874quyRkBdGW1SrrH4Riw4UeOrD3etfW+kqwKaJ6H8+dc Iu+g== X-Forwarded-Encrypted: i=1; AJvYcCXc6iJ2MSlujWzCqIDlNgskfw4SHWmI5vw/RwbyPpP4iO1MRModg6oHa6bIFH8f1ht8HPLOkyrQPtMZ5qs=@vger.kernel.org X-Gm-Message-State: AOJu0YxP4sBxBvRicR5/2Tmu94U8NLajxk8BkAEDV4Ld2td1+zLJ5XKO CAH8bPIoxl44wIvK3PTRzOIXphpjs8JB1N/eZPyTdf1InO6MB0rqGqVLBy0sOMxWA/We1m6PWx6 Jrnz4ZOrGCVM0JXQMyHCId/BK8+dlnhNrkmRtbj7AdbC3FXU/jq+9lYCP5y0G3CF67w== X-Gm-Gg: ASbGnctyjOv1C5jqm5OjT6Glvk+gl5xNGVu/BoYvYNWQE2nuloCK+ulrctNqKx/k/lb 4ZwPL/dZz6WG5oX+bX5F2JwcF8kLOBHOBNheMH87IxutZ7fOMkg7CiMl5Wy1a85q9BuwbBExTYw uxGi1zxNw52HoOl8U73BWs04OdgYd21fZpmCOA5xYeShwQCaOBoRj/XWpwgZkaSr9EIryYk/JQL w12u9RC10vgis54dDqeaog/XVME/xg210d4AHk515M+bktey1fiY6FnRhE9W04/r5pAqx/OSaNt yTYtwH5x4sDTHwARObq50bs+iCsISUO72+LsMG7W5Vk/6boR5Y8ydyEf/+gJFkYbctIdfJRkJco +HR9NT80jqf8GVQPygpW10PkbXJUkHcJU1H3S1NkkcQUrw0w1S1TsM0f1 X-Received: by 2002:a05:622a:1792:b0:4ee:1dd0:5a47 with SMTP id d75a77b69052e-4ee58b2bc3fmr163064531cf.76.1764032973809; Mon, 24 Nov 2025 17:09:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKDhpFuUZ96pCci0ccMK1NkhxOsb3GvFntKeSxw5SW4EgxzEvHWARR7mZWAzHTozk0dAIJig== X-Received: by 2002:a05:622a:1792:b0:4ee:1dd0:5a47 with SMTP id d75a77b69052e-4ee58b2bc3fmr163064301cf.76.1764032973356; Mon, 24 Nov 2025 17:09:33 -0800 (PST) Received: from ?IPV6:2601:188:c102:b180:1f8b:71d0:77b1:1f6e? ([2601:188:c102:b180:1f8b:71d0:77b1:1f6e]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4ee48e8ecfcsm94548801cf.29.2025.11.24.17.09.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Nov 2025 17:09:32 -0800 (PST) From: Waiman Long X-Google-Original-From: Waiman Long Message-ID: Date: Mon, 24 Nov 2025 20:09:31 -0500 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 00/21] cpuset: rework local partition logic To: Chen Ridong , tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, lujialin4@huawei.com, chenridong@huawei.com References: <20251117024627.1128037-1-chenridong@huaweicloud.com> <2943236a-bb0e-4417-aee4-31146988709a@huaweicloud.com> Content-Language: en-US In-Reply-To: <2943236a-bb0e-4417-aee4-31146988709a@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/24/25 7:49 PM, Chen Ridong wrote: > > On 2025/11/17 10:46, Chen Ridong wrote: >> From: Chen Ridong >> >> The current local partition implementation consolidates all operations >> (enable, disable, invalidate, and update) within the large >> update_parent_effective_cpumask() function, which exceeds 300 lines. >> This monolithic approach has become increasingly difficult to understand >> and maintain. Additionally, partition-related fields are updated in >> multiple locations, leading to redundant code and potential corner case >> oversights. >> >> This patch series refactors the local partition logic by separating >> operations into dedicated functions: local_partition_enable(), >> local_partition_disable(), and local_partition_update(), creating >> symmetry with the existing remote partition infrastructure. >> >> The series is organized as follows: >> >> 1. Infrastructure Preparation (Patches 1-2): >> - Code cleanup and preparation for the refactoring work >> >> 2. Introduce partition operation helpers (Patches 3-5): >> - Introduce out partition_enable(), partition_disable(), and >> partition_update() functions. >> >> 3. Use new helpers for remote partition (Patches 6-8) >> >> 4. Local Partition Implementation (Patches 9-12): >> - Separate update_parent_effective_cpumask() into dedicated functions: >> * local_partition_enable() >> * local_partition_disable() >> * local_partition_update() >> >> 5. Optimization and Cleanup (Patches 13-21): >> - Remove redundant partition-related operations >> - Additional optimizations based on the new architecture >> >> base-commit: 6d7e7251d03f98f26f2ee0dfd21bb0a0480a2178 >> >> --- >> >> Changes from RFC v2: >> 1. Dropped the bugfix (already merged/fixed upstream) >> 2. Rebased onto next >> 3. Introduced partition_switch to handle root state switches >> 4. Directly use local_partition_disable()—no longer first introduce >> local_partition_invalidate() before unifying the two >> 5. Incorporated modifications based on Longman's suggestions >> >> Changes in RFC v1: >> 1. Added bugfix for root partition isolcpus at series start. >> 2. Completed helper function implementations when first introduced. >> 3. Split larger patches into smaller, more reviewable units. >> 4. Incorporated feedback from Longman. >> >> Chen Ridong (21): >> cpuset: add early empty cpumask check in partition_xcpus_add/del >> cpuset: generalize the validate_partition() interface >> cpuset: introduce partition_enable() >> cpuset: introduce partition_disable() >> cpuset: introduce partition_update() >> cpuset: use partition_enable() for remote partition enablement >> cpuset: use partition_disable() for remote partition disablement >> cpuset: use partition_update() for remote partition update >> cpuset: introduce local_partition_enable() >> cpuset: introduce local_partition_disable() >> cpuset: user local_partition_disable() to invalidate local partition >> cpuset: introduce local_partition_update() >> cpuset: remove update_parent_effective_cpumask >> cpuset: remove redundant partition field updates >> cpuset: simplify partition update logic for hotplug tasks >> cpuset: use partition_disable for compute_partition_effective_cpumask >> cpuset: use validate_local_partition in local_partition_enable >> cpuset: introduce validate_remote_partition >> cpuset: simplify the update_prstate() function >> cpuset: remove prs_err clear when notify_partition_change >> cpuset: Remove unnecessary validation in partition_cpus_change >> >> kernel/cgroup/cpuset.c | 1014 ++++++++++++++++++---------------------- >> 1 file changed, 453 insertions(+), 561 deletions(-) >> > Hi Longman, > > I would greatly appreciate it if you could review this series when you are available. > I was expecting a v3 and so I had probably missed it. Will take a look sometimes this week. Cheers, Longman