From 6336b8a590b30ad4c6d87869af4f499ae70e3a98 Mon Sep 17 00:00:00 2001 From: Maoni Stephens Date: Mon, 11 Dec 2023 14:23:29 -0800 Subject: [PATCH 1/6] Update garbage-collector.md for CPU groups and affinitze ranges I needed to update the default for CPU groups for win11 and server 2022. and correct some info for affinitze ranges --- docs/core/runtime-config/garbage-collector.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index 62e67f2322b62..a31562106ba19 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -313,18 +313,19 @@ For more information about some of these settings, see the [Middle ground betwee ### Affinitize ranges -- Specifies the list of processors to use for garbage collector threads. +- Specifies the list of processors to use for garbage collector threads. This can either - This setting is similar to [System.GC.HeapAffinitizeMask](#affinitize-mask), except it allows you to specify more than 64 processors. -- For Windows operating systems, prefix the processor number or range with the corresponding [CPU group](/windows/win32/procthread/processor-groups), for example, "0:1-10,0:12,1:50-52,1:70". +- For Windows operating systems, prefix the processor number or range with the corresponding [CPU group](/windows/win32/procthread/processor-groups), for example, "0:1-10,0:12,1:50-52,1:7". Note that you cannot use this config if you don't actually have more than 1 CPU group. You must use the [Affinitize mask](#affinitize-mask) setting. And the numbers you specify are within that group, which means it cannot be >= 64. +- For Linux operating systems, since the [CPU group](/windows/win32/procthread/processor-groups) concept does not exist there you can use both this and the [Affinitize mask](#affinitize-mask) setting to specify the same ranges. - If [GC processor affinity](#affinitize) is disabled, this setting is ignored. - Applies to server garbage collection only. - For more information, see [Making CPU configuration better for GC on machines with > 64 CPUs](https://devblogs.microsoft.com/dotnet/making-cpu-configuration-better-for-gc-on-machines-with-64-cpus/) on Maoni Stephens' blog. | | Setting name | Values | Version introduced | | - | - | - | - | -| **runtimeconfig.json** | `System.GC.HeapAffinitizeRanges` | Comma-separated list of processor numbers or ranges of processor numbers.
Unix example: "1-10,12,50-52,70"
Windows example: "0:1-10,0:12,1:50-52,1:70" | .NET Core 3.0 | -| **Environment variable** | `COMPlus_GCHeapAffinitizeRanges` | Comma-separated list of processor numbers or ranges of processor numbers.
Unix example: "1-10,12,50-52,70"
Windows example: "0:1-10,0:12,1:50-52,1:70" | .NET Core 3.0 | -| **Environment variable** | `DOTNET_GCHeapAffinitizeRanges` | Comma-separated list of processor numbers or ranges of processor numbers.
Unix example: "1-10,12,50-52,70"
Windows example: "0:1-10,0:12,1:50-52,1:70" | .NET 6 | +| **runtimeconfig.json** | `System.GC.HeapAffinitizeRanges` | Comma-separated list of processor numbers or ranges of processor numbers.
Unix example: "1-10,12,50-52,70"
Windows example: "0:1-10,0:12,1:50-52,1:7" | .NET Core 3.0 | +| **Environment variable** | `COMPlus_GCHeapAffinitizeRanges` | Comma-separated list of processor numbers or ranges of processor numbers.
Unix example: "1-10,12,50-52,70"
Windows example: "0:1-10,0:12,1:50-52,1:7" | .NET Core 3.0 | +| **Environment variable** | `DOTNET_GCHeapAffinitizeRanges` | Comma-separated list of processor numbers or ranges of processor numbers.
Unix example: "1-10,12,50-52,70"
Windows example: "0:1-10,0:12,1:50-52,1:7" | .NET 6 | [!INCLUDE [runtimehostconfigurationoption](includes/runtimehostconfigurationoption.md)] @@ -358,6 +359,8 @@ For more information about some of these settings, see the [Middle ground betwee When a 64-bit Windows computer has multiple CPU groups, that is, there are more than 64 processors, enabling this element extends garbage collection across all CPU groups. The garbage collector uses all cores to create and balance heaps. + Note that this is a Windows only concept. By default Windows limited a process to one CPU group so by default GC only used one CPU group unless you use this setting to enable multiple CPU groups. This OS limitation was lifted in Windows 11 and Server 2022. And starting .NET 7 GC will by default using all CPU groups if you are running on Windows 11 or Server 2022. + - Applies to server garbage collection on 64-bit Windows operating systems only. - Default: GC does not extend across CPU groups. This is equivalent to setting the value to `0`. - For more information, see [Making CPU configuration better for GC on machines with > 64 CPUs](https://devblogs.microsoft.com/dotnet/making-cpu-configuration-better-for-gc-on-machines-with-64-cpus/) on Maoni Stephens' blog. From ebb8b4a5c3326dd3688cfd4801373ca23b87d7ac Mon Sep 17 00:00:00 2001 From: Maoni Stephens Date: Mon, 11 Dec 2023 19:51:30 -0800 Subject: [PATCH 2/6] Update docs/core/runtime-config/garbage-collector.md Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- docs/core/runtime-config/garbage-collector.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index a31562106ba19..d6156042078e9 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -315,7 +315,7 @@ For more information about some of these settings, see the [Middle ground betwee - Specifies the list of processors to use for garbage collector threads. This can either - This setting is similar to [System.GC.HeapAffinitizeMask](#affinitize-mask), except it allows you to specify more than 64 processors. -- For Windows operating systems, prefix the processor number or range with the corresponding [CPU group](/windows/win32/procthread/processor-groups), for example, "0:1-10,0:12,1:50-52,1:7". Note that you cannot use this config if you don't actually have more than 1 CPU group. You must use the [Affinitize mask](#affinitize-mask) setting. And the numbers you specify are within that group, which means it cannot be >= 64. +- For Windows operating systems, prefix the processor number or range with the corresponding [CPU group](/windows/win32/procthread/processor-groups), for example, "0:1-10,0:12,1:50-52,1:7". If you don't actually have more than 1 CPU group, you can't use this setting. You must use the [Affinitize mask](#affinitize-mask) setting. And the numbers you specify are within that group, which means it cannot be >= 64. - For Linux operating systems, since the [CPU group](/windows/win32/procthread/processor-groups) concept does not exist there you can use both this and the [Affinitize mask](#affinitize-mask) setting to specify the same ranges. - If [GC processor affinity](#affinitize) is disabled, this setting is ignored. - Applies to server garbage collection only. From 05fa7169f9f58cb528a5817a38ce4a9c53500c7b Mon Sep 17 00:00:00 2001 From: Maoni Stephens Date: Mon, 11 Dec 2023 19:52:01 -0800 Subject: [PATCH 3/6] Update docs/core/runtime-config/garbage-collector.md Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- docs/core/runtime-config/garbage-collector.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index d6156042078e9..f50a36d3a9e52 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -316,7 +316,7 @@ For more information about some of these settings, see the [Middle ground betwee - Specifies the list of processors to use for garbage collector threads. This can either - This setting is similar to [System.GC.HeapAffinitizeMask](#affinitize-mask), except it allows you to specify more than 64 processors. - For Windows operating systems, prefix the processor number or range with the corresponding [CPU group](/windows/win32/procthread/processor-groups), for example, "0:1-10,0:12,1:50-52,1:7". If you don't actually have more than 1 CPU group, you can't use this setting. You must use the [Affinitize mask](#affinitize-mask) setting. And the numbers you specify are within that group, which means it cannot be >= 64. -- For Linux operating systems, since the [CPU group](/windows/win32/procthread/processor-groups) concept does not exist there you can use both this and the [Affinitize mask](#affinitize-mask) setting to specify the same ranges. +- For Linux operating systems, where the [CPU group](/windows/win32/procthread/processor-groups) concept doesn't exist, you can use both this setting and the [Affinitize mask](#affinitize-mask) setting to specify the same ranges. - If [GC processor affinity](#affinitize) is disabled, this setting is ignored. - Applies to server garbage collection only. - For more information, see [Making CPU configuration better for GC on machines with > 64 CPUs](https://devblogs.microsoft.com/dotnet/making-cpu-configuration-better-for-gc-on-machines-with-64-cpus/) on Maoni Stephens' blog. From 2bf4b3ec4fd63936a5ddcc2a7f3f7c0994d6ff80 Mon Sep 17 00:00:00 2001 From: Maoni Stephens Date: Mon, 11 Dec 2023 19:52:11 -0800 Subject: [PATCH 4/6] Update docs/core/runtime-config/garbage-collector.md Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- docs/core/runtime-config/garbage-collector.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index f50a36d3a9e52..30a9515f7a34b 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -359,7 +359,8 @@ For more information about some of these settings, see the [Middle ground betwee When a 64-bit Windows computer has multiple CPU groups, that is, there are more than 64 processors, enabling this element extends garbage collection across all CPU groups. The garbage collector uses all cores to create and balance heaps. - Note that this is a Windows only concept. By default Windows limited a process to one CPU group so by default GC only used one CPU group unless you use this setting to enable multiple CPU groups. This OS limitation was lifted in Windows 11 and Server 2022. And starting .NET 7 GC will by default using all CPU groups if you are running on Windows 11 or Server 2022. + > [!NOTE] + > This is a Windows-only concept. In older Windows versions, Windows limited a process to one CPU group. Thus, GC only used one CPU group unless you used this setting to enable multiple CPU groups. This OS limitation was lifted in Windows 11 and Server 2022. Also, starting in .NET 7, GC by default uses all CPU groups when running on Windows 11 or Server 2022. - Applies to server garbage collection on 64-bit Windows operating systems only. - Default: GC does not extend across CPU groups. This is equivalent to setting the value to `0`. From aef17182b7bffc401f122c536e3b3b2ab6f1c55a Mon Sep 17 00:00:00 2001 From: Maoni0 Date: Mon, 11 Dec 2023 20:00:58 -0800 Subject: [PATCH 5/6] fix --- docs/core/runtime-config/garbage-collector.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index 30a9515f7a34b..790f82d564241 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -313,10 +313,10 @@ For more information about some of these settings, see the [Middle ground betwee ### Affinitize ranges -- Specifies the list of processors to use for garbage collector threads. This can either +- Specifies the list of processors to use for garbage collector threads. - This setting is similar to [System.GC.HeapAffinitizeMask](#affinitize-mask), except it allows you to specify more than 64 processors. - For Windows operating systems, prefix the processor number or range with the corresponding [CPU group](/windows/win32/procthread/processor-groups), for example, "0:1-10,0:12,1:50-52,1:7". If you don't actually have more than 1 CPU group, you can't use this setting. You must use the [Affinitize mask](#affinitize-mask) setting. And the numbers you specify are within that group, which means it cannot be >= 64. -- For Linux operating systems, where the [CPU group](/windows/win32/procthread/processor-groups) concept doesn't exist, you can use both this setting and the [Affinitize mask](#affinitize-mask) setting to specify the same ranges. +- For Linux operating systems, where the [CPU group](/windows/win32/procthread/processor-groups) concept doesn't exist, you can use both this setting and the [Affinitize mask](#affinitize-mask) setting to specify the same ranges. And instead of "0:1-10", specify "1-10" because you don't need to specify a group index. - If [GC processor affinity](#affinitize) is disabled, this setting is ignored. - Applies to server garbage collection only. - For more information, see [Making CPU configuration better for GC on machines with > 64 CPUs](https://devblogs.microsoft.com/dotnet/making-cpu-configuration-better-for-gc-on-machines-with-64-cpus/) on Maoni Stephens' blog. From 51ec7f9f916edbfd408a20beb9998a5ef438d612 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 12 Dec 2023 09:58:01 -0800 Subject: [PATCH 6/6] Remove space --- docs/core/runtime-config/garbage-collector.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/runtime-config/garbage-collector.md b/docs/core/runtime-config/garbage-collector.md index 790f82d564241..c5f5abe64b388 100644 --- a/docs/core/runtime-config/garbage-collector.md +++ b/docs/core/runtime-config/garbage-collector.md @@ -313,7 +313,7 @@ For more information about some of these settings, see the [Middle ground betwee ### Affinitize ranges -- Specifies the list of processors to use for garbage collector threads. +- Specifies the list of processors to use for garbage collector threads. - This setting is similar to [System.GC.HeapAffinitizeMask](#affinitize-mask), except it allows you to specify more than 64 processors. - For Windows operating systems, prefix the processor number or range with the corresponding [CPU group](/windows/win32/procthread/processor-groups), for example, "0:1-10,0:12,1:50-52,1:7". If you don't actually have more than 1 CPU group, you can't use this setting. You must use the [Affinitize mask](#affinitize-mask) setting. And the numbers you specify are within that group, which means it cannot be >= 64. - For Linux operating systems, where the [CPU group](/windows/win32/procthread/processor-groups) concept doesn't exist, you can use both this setting and the [Affinitize mask](#affinitize-mask) setting to specify the same ranges. And instead of "0:1-10", specify "1-10" because you don't need to specify a group index.