OpenVZ Forum


Home » Mailing lists » Devel » Re: [PATCH 2/3] memcgroup: fix typo in VM_BUG_ON()
Re: [PATCH 2/3] memcgroup: fix typo in VM_BUG_ON() [message #27431] Mon, 18 February 2008 06:14 Go to next message
Balbir Singh is currently offline  Balbir Singh
Messages: 491
Registered: August 2006
Senior Member
Li Zefan wrote:
> No need for VM_BUG_ON(pc), since 'pc' is the list entry. This should
> be VM_BUG_ON(page).
> 
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

pc is of type page_cgroup and we use list_for_each_entry_safe_reverse. Not sure
why we can't bug on pc.



-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 2/3] memcgroup: fix typo in VM_BUG_ON() [message #27433 is a reply to message #27431] Mon, 18 February 2008 06:22 Go to previous messageGo to next message
yamamoto is currently offline  yamamoto
Messages: 97
Registered: July 2007
Member
> Li Zefan wrote:
> > No need for VM_BUG_ON(pc), since 'pc' is the list entry. This should
> > be VM_BUG_ON(page).
> > 
> > Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> 
> pc is of type page_cgroup and we use list_for_each_entry_safe_reverse. Not sure
> why we can't bug on pc.

pc is dereferenced before this VM_BUG_ON.

YAMAMOTO Takashi

> 
> 
> 
> -- 
> 	Warm Regards,
> 	Balbir Singh
> 	Linux Technology Center
> 	IBM, ISTL
> _______________________________________________
> Containers mailing list
> Containers@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/containers
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 2/3] memcgroup: fix typo in VM_BUG_ON() [message #27434 is a reply to message #27433] Mon, 18 February 2008 06:20 Go to previous messageGo to next message
Balbir Singh is currently offline  Balbir Singh
Messages: 491
Registered: August 2006
Senior Member
YAMAMOTO Takashi wrote:
>> Li Zefan wrote:
>>> No need for VM_BUG_ON(pc), since 'pc' is the list entry. This should
>>> be VM_BUG_ON(page).
>>>
>>> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
>>> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>> pc is of type page_cgroup and we use list_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.

-- 
	Warm Regards,
	Balbir Singh
	Linux Technology Center
	IBM, ISTL
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 2/3] memcgroup: fix typo in VM_BUG_ON() [message #27509 is a reply to message #27434] Mon, 18 February 2008 06:47 Go to previous message
Li Zefan is currently offline  Li Zefan
Messages: 90
Registered: February 2008
Member
Balbir Singh wrote:
> YAMAMOTO Takashi wrote:
>>> Li Zefan wrote:
>>>> No need for VM_BUG_ON(pc), since 'pc' is the list entry. This should
>>>> be VM_BUG_ON(page).
>>>>
>>>> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
>>>> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>>> pc is of type page_cgroup and we use list_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.
> 

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))

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: Re: [PATCH 2/3] memcgroup: fix typo in VM_BUG_ON()
Next Topic: Re: [PATCH 2/3] memcgroup: fix typo in VM_BUG_ON()
Goto Forum:
  


Current Time: Tue Aug 26 15:47:40 GMT 2025

Total time taken to generate the page: 0.08437 seconds