Re: [PATCH] selftests/cgroup: Fix awk usage in test_cpuset_prs.sh that may cause error

2023-09-26 Thread Waiman Long
uot; | sed -e "s/.*:[[:space:]]*//") Yes, the -e option is redundant. Thanks for catching that. Acked-by: Waiman Long

[PATCH-cgroup] cgroup/cpuset: Enable invalid to valid local partition transition

2023-09-29 Thread Waiman Long
tps://lore.kernel.org/lkml/9777f0d2-2fdf-41cb-bd01-19c52939e...@arm.com Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c| 79 +++ .../selftests/cgroup/test_cpuset_prs.sh | 17 ++-- 2 files changed, 59 insertions(+), 37 deletions(-) diff --git a/ke

Re: [PATCH-cgroup] cgroup/cpuset: Enable invalid to valid local partition transition

2023-10-02 Thread Waiman Long
# echo isolated > cgroup/B1/cpuset.cpus.partition # cat cgroup/A1/cpuset.cpus.partition member # cat cgroup/B1/cpuset.cpus.partition isolated invalid (Cpu list in cpuset.cpus not exclusive) <--- Complete message printed On 9/30/23 05:44, Waiman Long wrote: When a local partition becomes

Re: [PATCH-cgroup] cgroup/cpuset: Enable invalid to valid local partition transition

2023-10-03 Thread Waiman Long
d cpu list overlap, it will become a valid partition. However, change to A1 to avoid cpu overlap won't affect the state of B1. You will have to echo "root" to B1's cpuset.cpus.partition to make it valid again. On 9/30/23 05:44, Waiman Long wrote: When a local partition beco

[PATCH-cgroup v2] cgroup/cpuset: Enable invalid to valid local partition transition

2023-10-03 Thread Waiman Long
tps://lore.kernel.org/lkml/9777f0d2-2fdf-41cb-bd01-19c52939e...@arm.com Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c| 79 +++ .../selftests/cgroup/test_cpuset_prs.sh | 21 +++-- 2 files changed, 62 insertions(+), 38 deletions(-) v2: Add documen

[PATCH-cgroup 0/4] cgroup/cpuset: Improve CPU isolation in isolated partitions

2023-10-13 Thread Waiman Long
t the HK_FLAG_DOMAIN cpumask or other HK_FLAG_* cpumasks and exclude the isolated CPUs from certain actions to further reduce interference. CPUs in an isolated cpuset partition will not be able to avoid those interferences yet. That may change in the future as the need arises. Waiman Long (

[PATCH-cgroup 1/4] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-10-13 Thread Waiman Long
cpuset partitions, a new wq_user_unbound_cpumask is added to store the user provided unbound cpumask either from the boot command line options or from writing to the cpumask sysfs file. This new cpumask provides the basis for CPU exclusion. Signed-off-by: Waiman Long --- include/linux/workqueue.h |

[PATCH-cgroup 4/4] cgroup/cpuset: Take isolated CPUs out of workqueue unbound cpumask

2023-10-13 Thread Waiman Long
.rst to mention that isolated CPUs will be excluded from unbound workqueue cpumask as well as updating test_cpuset_prs.sh to verify the correctness of the new *cpuset.cpus.isolated file, if available via cgroup_debug option. Signed-off-by: Waiman Long --- Documentation/admin-guide/cgroup-v2

[PATCH-cgroup 2/4] selftests/cgroup: Minor code cleanup and reorganization of test_cpuset_prs.sh

2023-10-13 Thread Waiman Long
Minor cleanup of test matrix and relocation of test_isolated() function to prepare for the next patch. There is no functional change. Signed-off-by: Waiman Long --- .../selftests/cgroup/test_cpuset_prs.sh | 142 +- 1 file changed, 71 insertions(+), 71 deletions(-) diff

[PATCH-cgroup 3/4] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-10-13 Thread Waiman Long
Add a new internal isolated_cpus mask to keep track of the CPUs that are in isolated partitions. Expose that new cpumask as a new root-only control file ".__DEBUG__.cpuset.cpus.isolated" when cgroup_debug command line option is specified. Signed-off-by: Waiman Long --- kernel/cgrou

Re: [PATCH-cgroup 3/4] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-10-18 Thread Waiman Long
On 10/18/23 05:26, Tejun Heo wrote: On Fri, Oct 13, 2023 at 02:11:21PM -0400, Waiman Long wrote: ... @@ -3875,6 +3931,13 @@ static struct cftype dfl_files[] = { .flags = CFTYPE_ONLY_ON_ROOT | CFTYPE_DEBUG, }, + { + .name = "cpus.iso

Re: [PATCH-cgroup 1/4] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-10-18 Thread Waiman Long
On 10/18/23 05:24, Tejun Heo wrote: Hello, On Fri, Oct 13, 2023 at 02:11:19PM -0400, Waiman Long wrote: When the "isolcpus" boot command line option is used to add a set of isolated CPUs, those CPUs will be excluded automatically from wq_unbound_cpumask to avoid running work func

Re: [PATCH-cgroup 3/4] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-10-18 Thread Waiman Long
On 10/18/23 14:08, Tejun Heo wrote: On Wed, Oct 18, 2023 at 09:30:04AM -0400, Waiman Long wrote: On 10/18/23 05:26, Tejun Heo wrote: On Fri, Oct 13, 2023 at 02:11:21PM -0400, Waiman Long wrote: ... @@ -3875,6 +3931,13 @@ static struct cftype dfl_files[] = { .flags

Re: [PATCH-cgroup 1/4] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-10-18 Thread Waiman Long
On 10/18/23 09:41, Waiman Long wrote: On 10/18/23 05:24, Tejun Heo wrote: Hello, On Fri, Oct 13, 2023 at 02:11:19PM -0400, Waiman Long wrote: When the "isolcpus" boot command line option is used to add a set of isolated CPUs, those CPUs will be excluded automatically from wq_unbou

[PATCH v2 2/4] selftests/cgroup: Minor code cleanup and reorganization of test_cpuset_prs.sh

2023-10-25 Thread Waiman Long
Minor cleanup of test matrix and relocation of test_isolated() function to prepare for the next patch. There is no functional change. Signed-off-by: Waiman Long --- .../selftests/cgroup/test_cpuset_prs.sh | 142 +- 1 file changed, 71 insertions(+), 71 deletions(-) diff

[PATCH v2 3/4] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-10-25 Thread Waiman Long
Add a new internal isolated_cpus mask to keep track of the CPUs that are in isolated partitions. Expose that new cpumask as a new root-only control file ".__DEBUG__.cpuset.cpus.isolated" when cgroup_debug command line option is specified. Signed-off-by: Waiman Long --- kernel/cgrou

[PATCH v2 1/4] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-10-25 Thread Waiman Long
_unbound_cpumask is being modified internally, this patch also exposes the newly introduced wq_requested_unbound_cpumask as well as a wq_isolated_cpumask to store the cpumask to be excluded from wq_unbound_cpumask as read-only sysfs files. Signed-off-by: Waiman Long --- include/linux/workqueue.h |

[PATCH v2 0/4] cgroup/cpuset: Improve CPU isolation in isolated partitions

2023-10-25 Thread Waiman Long
rences yet. That may change in the future as the need arises. Waiman Long (4): workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask selftests/cgroup: Minor code cleanup and reorganization of test_cpuset_prs.sh cgroup/cpuset: Keep track of CPUs in

[PATCH v2 4/4] cgroup/cpuset: Take isolated CPUs out of workqueue unbound cpumask

2023-10-25 Thread Waiman Long
.rst to mention that isolated CPUs will be excluded from unbound workqueue cpumask as well as updating test_cpuset_prs.sh to verify the correctness of the new *cpuset.cpus.isolated file, if available via cgroup_debug option. Signed-off-by: Waiman Long --- Documentation/admin-guide/cgroup-v2.

Re: [PATCH-cgroup 3/4] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-10-25 Thread Waiman Long
On 10/23/23 23:25, Tejun Heo wrote: Hello, Waiman. On Wed, Oct 18, 2023 at 02:24:00PM -0400, Waiman Long wrote: If you mean saving the exclusion cpumask no matter who the caller is, we can add another exclusion cpumask to save it and expose it to sysfs. This should be done in the first

Re: [PATCH-cgroup 1/4] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-10-25 Thread Waiman Long
On 10/23/23 23:28, Tejun Heo wrote: Hello, On Wed, Oct 18, 2023 at 03:18:52PM -0400, Waiman Long wrote: I have a second thought after taking a further look at that. First of all, cpuset_allowed_mask isn't relevant here and the mask can certainly contain offline CPUs. So cpu_possible_ma

Re: [PATCH v2 0/4] cgroup/cpuset: Improve CPU isolation in isolated partitions

2023-11-09 Thread Waiman Long
heers, Longman thanks, rui On Wed, 2023-10-25 at 14:25 -0400, Waiman Long wrote: v2:  - Add 2 read-only workqueue sysfs files to expose the user requested    cpumask as well as the isolated CPUs to be excluded from    wq_unbound_cpumask.  - Ensure that caller of the new workqueue_unbound_exclude_cp

[PATCH v3 0/5] cgroup/cpuset: Improve CPU isolation in isolated partitions

2023-11-15 Thread Waiman Long
es yet. That may change in the future as the need arises. Waiman Long (5): workqueue: Make workqueue_set_unbound_cpumask() static workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask selftests/cgroup: Minor code cleanup and reorganization of test_cpuse

[PATCH v3 1/5] workqueue: Make workqueue_set_unbound_cpumask() static

2023-11-15 Thread Waiman Long
commit. There is no functional change. Signed-off-by: Waiman Long --- include/linux/workqueue.h | 1 - kernel/workqueue.c| 76 +++ 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h

[PATCH v3 3/5] selftests/cgroup: Minor code cleanup and reorganization of test_cpuset_prs.sh

2023-11-15 Thread Waiman Long
Minor cleanup of test matrix and relocation of test_isolated() function to prepare for the next patch. There is no functional change. Signed-off-by: Waiman Long --- .../selftests/cgroup/test_cpuset_prs.sh | 142 +- 1 file changed, 71 insertions(+), 71 deletions(-) diff

[PATCH v3 5/5] cgroup/cpuset: Take isolated CPUs out of workqueue unbound cpumask

2023-11-15 Thread Waiman Long
.rst to mention that isolated CPUs will be excluded from unbound workqueue cpumask as well as updating test_cpuset_prs.sh to verify the correctness of the new *cpuset.cpus.isolated file, if available via cgroup_debug option. Signed-off-by: Waiman Long --- Documentation/admin-guide/cgroup-v2.

[PATCH v3 4/5] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-11-15 Thread Waiman Long
Add a new internal isolated_cpus mask to keep track of the CPUs that are in isolated partitions. Expose that new cpumask as a new root-only control file "cpuset.cpus.isolated". Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 190 +++-- 1 fi

[PATCH v3 2/5] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-11-15 Thread Waiman Long
_unbound_cpumask is being modified internally, this patch also exposes the newly introduced wq_requested_unbound_cpumask as well as a wq_isolated_cpumask to store the cpumask to be excluded from wq_unbound_cpumask as read-only sysfs files. Signed-off-by: Waiman Long --- include/linux/workqueue.h |

Re: [PATCH v3 1/5] workqueue: Make workqueue_set_unbound_cpumask() static

2023-11-15 Thread Waiman Long
-20231115] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Waiman-Long/work

[PATCH v4 1/5] workqueue: Make workqueue_set_unbound_cpumask() static

2023-11-15 Thread Waiman Long
workqueue_apply_unbound_cpumask() as __maybe_unused for now as it will be used by another function introduced in a later commit. There is no functional change. Signed-off-by: Waiman Long --- include/linux/workqueue.h | 1 - kernel/workqueue.c| 102

[PATCH v4 2/5] workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask

2023-11-15 Thread Waiman Long
_unbound_cpumask is being modified internally, this patch also exposes the newly introduced wq_requested_unbound_cpumask as well as a wq_isolated_cpumask to store the cpumask to be excluded from wq_unbound_cpumask as read-only sysfs files. Signed-off-by: Waiman Long --- include/linux/workqueue.h |

[PATCH v4 0/5] cgroup/cpuset: Improve CPU isolation in isolated partitions

2023-11-15 Thread Waiman Long
d CPUs from certain actions to further reduce interference. CPUs in an isolated cpuset partition will not be able to avoid those interferences yet. That may change in the future as the need arises. Waiman Long (5): workqueue: Make workqueue_set_unbound_cpumask() static workqueue: Add workqueu

[PATCH v4 3/5] selftests/cgroup: Minor code cleanup and reorganization of test_cpuset_prs.sh

2023-11-15 Thread Waiman Long
Minor cleanup of test matrix and relocation of test_isolated() function to prepare for the next patch. There is no functional change. Signed-off-by: Waiman Long --- .../selftests/cgroup/test_cpuset_prs.sh | 142 +- 1 file changed, 71 insertions(+), 71 deletions(-) diff

[PATCH v4 4/5] cgroup/cpuset: Keep track of CPUs in isolated partitions

2023-11-15 Thread Waiman Long
Add a new internal isolated_cpus mask to keep track of the CPUs that are in isolated partitions. Expose that new cpumask as a new root-only control file "cpuset.cpus.isolated". Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 190 +++-- 1 fi

[PATCH v4 5/5] cgroup/cpuset: Take isolated CPUs out of workqueue unbound cpumask

2023-11-15 Thread Waiman Long
.rst to mention that isolated CPUs will be excluded from unbound workqueue cpumask as well as updating test_cpuset_prs.sh to verify the correctness of the new *cpuset.cpus.isolated file, if available via cgroup_debug option. Signed-off-by: Waiman Long --- Documentation/admin-guide/cgroup-v2.

Re: [PATCH v4 0/5] cgroup/cpuset: Improve CPU isolation in isolated partitions

2023-11-20 Thread Waiman Long
On 11/19/23 10:23, Tejun Heo wrote: On Wed, Nov 15, 2023 at 10:34:00PM -0500, Waiman Long wrote: v4: - Update patch 1 to move apply_wqattrs_lock() and apply_wqattrs_unlock() down into CONFIG_SYSFS block to avoid compilation warnings. I already applied v3 to cgroup/for-6.8. Can you

[PATCH] cgroup/cpuset: Expose cpuset.cpus.isolated

2023-11-27 Thread Waiman Long
Minor code change is also made in test_cpuset_prs.sh to avoid false test failure when running on debug kernel. Signed-off-by: Waiman Long --- Documentation/admin-guide/cgroup-v2.rst | 7 kernel/cgroup/cpuset.c| 2 +- .../selftests/cgroup/test_cpuset_prs.sh

[RFC PATCH 1/8] rcu/nocb: Pass a cpumask instead of a single CPU to offload/deoffload

2024-01-17 Thread Waiman Long
support a cpumask. Signed-off-by: Frederic Weisbecker Cc: Zefan Li Cc: Tejun Heo Cc: Johannes Weiner Cc: Paul E. McKenney Cc: Phil Auld Cc: Nicolas Saenz Julienne Cc: Marcelo Tosatti Cc: Paul Gortmaker Cc: Waiman Long Cc: Daniel Bristot de Oliveira Cc: Peter Zijlstra --- include/linux

[RFC PATCH 3/8] rcu/no_cb: Add rcu_nocb_enabled() to expose the rcu_nocb state

2024-01-17 Thread Waiman Long
CPU isolation is requested. Signed-off-by: Waiman Long --- include/linux/rcupdate.h | 6 ++ kernel/rcu/tree_nocb.h | 12 2 files changed, 18 insertions(+) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index b649344075d2..976d55a3e523 100644 --- a/include

[RFC PATCH 2/8] rcu/nocb: Prepare to change nocb cpumask from CPU-hotplug protected cpuset caller

2024-01-17 Thread Waiman Long
Li Cc: Tejun Heo Cc: Johannes Weiner Cc: Paul E. McKenney Cc: Phil Auld Cc: Nicolas Saenz Julienne Cc: Marcelo Tosatti Cc: Paul Gortmaker Cc: Waiman Long Cc: Daniel Bristot de Oliveira Cc: Peter Zijlstra --- kernel/rcu/rcutorture.c | 2 ++ kernel/rcu/tree_nocb.h | 4 ++-- 2 files

[RFC PATCH 4/8] cgroup/cpuset: Better tracking of addition/deletion of isolated CPUs

2024-01-17 Thread Waiman Long
update_isolation_cpumasks() to accommodate additional CPU isolation modes in the future. There is no functional change. Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 113 + 1 file changed, 69 insertions(+), 44 deletions(-) diff --git a/kernel/cgroup

[RFC PATCH 5/8] cgroup/cpuset: Add cpuset.cpus.isolation_full

2024-01-17 Thread Waiman Long
re enabled. The list of these available isolation methods will depend on kernel configuration options used as well as the presence of some pre-conditions for some of them. This patch only provides the infrastructure code. The various isolation methods will be added later on. Signed-off-by: Waim

[RFC PATCH 0/8] cgroup/cpuset: Support RCU_NOCB on isolated partitions

2024-01-17 Thread Waiman Long
] https://lore.kernel.org/lkml/20220525221055.1152307-1-frede...@kernel.org/ Frederic Weisbecker (2): rcu/nocb: Pass a cpumask instead of a single CPU to offload/deoffload rcu/nocb: Prepare to change nocb cpumask from CPU-hotplug protected cpuset caller Waiman Long (6): rcu/no_cb: Add

[RFC PATCH 6/8] cgroup/cpuset: Enable dynamic rcu_nocb mode on isolated CPUs

2024-01-17 Thread Waiman Long
line with or without the optional CPU list argument. Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 36 1 file changed, 36 insertions(+) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index d1d4ce213979..40bbb0a9cb84 100644 --- a/ker

[RFC PATCH 8/8] cgroup/cpuset: Update test_cpuset_prs.sh to handle cpuset.cpus.isolation_full

2024-01-17 Thread Waiman Long
Add a new "-F" option to cpuset.cpus.isolation_full to enable cpuset.cpus.isolation_full for trying out the effect of enabling full CPU isolation. Signed-off-by: Waiman Long --- .../selftests/cgroup/test_cpuset_prs.sh | 23 ++- 1 file changed, 22 insertions(+),

[RFC PATCH 7/8] cgroup/cpuset: Document the new cpuset.cpus.isolation_full control file

2024-01-17 Thread Waiman Long
Document the new cpuset.cpus.isolation_full control file. Currently only the rcu_nocbs flag is supported, but more will be added in the future. Signed-off-by: Waiman Long --- Documentation/admin-guide/cgroup-v2.rst | 24 1 file changed, 24 insertions(+) diff --git a

Re: [RFC PATCH 0/8] cgroup/cpuset: Support RCU_NOCB on isolated partitions

2024-01-17 Thread Waiman Long
On 1/17/24 12:07, Tejun Heo wrote: Hello, On Wed, Jan 17, 2024 at 11:35:03AM -0500, Waiman Long wrote: The first 2 patches are adopted from Federic with minor twists to fix merge conflicts and compilation issue. The rests are for implementing the new cpuset.cpus.isolation_full interface

Re: [RFC PATCH 0/8] cgroup/cpuset: Support RCU_NOCB on isolated partitions

2024-01-22 Thread Waiman Long
On 1/22/24 10:07, Michal Koutný wrote: Hello Waiman. On Wed, Jan 17, 2024 at 11:35:03AM -0500, Waiman Long wrote: This patch series is based on the RFC patch from Frederic [1]. Instead of offering RCU_NOCB as a separate option, it is now lumped into a root-only cpuset.cpus.isolation_full

Re: [RFC PATCH 0/8] cgroup/cpuset: Support RCU_NOCB on isolated partitions

2024-02-09 Thread Waiman Long
On 2/6/24 07:56, Frederic Weisbecker wrote: Le Wed, Jan 17, 2024 at 12:15:07PM -0500, Waiman Long a écrit : On 1/17/24 12:07, Tejun Heo wrote: Hello, On Wed, Jan 17, 2024 at 11:35:03AM -0500, Waiman Long wrote: The first 2 patches are adopted from Federic with minor twists to fix merge

Re: [RFC PATCH 0/8] cgroup/cpuset: Support RCU_NOCB on isolated partitions

2024-02-10 Thread Waiman Long
On 1/19/24 05:24, Paul E. McKenney wrote: On Wed, Jan 17, 2024 at 11:35:03AM -0500, Waiman Long wrote: This patch series is based on the RFC patch from Frederic [1]. Instead of offering RCU_NOCB as a separate option, it is now lumped into a root-only cpuset.cpus.isolation_full flag that will

Re: [BUG] selftests: cgroup: KMEMLEAK in cgroup/test_cpuset_prs.sh

2024-02-27 Thread Waiman Long
On 2/27/24 14:50, Mirsad Todorovac wrote: Hi, everybody, In the latest vanilla torvalds tree kernel v6.8-rc6-11-g45ec2f5f6ed3 on an Ubuntu 23.10 system, there KMEMLEAK detected a couple of memory leaks: Visually it appears like the same leak repeated six times, but I reckoned it might be of

[PATCH 0/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-01 Thread Waiman Long
test_cpuset_prs.sh script was also run with LOCKDEP on to verify that there is no regression. [1] https://lore.kernel.org/lkml/zgyikmb5kz7rx...@slm.duckdns.org/ Waiman Long (2): cgroup/cpuset: Make cpuset hotplug processing synchronous cgroup/cpuset: Add test_cpuset_v1_hp.sh include/linux

[PATCH 1/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-01 Thread Waiman Long
reverted. Also removing some cpus_read_lock trylock attempts in the cpuset partition code as they are no longer necessary since the cpu_hotplug_lock is now held for the whole duration of the cpuset hotplug code path. Signed-off-by: Waiman Long --- include/linux/cpuset.h | 3 - kernel/cgroup/cp

[PATCH 2/2] cgroup/cpuset: Add test_cpuset_v1_hp.sh

2024-04-01 Thread Waiman Long
Add a simple test to verify that an empty v1 cpuset will force its tasks to be moved to an ancestor node. It is based on the test case documented in commit 76bb5ab8f6e3 ("cpuset: break kernfs active protection in cpuset_write_resmask()"). Signed-off-by: Waiman Long --- tools/testing

Re: [PATCH 1/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-02 Thread Waiman Long
On 4/2/24 10:13, Michal Koutný wrote: Hello Waiman. (I have no opinion on the overall locking reworks, only the bits about v1 migrations caught my attention.) On Mon, Apr 01, 2024 at 10:58:57AM -0400, Waiman Long wrote: ... @@ -4383,12 +4377,20 @@ hotplug_update_tasks_legacy(struct cpuset

Re: [PATCH 1/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-03 Thread Waiman Long
On 4/3/24 08:02, Michal Koutný wrote: On Tue, Apr 02, 2024 at 11:30:11AM -0400, Waiman Long wrote: Yes, there is a potential that a cpus_read_lock() may be called leading to deadlock. So unless we reverse the current cgroup_mutex --> cpu_hotplug_lock ordering, it is not safe to c

Re: [PATCH 1/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-03 Thread Waiman Long
On 4/3/24 10:26, Valentin Schneider wrote: On 03/04/24 09:38, Waiman Long wrote: On 4/3/24 08:02, Michal Koutný wrote: On Tue, Apr 02, 2024 at 11:30:11AM -0400, Waiman Long wrote: Yes, there is a potential that a cpus_read_lock() may be called leading to deadlock. So unless we reverse the

Re: [PATCH 1/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-03 Thread Waiman Long
On 4/3/24 10:56, Michal Koutný wrote: On Wed, Apr 03, 2024 at 10:47:33AM -0400, Waiman Long wrote: should be rare these days as it will only apply in the case of cgroup v1 under certain condtion, Could the migration be simply omitted it those special cases? (Tasks remain in cpusets with

[PATCH v2 0/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-04 Thread Waiman Long
...@slm.duckdns.org/ Waiman Long (2): cgroup/cpuset: Make cpuset hotplug processing synchronous cgroup/cpuset: Add test_cpuset_v1_hp.sh include/linux/cpuset.h| 3 - kernel/cgroup/cpuset.c| 141 +++--- kernel/cpu.c

[PATCH v2 1/2] cgroup/cpuset: Make cpuset hotplug processing synchronous

2024-04-04 Thread Waiman Long
reverted. Also removing some cpus_read_lock trylock attempts in the cpuset partition code as they are no longer necessary since the cpu_hotplug_lock is now held for the whole duration of the cpuset hotplug code path. Signed-off-by: Waiman Long --- include/linux/cpuset.h | 3 - kernel/cgroup/cp

[PATCH v2 2/2] cgroup/cpuset: Add test_cpuset_v1_hp.sh

2024-04-04 Thread Waiman Long
Add a simple test to verify that an empty v1 cpuset will force its tasks to be moved to an ancestor node. It is based on the test case documented in commit 76bb5ab8f6e3 ("cpuset: break kernfs active protection in cpuset_write_resmask()"). Signed-off-by: Waiman Long --- tools/testing

Re: [RFC PATCH v3 6/9] selftests: cgroup: Add basic tests for pids controller

2024-04-08 Thread Waiman Long
On 4/8/24 08:04, Muhammad Usama Anjum wrote: On 4/8/24 5:01 PM, Michal Koutný wrote: On Mon, Apr 08, 2024 at 04:53:11PM +0500, Muhammad Usama Anjum wrote: ksft_test_result_report(tests[i].fn(root), tests[i].name) $ git grep ksft_test_result_report v6.9-rc3 -- (empty result) I can't find t

[PATCH-cgroup v2 1/5] cgroup/cpuset: Fix remote root partition creation problem

2024-06-17 Thread Waiman Long
ld be included in building the cpuset array and none of the v1 scheduling attributes other than a different way to create an isolated partition are supported. Fixes: 181c8e091aae ("cgroup/cpuset: Introduce remote partition") Signed-off-by: Waima

[PATCH-cgroup v2 0/5] cgroup/cpuset: Fix miscellaneous issues

2024-06-17 Thread Waiman Long
test_cpuset_prs.sh script is updated to match changes made in this patchset and was run to verify that the new code did not cause any regression. Waiman Long (5): cgroup/cpuset: Fix remote root partition creation problem selftest/cgroup: Fix test_cpuset_prs.sh problems reported by test robot cgroup

[PATCH-cgroup v2 2/5] selftest/cgroup: Fix test_cpuset_prs.sh problems reported by test robot

2024-06-17 Thread Waiman Long
robot Closes: https://lore.kernel.org/oe-lkp/202406141712.dbbaa8fd-oliver.s...@intel.com Signed-off-by: Waiman Long --- .../selftests/cgroup/test_cpuset_prs.sh | 20 +-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/cgroup

[PATCH-cgroup v2 5/5] selftest/cgroup: Update test_cpuset_prs.sh to match changes

2024-06-17 Thread Waiman Long
well as new test cases to test the newly added functionality. Signed-off-by: Waiman Long --- .../selftests/cgroup/test_cpuset_prs.sh | 55 ++- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing

[PATCH-cgroup v2 3/5] cgroup/cpuset: Delay setting of CS_CPU_EXCLUSIVE until valid partition

2024-06-17 Thread Waiman Long
. The Documentation/admin-guide/cgroup-v2.rst file is updated to document the new constraints. Signed-off-by: Waiman Long --- Documentation/admin-guide/cgroup-v2.rst | 8 -- kernel/cgroup/cpuset.c | 36 - 2 files changed, 35 insertions(+), 9 dele

[PATCH-cgroup v2 4/5] cgroup/cpuset: Make cpuset.cpus.exclusive independent of cpuset.cpus

2024-06-17 Thread Waiman Long
have two separate hierarchies - one for setting "cpuset.cpus.effective" and the other one for setting "cpuset.cpus.exclusive.effective". We may not need to set "cpuset.cpus" when we activate a partition root anymore. Also update Documentation/admin-guide/cgroup-v2.rst

Re: [PATCH-cgroup v2 4/5] cgroup/cpuset: Make cpuset.cpus.exclusive independent of cpuset.cpus

2024-07-15 Thread Waiman Long
On 7/15/24 11:56, Petr Malat wrote: Hi, I finally got some time to test this and it works exactly as we needed it to. Thanks a lot, Petr Thanks for the verification. Cheers, Longman On Mon, Jun 17, 2024 at 10:39:44AM -0400, Waiman Long wrote: The "cpuset.cpus.exclusive.effective&q

Re: [PATCH] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-17 Thread Waiman Long
On 7/17/24 17:13, David Finkel wrote: On Wed, Jul 17, 2024 at 4:44 PM Johannes Weiner wrote: On Wed, Jul 17, 2024 at 04:14:07PM -0400, David Finkel wrote: On Wed, Jul 17, 2024 at 1:04 PM Johannes Weiner wrote: On Tue, Jul 16, 2024 at 06:44:11AM -1000, Tejun Heo wrote: Hello, On Tue, Jul 16

Re: [PATCH] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-17 Thread Waiman Long
On 7/17/24 21:24, Tejun Heo wrote: On Wed, Jul 17, 2024 at 07:48:40PM -0400, Waiman Long wrote: ... How about letting .peak shows two numbers? The first one is the peak since the creation of the cgroup and cannot be reset. The second one is a local maximum that can be reset to 0. We just to

Re: [PATCH] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-18 Thread Waiman Long
On 7/18/24 17:49, David Finkel wrote: I spent some time today attempting to implement this. Here's a branch on github that compiles, and I think is close to what you described, but is definitely still a WIP: https://github.com/torvalds/linux/compare/master...dfinkel:linux:memcg2_memory_peak_fd

Re: [PATCH] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-22 Thread Waiman Long
On 7/22/24 15:30, David Finkel wrote: diff --git a/mm/page_counter.c b/mm/page_counter.c index db20d6452b71..40d5f4990218 100644 --- a/mm/page_counter.c +++ b/mm/page_counter.c @@ -82,6 +82,8 @@ void page_counter_charge(struct page_counter *counter, unsigned long nr_pages) */

Re: [PATCH 1/2] mm, memcg: cg2 memory{.swap,}.peak write handlers

2024-07-23 Thread Waiman Long
stly avoids the inaccuracies surrounding reclaimable memory. Suggested-by: Johannes Weiner Suggested-by: Waiman Long Signed-off-by: David Finkel --- Documentation/admin-guide/cgroup-v2.rst | 26 -- include/linux/cgroup-defs.h | 5 + include/linux/cgroup.h

[PATCH-cgroup 0/5] cgroup/cpuset: Miscellaneous cpuset updates for 6.12

2024-08-04 Thread Waiman Long
of partition roots with non-overlapping CPUs. Patch 5 adds new test cases to cover the bugs fixed in patches 1 and 2. Chen Ridong (1): cgroup/cpuset: fix panic caused by partcmd_update Waiman Long (4): cgroup/cpuset: Clear effective_xcpus on cpus_allowed clearing only if cpus.exclusive not

[PATCH-cgroup 1/5] cgroup/cpuset: fix panic caused by partcmd_update

2024-08-04 Thread Waiman Long
sive.effective for v2") Signed-off-by: Chen Ridong Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 9066f9b4af24..f1846a08e245 100644 --- a/kernel/cgroup/cpuset.c +++ b/ker

[PATCH-cgroup 2/5] cgroup/cpuset: Clear effective_xcpus on cpus_allowed clearing only if cpus.exclusive not set

2024-08-04 Thread Waiman Long
cpuset.cpus # cat cpuset.cpus.exclusive.effective // was cleared Fix it by clearing effective_xcpus only if cpuset.cpus.exclusive is not set. Fixes: e2ffe502ba45 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2") Reported-by: Chen Ridong Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 3 ++-

[PATCH-cgroup 4/5] cgroup/cpuset: Check for partition roots with overlapping CPUs

2024-08-04 Thread Waiman Long
of increasing test coverage of the new Union-Find cpuset merging code to cgroup v2. Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index

[PATCH-cgroup 5/5] selftest/cgroup: Add new test cases to test_cpuset_prs.sh

2024-08-04 Thread Waiman Long
Add new test cases to test_cpuset_prs.sh to cover corner cases reported in previous fix commits. Signed-off-by: Waiman Long --- tools/testing/selftests/cgroup/test_cpuset_prs.sh | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup

[PATCH-cgroup 3/5] cgroup/cpuset: Eliminate unncessary sched domains rebuilds in hotplug

2024-08-04 Thread Waiman Long
immediate rebuild_sched_domains_locked() calls if set and only doing one final call at the end. Also renaming the force_rebuild flag to force_sd_rebuild to make its meaning for clear. Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 33 + 1 file changed, 17

Re: [PATCH v3 7/7] Docs/admin-guide/mm/workingset_report: document sysfs and memcg interfaces

2024-08-13 Thread Waiman Long
On 8/13/24 12:56, Yuanchu Xie wrote: Add workingset reporting documentation for better discoverability of its sysfs and memcg interfaces. Also document the required kernel config to enable workingset reporting. Change-Id: Ib9dfc9004473baa6ef26ca7277d220b6199517de Signed-off-by: Yuanchu Xie --

[PATCH-cgroup 0/2] cgroup/cpuset: Account for boot time isolated CPUs

2024-08-20 Thread Waiman Long
or not. The updated test_cpuset_prs.sh was run successfully with or without the "isolcpus" option. Waiman Long (2): cgroup/cpuset: Account for boot time isolated CPUs selftest/cgroup: Make test_cpuset_prs.sh deal with pre-isolated CPUs kernel/cgroup/cpuset.c| 23 ++

[PATCH-cgroup 2/2] selftest/cgroup: Make test_cpuset_prs.sh deal with pre-isolated CPUs

2024-08-20 Thread Waiman Long
can check for those before testing is started to make sure that there will be no interference. Otherwise, this test will be skipped if incorrect test failure can happen. As "cpuset.cpus.isolated" is now available in a non cgroup_debug kernel, we don't need to check for its existe

[PATCH-cgroup 1/2] cgroup/cpuset: Account for boot time isolated CPUs

2024-08-20 Thread Waiman Long
cpumasks dynamic, the current check may not be right anymore. Save the boot time HK_TYPE_DOMAIN cpumask and check against it instead of the upcoming dynamic HK_TYPE_DOMAIN housekeeping cpumask. Signed-off-by: Waiman Long --- kernel/cgroup/cpuset.c | 23 ++- 1 file changed,

Re: [PATCH-cgroup 0/2] cgroup/cpuset: Account for boot time isolated CPUs

2024-08-26 Thread Waiman Long
On 8/20/24 15:55, Waiman Long wrote: The current cpuset code and test_cpuset_prs.sh test have not fully account for the possibility of pre-isolated CPUs added by the "isolcpus" boot command line parameter. This patch series modifies them to do the right thing whether or not "isolc

Re: [PATCH-cgroup 0/2] cgroup/cpuset: Account for boot time isolated CPUs

2024-08-26 Thread Waiman Long
On 8/26/24 15:05, Tejun Heo wrote: Hello, Waiman. On Mon, Aug 26, 2024 at 03:01:21PM -0400, Waiman Long wrote: Ping! Any comment on these patches? cgroup side looks fine to me. Ping isol people? This patchset is specific to cpuset code and doesn't touch any isolation code at al

Re: [PATCH-cgroup 1/2] cgroup/cpuset: Account for boot time isolated CPUs

2024-08-27 Thread Waiman Long
On 8/27/24 04:01, Michal Koutný wrote: Hi. On Tue, Aug 20, 2024 at 03:55:35PM GMT, Waiman Long wrote: The prstate_housekeeping_conflict() function does check the HK_TYPE_DOMAIN housekeeping cpumask to make sure that CPUs outside of it can only be used in isolated partition. Given the fact