* [PATCH 1/1] doc, mempolicy: Fix wrong document in numa_memory_policy.txt
@ 2014-04-02 3:53 Tang Chen
2014-04-10 23:23 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Tang Chen @ 2014-04-02 3:53 UTC (permalink / raw)
To: rdunlap, hannes, mhocko, bsingharora, kamezawa.hiroyu
Cc: cgroups, linux-mm, linux-doc, linux-kernel, tangchen, guz.fnst
In document numa_memory_policy.txt, the following examples for flag
MPOL_F_RELATIVE_NODES are incorrect.
For example, consider a task that is attached to a cpuset with
mems 2-5 that sets an Interleave policy over the same set with
MPOL_F_RELATIVE_NODES. If the cpuset's mems change to 3-7, the
interleave now occurs over nodes 3,5-6. If the cpuset's mems
then change to 0,2-3,5, then the interleave occurs over nodes
0,3,5.
According to the comment of the patch adding flag MPOL_F_RELATIVE_NODES,
the nodemasks the user specifies should be considered relative to the
current task's mems_allowed.
(https://lkml.org/lkml/2008/2/29/428)
And according to numa_memory_policy.txt, if the user's nodemask includes
nodes that are outside the range of the new set of allowed nodes, then
the remap wraps around to the beginning of the nodemask and, if not already
set, sets the node in the mempolicy nodemask.
So in the example, if the user specifies 2-5, for a task whose mems_allowed
is 3-7, the nodemasks should be remapped the third, fourth, fifth, sixth
node in mems_allowed. like the following:
mems_allowed: 3 4 5 6 7
relative index: 0 1 2 3 4
5
So the nodemasks should be remapped to 3,5-7, but not 3,5-6.
And for a task whose mems_allowed is 0,2-3,5, the nodemasks should be
remapped to 0,2-3,5, but not 0,3,5.
mems_allowed: 0 2 3 5
relative index: 0 1 2 3
4 5
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
---
Documentation/vm/numa_memory_policy.txt | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt
index 4e7da65..badb050 100644
--- a/Documentation/vm/numa_memory_policy.txt
+++ b/Documentation/vm/numa_memory_policy.txt
@@ -174,7 +174,6 @@ Components of Memory Policies
allocation fails, the kernel will search other nodes, in order of
increasing distance from the preferred node based on information
provided by the platform firmware.
- containing the cpu where the allocation takes place.
Internally, the Preferred policy uses a single node--the
preferred_node member of struct mempolicy. When the internal
@@ -275,9 +274,9 @@ Components of Memory Policies
For example, consider a task that is attached to a cpuset with
mems 2-5 that sets an Interleave policy over the same set with
MPOL_F_RELATIVE_NODES. If the cpuset's mems change to 3-7, the
- interleave now occurs over nodes 3,5-6. If the cpuset's mems
+ interleave now occurs over nodes 3,5-7. If the cpuset's mems
then change to 0,2-3,5, then the interleave occurs over nodes
- 0,3,5.
+ 0,2-3,5.
Thanks to the consistent remapping, applications preparing
nodemasks to specify memory policies using this flag should
--
1.7.11.7
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] doc, mempolicy: Fix wrong document in numa_memory_policy.txt
2014-04-02 3:53 [PATCH 1/1] doc, mempolicy: Fix wrong document in numa_memory_policy.txt Tang Chen
@ 2014-04-10 23:23 ` Randy Dunlap
2014-04-11 8:13 ` Tang Chen
2014-04-11 10:54 ` David Rientjes
0 siblings, 2 replies; 4+ messages in thread
From: Randy Dunlap @ 2014-04-10 23:23 UTC (permalink / raw)
To: Tang Chen, hannes, mhocko, bsingharora, kamezawa.hiroyu
Cc: cgroups, linux-mm, linux-doc, linux-kernel, guz.fnst, Andrew Morton
On 04/01/2014 08:53 PM, Tang Chen wrote:
> In document numa_memory_policy.txt, the following examples for flag
> MPOL_F_RELATIVE_NODES are incorrect.
>
> For example, consider a task that is attached to a cpuset with
> mems 2-5 that sets an Interleave policy over the same set with
> MPOL_F_RELATIVE_NODES. If the cpuset's mems change to 3-7, the
> interleave now occurs over nodes 3,5-6. If the cpuset's mems
> then change to 0,2-3,5, then the interleave occurs over nodes
> 0,3,5.
>
> According to the comment of the patch adding flag MPOL_F_RELATIVE_NODES,
> the nodemasks the user specifies should be considered relative to the
> current task's mems_allowed.
> (https://lkml.org/lkml/2008/2/29/428)
>
> And according to numa_memory_policy.txt, if the user's nodemask includes
> nodes that are outside the range of the new set of allowed nodes, then
> the remap wraps around to the beginning of the nodemask and, if not already
> set, sets the node in the mempolicy nodemask.
>
> So in the example, if the user specifies 2-5, for a task whose mems_allowed
> is 3-7, the nodemasks should be remapped the third, fourth, fifth, sixth
> node in mems_allowed. like the following:
>
> mems_allowed: 3 4 5 6 7
>
> relative index: 0 1 2 3 4
> 5
>
> So the nodemasks should be remapped to 3,5-7, but not 3,5-6.
>
> And for a task whose mems_allowed is 0,2-3,5, the nodemasks should be
> remapped to 0,2-3,5, but not 0,3,5.
>
> mems_allowed: 0 2 3 5
>
> relative index: 0 1 2 3
> 4 5
>
>
> Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Wow. This was not an April fools joke, right?
Have there been any acks of this? I haven't seen any responses to it.
Andrew, do you want to merge it?
> ---
> Documentation/vm/numa_memory_policy.txt | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt
> index 4e7da65..badb050 100644
> --- a/Documentation/vm/numa_memory_policy.txt
> +++ b/Documentation/vm/numa_memory_policy.txt
> @@ -174,7 +174,6 @@ Components of Memory Policies
> allocation fails, the kernel will search other nodes, in order of
> increasing distance from the preferred node based on information
> provided by the platform firmware.
> - containing the cpu where the allocation takes place.
>
> Internally, the Preferred policy uses a single node--the
> preferred_node member of struct mempolicy. When the internal
> @@ -275,9 +274,9 @@ Components of Memory Policies
> For example, consider a task that is attached to a cpuset with
> mems 2-5 that sets an Interleave policy over the same set with
> MPOL_F_RELATIVE_NODES. If the cpuset's mems change to 3-7, the
> - interleave now occurs over nodes 3,5-6. If the cpuset's mems
> + interleave now occurs over nodes 3,5-7. If the cpuset's mems
> then change to 0,2-3,5, then the interleave occurs over nodes
> - 0,3,5.
> + 0,2-3,5.
>
> Thanks to the consistent remapping, applications preparing
> nodemasks to specify memory policies using this flag should
>
--
~Randy
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] doc, mempolicy: Fix wrong document in numa_memory_policy.txt
2014-04-10 23:23 ` Randy Dunlap
@ 2014-04-11 8:13 ` Tang Chen
2014-04-11 10:54 ` David Rientjes
1 sibling, 0 replies; 4+ messages in thread
From: Tang Chen @ 2014-04-11 8:13 UTC (permalink / raw)
To: Randy Dunlap
Cc: hannes, mhocko, bsingharora, kamezawa.hiroyu, cgroups, linux-mm,
linux-doc, linux-kernel, guz.fnst, Andrew Morton
Hi Randy,
On 04/11/2014 07:23 AM, Randy Dunlap wrote:
> On 04/01/2014 08:53 PM, Tang Chen wrote:
>> In document numa_memory_policy.txt, the following examples for flag
>> MPOL_F_RELATIVE_NODES are incorrect.
>>
>> For example, consider a task that is attached to a cpuset with
>> mems 2-5 that sets an Interleave policy over the same set with
>> MPOL_F_RELATIVE_NODES. If the cpuset's mems change to 3-7, the
>> interleave now occurs over nodes 3,5-6. If the cpuset's mems
>> then change to 0,2-3,5, then the interleave occurs over nodes
>> 0,3,5.
>>
>> According to the comment of the patch adding flag MPOL_F_RELATIVE_NODES,
>> the nodemasks the user specifies should be considered relative to the
>> current task's mems_allowed.
>> (https://lkml.org/lkml/2008/2/29/428)
>>
>> And according to numa_memory_policy.txt, if the user's nodemask includes
>> nodes that are outside the range of the new set of allowed nodes, then
>> the remap wraps around to the beginning of the nodemask and, if not already
>> set, sets the node in the mempolicy nodemask.
>>
>> So in the example, if the user specifies 2-5, for a task whose mems_allowed
>> is 3-7, the nodemasks should be remapped the third, fourth, fifth, sixth
>> node in mems_allowed. like the following:
>>
>> mems_allowed: 3 4 5 6 7
>>
>> relative index: 0 1 2 3 4
>> 5
>>
>> So the nodemasks should be remapped to 3,5-7, but not 3,5-6.
>>
>> And for a task whose mems_allowed is 0,2-3,5, the nodemasks should be
>> remapped to 0,2-3,5, but not 0,3,5.
>>
>> mems_allowed: 0 2 3 5
>>
>> relative index: 0 1 2 3
>> 4 5
>>
>>
>> Signed-off-by: Tang Chen<tangchen@cn.fujitsu.com>
>
> Wow. This was not an April fools joke, right?
>
> Have there been any acks of this? I haven't seen any responses to it.
Thanks for the reply. I found this problem when I was reading the doc.
I think it is wrong. And according to the original patch:
https://lkml.org/lkml/2008/2/29/428
I think it should be fixed in the above way. But if I was wrong, please
let me know, and I think we can at least improve the doc since it is
not that easy to understand.
Thanks. :)
>
> Andrew, do you want to merge it?
>
>
>> ---
>> Documentation/vm/numa_memory_policy.txt | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt
>> index 4e7da65..badb050 100644
>> --- a/Documentation/vm/numa_memory_policy.txt
>> +++ b/Documentation/vm/numa_memory_policy.txt
>> @@ -174,7 +174,6 @@ Components of Memory Policies
>> allocation fails, the kernel will search other nodes, in order of
>> increasing distance from the preferred node based on information
>> provided by the platform firmware.
>> - containing the cpu where the allocation takes place.
>>
>> Internally, the Preferred policy uses a single node--the
>> preferred_node member of struct mempolicy. When the internal
>> @@ -275,9 +274,9 @@ Components of Memory Policies
>> For example, consider a task that is attached to a cpuset with
>> mems 2-5 that sets an Interleave policy over the same set with
>> MPOL_F_RELATIVE_NODES. If the cpuset's mems change to 3-7, the
>> - interleave now occurs over nodes 3,5-6. If the cpuset's mems
>> + interleave now occurs over nodes 3,5-7. If the cpuset's mems
>> then change to 0,2-3,5, then the interleave occurs over nodes
>> - 0,3,5.
>> + 0,2-3,5.
>>
>> Thanks to the consistent remapping, applications preparing
>> nodemasks to specify memory policies using this flag should
>>
>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] doc, mempolicy: Fix wrong document in numa_memory_policy.txt
2014-04-10 23:23 ` Randy Dunlap
2014-04-11 8:13 ` Tang Chen
@ 2014-04-11 10:54 ` David Rientjes
1 sibling, 0 replies; 4+ messages in thread
From: David Rientjes @ 2014-04-11 10:54 UTC (permalink / raw)
To: Randy Dunlap
Cc: Tang Chen, hannes, mhocko, bsingharora, kamezawa.hiroyu, cgroups,
linux-mm, linux-doc, linux-kernel, guz.fnst, Andrew Morton
On Thu, 10 Apr 2014, Randy Dunlap wrote:
> On 04/01/2014 08:53 PM, Tang Chen wrote:
> > In document numa_memory_policy.txt, the following examples for flag
> > MPOL_F_RELATIVE_NODES are incorrect.
> >
> > For example, consider a task that is attached to a cpuset with
> > mems 2-5 that sets an Interleave policy over the same set with
> > MPOL_F_RELATIVE_NODES. If the cpuset's mems change to 3-7, the
> > interleave now occurs over nodes 3,5-6. If the cpuset's mems
> > then change to 0,2-3,5, then the interleave occurs over nodes
> > 0,3,5.
> >
> > According to the comment of the patch adding flag MPOL_F_RELATIVE_NODES,
> > the nodemasks the user specifies should be considered relative to the
> > current task's mems_allowed.
> > (https://lkml.org/lkml/2008/2/29/428)
> >
> > And according to numa_memory_policy.txt, if the user's nodemask includes
> > nodes that are outside the range of the new set of allowed nodes, then
> > the remap wraps around to the beginning of the nodemask and, if not already
> > set, sets the node in the mempolicy nodemask.
> >
> > So in the example, if the user specifies 2-5, for a task whose mems_allowed
> > is 3-7, the nodemasks should be remapped the third, fourth, fifth, sixth
> > node in mems_allowed. like the following:
> >
> > mems_allowed: 3 4 5 6 7
> >
> > relative index: 0 1 2 3 4
> > 5
> >
> > So the nodemasks should be remapped to 3,5-7, but not 3,5-6.
> >
> > And for a task whose mems_allowed is 0,2-3,5, the nodemasks should be
> > remapped to 0,2-3,5, but not 0,3,5.
> >
> > mems_allowed: 0 2 3 5
> >
> > relative index: 0 1 2 3
> > 4 5
> >
> >
> > Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
>
> Wow. This was not an April fools joke, right?
>
It would have been a horrible joke if it was intended to be :)
> Have there been any acks of this? I haven't seen any responses to it.
>
Because everybody in the phonebook was cc'd on it except for the author
who wrote it.
Tang, good catch.
Acked-by: David Rientjes <rientjes@google.com>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-11 10:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-02 3:53 [PATCH 1/1] doc, mempolicy: Fix wrong document in numa_memory_policy.txt Tang Chen
2014-04-10 23:23 ` Randy Dunlap
2014-04-11 8:13 ` Tang Chen
2014-04-11 10:54 ` David Rientjes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox