memcgroup: fix typo in VM_BUG_ON()
Subsystems (2)
PATCH 2/3 memcgroup: fix typo in VM_BUG_ON()
No need for VM_BUG_ON(pc), since 'pc' is the list entry. This should be VM_BUG_ON(page).
--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
mm/memcontrol.c +1 -1
@@ -534,7 +534,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,if (scan >= nr_to_scan)break ; page = pc->page; -VM_BUG_ON (!pc); +VM_BUG_ON (!page);if (unlikely (!PageLRU (page)))continue ;
Signature · 1 line
1.5.4.rc3
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>
pc is of type page_cgroup and we use list_for_each_entry_safe_reverse. Not sure why we can't bug on pc.
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
Quoted 14 lines
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +0
-0
mm/memcontrol.c unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, · line 537
Quoted 5 lines
mm/memcontrol.c +1
-1@@ -534,7 +534,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,if (scan >= nr_to_scan)break ; page = pc->page; -VM_BUG_ON (!pc); +VM_BUG_ON (!page);
can't page be NULL here if mem_cgroup_uncharge clears pc->page behind us? ie. bug.
YAMAMOTO Takashi
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>
pc is of type page_cgroup and we use list_for_each_entry_safe_reverse. Not sure why we can't bug on pc.
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
Quoted 9 lines
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.
pc is dereferenced before this VM_BUG_ON.
YAMAMOTO Takashi
Quoted 12 lines
Signature · 9 lines
-- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL _______________________________________________ Containers mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/containers
A message that is not in the archive (sent off-list or not yet received): 20080218062209.DA59B1E3C58-Pcsii4f/[email protected]
Quoted 4 lines · YAMAMOTO Takashi
Quoted 4 lines
Quoted 3 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Signed-off-by Li Zefan <[email protected]>pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.pc is dereferenced before this
VM_BUG_ON.YAMAMOTO Takashi
OK, so the VM_BUG_ON needs to move to an earlier location. Agreed.
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
Quoted 4 lines · YAMAMOTO Takashi
Quoted 4 lines
Quoted 3 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Signed-off-by Li Zefan <[email protected]>pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.pc is dereferenced before this
VM_BUG_ON.YAMAMOTO Takashi
OK, so the VM_BUG_ON needs to move to an earlier location. Agreed.
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
A message that is not in the archive (sent off-list or not yet received): 47B923C8.3090904-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Quoted 7 lines · Balbir Singh
Quoted 6 lines · YAMAMOTO Takashi
Quoted 6 lines
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.pc is dereferenced before this
VM_BUG_ON.YAMAMOTO Takashi
OK, so the
VM_BUG_ONneeds to move to an earlier location. Agreed.
No, 'pc' has been dereferenced in list_for_each_entry_safe_reverse().
#define list_for_each_entry_safe_reverse(pos, n, head, member) \
for (pos = list_entry((head)->prev, typeof(*pos), member), \
n = list_entry(pos->member.prev, typeof(*pos), member); \
^^^^^^^^^^^
&pos->member != (head); \
^^^^^^^^^^^
pos = n, n = list_entry(n->member.prev, typeof(*n), member))Quoted 7 lines · Balbir Singh
Quoted 6 lines · YAMAMOTO Takashi
Quoted 6 lines
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.pc is dereferenced before this
VM_BUG_ON.YAMAMOTO Takashi
OK, so the
VM_BUG_ONneeds to move to an earlier location. Agreed.
No, 'pc' has been dereferenced in list_for_each_entry_safe_reverse().
#define list_for_each_entry_safe_reverse(pos, n, head, member) \
for (pos = list_entry((head)->prev, typeof(*pos), member), \
n = list_entry(pos->member.prev, typeof(*pos), member); \
^^^^^^^^^^^
&pos->member != (head); \
^^^^^^^^^^^
pos = n, n = list_entry(n->member.prev, typeof(*n), member))A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 20 lines · Li Zefan
Quoted 7 lines · Balbir Singh
Quoted 6 lines · YAMAMOTO Takashi
Quoted 6 lines
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.pc is dereferenced before this
VM_BUG_ON.YAMAMOTO Takashi
OK, so the
VM_BUG_ONneeds to move to an earlier location. Agreed.No, 'pc' has been dereferenced in
list_for_each_entry_safe_reverse().
Quoted 8 lines
#define list_for_each_entry_safe_reverse(pos, n, head, member) \
for (pos = list_entry((head)->prev, typeof(*pos), member), \
n = list_entry(pos->member.prev, typeof(*pos), member); \
^^^^^^^^^^^
&pos->member != (head); \
^^^^^^^^^^^
pos = n, n = list_entry(n->member.prev, typeof(*n), member))Hmm.. We used to have a for loop with !list_empty() as a termination condition and VM_BUG_ON(!pc) is a spill over. With the new loop, VM_BUG_ON(!pc) does not make sense.
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
Quoted 20 lines · Li Zefan
Quoted 7 lines · Balbir Singh
Quoted 6 lines · YAMAMOTO Takashi
Quoted 6 lines
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.pc is dereferenced before this
VM_BUG_ON.YAMAMOTO Takashi
OK, so the
VM_BUG_ONneeds to move to an earlier location. Agreed.No, 'pc' has been dereferenced in
list_for_each_entry_safe_reverse().
Quoted 8 lines
#define list_for_each_entry_safe_reverse(pos, n, head, member) \
for (pos = list_entry((head)->prev, typeof(*pos), member), \
n = list_entry(pos->member.prev, typeof(*pos), member); \
^^^^^^^^^^^
&pos->member != (head); \
^^^^^^^^^^^
pos = n, n = list_entry(n->member.prev, typeof(*n), member))Hmm.. We used to have a for loop with !list_empty() as a termination condition and VM_BUG_ON(!pc) is a spill over. With the new loop, VM_BUG_ON(!pc) does not make sense.
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
A message that is not in the archive (sent off-list or not yet received): 47B92D47.2050008-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Quoted 29 lines · Balbir Singh
Quoted 19 lines · Li Zefan
Quoted 7 lines · Balbir Singh
Quoted 6 lines · YAMAMOTO Takashi
Quoted 6 lines
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.pc is dereferenced before this
VM_BUG_ON.YAMAMOTO Takashi
OK, so the
VM_BUG_ONneeds to move to an earlier location. Agreed.No, 'pc' has been dereferenced in
list_for_each_entry_safe_reverse().Quoted 8 lines
#define list_for_each_entry_safe_reverse(pos, n, head, member) \ for (pos = list_entry((head)->prev, typeof(*pos), member), \ n = list_entry(pos->member.prev, typeof(*pos), member); \ ^^^^^^^^^^^ &pos->member != (head); \ ^^^^^^^^^^^ pos = n, n = list_entry(n->member.prev, typeof(*n), member))
Quoted 5 lines
Hmm.. We used to have a for loop with !list_empty() as a termination condition and
VM_BUG_ON(!pc)is a spill over. With the new loop,VM_BUG_ON(!pc)does not make sense.
I see, and I'll post a new patch to just remove it.
PATCH 1/1 memcgroup: remove a useless VM_BUG_ON()
In reply to a message not in the archiveRemove this VM_BUG_ON(), as Balbir stated:
We used to have a for loop with !list_empty() as a termination condition and VM_BUG_ON(!pc) is a spill over. With the new loop, VM_BUG_ON(!pc) does not make sense.
--- mm/memcontrol.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
mm/memcontrol.c +0 -1
@@ -534,7 +534,6 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,if (scan >= nr_to_scan)break ; page = pc->page; -VM_BUG_ON (!pc);if (unlikely (!PageLRU (page)))continue ;
Signature · 1 line
1.5.4.rc3
Quoted 29 lines · Balbir Singh
Quoted 19 lines · Li Zefan
Quoted 7 lines · Balbir Singh
Quoted 6 lines · YAMAMOTO Takashi
Quoted 6 lines
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.pc is dereferenced before this
VM_BUG_ON.YAMAMOTO Takashi
OK, so the
VM_BUG_ONneeds to move to an earlier location. Agreed.No, 'pc' has been dereferenced in
list_for_each_entry_safe_reverse().Quoted 8 lines
#define list_for_each_entry_safe_reverse(pos, n, head, member) \ for (pos = list_entry((head)->prev, typeof(*pos), member), \ n = list_entry(pos->member.prev, typeof(*pos), member); \ ^^^^^^^^^^^ &pos->member != (head); \ ^^^^^^^^^^^ pos = n, n = list_entry(n->member.prev, typeof(*n), member))
Quoted 5 lines
Hmm.. We used to have a for loop with !list_empty() as a termination condition and
VM_BUG_ON(!pc)is a spill over. With the new loop,VM_BUG_ON(!pc)does not make sense.
I see, and I'll post a new patch to just remove it.
PATCH 1/1 memcgroup: remove a useless VM_BUG_ON()
In reply to Balbir SinghRemove this VM_BUG_ON(), as Balbir stated:
We used to have a for loop with !list_empty() as a termination condition and VM_BUG_ON(!pc) is a spill over. With the new loop, VM_BUG_ON(!pc) does not make sense.
--- mm/memcontrol.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
mm/memcontrol.c +0 -1
@@ -534,7 +534,6 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,if (scan >= nr_to_scan)break ; page = pc->page; -VM_BUG_ON (!pc);if (unlikely (!PageLRU (page)))continue ;
Signature · 1 line
1.5.4.rc3
A message that is not in the archive (sent off-list or not yet received): [email protected]
Balbir Singh
Acked-byRe: [PATCH] memcgroup: remove a useless VM_BUG_ON()
Quoted 16 lines · Li Zefan
Remove this
VM_BUG_ON(), as Balbir stated:We used to have a for loop with !list_empty() as a termination condition and
VM_BUG_ON(!pc)is a spill over. With the new loop,VM_BUG_ON(!pc)does not make sense.Signed-off-by Li Zefan <[email protected]>--- mm/memcontrol.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)mm/memcontrol.c +0
-0
mm/memcontrol.c unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, · line 539
Quoted 7 lines
mm/memcontrol.c +0
-1@@ -534,7 +534,6 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,if (scan >= nr_to_scan)break ; page = pc->page; -VM_BUG_ON (!pc);if (unlikely (!PageLRU (page)))continue ;
This seems much better
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
KAMEZAWA Hiroyuki
Acked-byRe: [PATCH] memcgroup: remove a useless VM_BUG_ON()
In reply to a message not in the archiveQuoted 26 lines · On Mon, 18 Feb 2008 15:34:48 +0800 Li Zefan…
Remove this
VM_BUG_ON(), as Balbir stated:We used to have a for loop with !list_empty() as a termination condition and
VM_BUG_ON(!pc)is a spill over. With the new loop,VM_BUG_ON(!pc)does not make sense.Signed-off-by Li Zefan <[email protected]>--- mm/memcontrol.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)mm/memcontrol.c +0
-1@@ -534,7 +534,6 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,if (scan >= nr_to_scan)break ; page = pc->page; -VM_BUG_ON (!pc);if (unlikely (!PageLRU (page)))continue ;Signature · 1 line
1.5.4.rc3
Thanks,
-Kame
Re: [PATCH] memcgroup: remove a useless VM_BUG_ON()
In reply to Li ZefanQuoted 16 lines · Li Zefan
Remove this
VM_BUG_ON(), as Balbir stated:We used to have a for loop with !list_empty() as a termination condition and
VM_BUG_ON(!pc)is a spill over. With the new loop,VM_BUG_ON(!pc)does not make sense.Signed-off-by Li Zefan <[email protected]>--- mm/memcontrol.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)mm/memcontrol.c +0
-0
mm/memcontrol.c unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, · line 539
Quoted 7 lines
mm/memcontrol.c +0
-1@@ -534,7 +534,6 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,if (scan >= nr_to_scan)break ; page = pc->page; -VM_BUG_ON (!pc);if (unlikely (!PageLRU (page)))continue ;
This seems much better
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
Re: [PATCH] memcgroup: remove a useless VM_BUG_ON()
In reply to Li ZefanQuoted 26 lines · On Mon, 18 Feb 2008 15:34:48 +0800 Li Zefan <[email protected]> wrote:
Remove this
VM_BUG_ON(), as Balbir stated:We used to have a for loop with !list_empty() as a termination condition and
VM_BUG_ON(!pc)is a spill over. With the new loop,VM_BUG_ON(!pc)does not make sense.Signed-off-by Li Zefan <[email protected]>--- mm/memcontrol.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)mm/memcontrol.c +0
-1@@ -534,7 +534,6 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,if (scan >= nr_to_scan)break ; page = pc->page; -VM_BUG_ON (!pc);if (unlikely (!PageLRU (page)))continue ;Signature · 1 line
1.5.4.rc3
Thanks,
-Kame
A message that is not in the archive (sent off-list or not yet received): 47B9223C.9020106-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Quoted 9 lines
Quoted 5 lines · Li Zefan
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>pc is of type
page_cgroupand we uselist_for_each_entry_safe_reverse. Not sure why we can't bug on pc.
pc is dereferenced before this VM_BUG_ON.
YAMAMOTO Takashi
Quoted 12 lines
Signature · 9 lines
-- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL _______________________________________________ Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org https://lists.linux-foundation.org/mailman/listinfo/containers
Quoted 14 lines
No need for
VM_BUG_ON(pc), since 'pc' is the list entry. This should beVM_BUG_ON(page).Signed-off-by Li Zefan <[email protected]>--- mm/memcontrol.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)mm/memcontrol.c +0
-0
mm/memcontrol.c unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, · line 537
Quoted 5 lines
mm/memcontrol.c +1
-1@@ -534,7 +534,7 @@ unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,if (scan >= nr_to_scan)break ; page = pc->page; -VM_BUG_ON (!pc); +VM_BUG_ON (!page);
can't page be NULL here if mem_cgroup_uncharge clears pc->page behind us? ie. bug.
YAMAMOTO Takashi