[PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-30 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues While free'ing qgroup->reserved resources, we much check if the page has not been invalidated by a truncate operation by checking if the page is still dirty before reducing the qgroup resources. Resources in such a case are free'd when the entire extent

Re: [PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-29 Thread Qu Wenruo
At 09/30/2016 10:18 AM, Qu Wenruo wrote: Your original fix is good. Feel free to my tag after enriching the comment in btrfs_invalidatepage(). Feel free to "add" my tag... Reviewed-by: Qu Wenruo Thanks again for your founding and sorry for the extra time

Re: [PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-29 Thread Qu Wenruo
Your original fix is good. Feel free to my tag after enriching the comment in btrfs_invalidatepage(). Reviewed-by: Qu Wenruo Thanks again for your founding and sorry for the extra time reviewing. Thanks Qu At 09/29/2016 07:13 PM, Goldwyn Rodrigues wrote: On

Re: [PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-29 Thread Qu Wenruo
At 09/29/2016 07:13 PM, Goldwyn Rodrigues wrote: On 09/29/2016 03:57 AM, Qu Wenruo wrote: Thanks for your test script. I succeeded in pinning down the problem. The problem is, btrfs is invalidate pages that belongs to ordered extent(goes through writeback) No, I don't think invalidated

Re: [PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-29 Thread Goldwyn Rodrigues
On 09/29/2016 03:57 AM, Qu Wenruo wrote: > Thanks for your test script. > > I succeeded in pinning down the problem. > > The problem is, btrfs is invalidate pages that belongs to ordered > extent(goes through writeback) No, I don't think invalidated pages are going through writeback. The

Re: [PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-29 Thread Qu Wenruo
Thanks for your test script. I succeeded in pinning down the problem. The problem is, btrfs is invalidate pages that belongs to ordered extent(goes through writeback) The ftrace(with more tracepoints to trace qgroup->reserved change) shows: -- btrfs_qgroup_release_data: root=257,

Re: [PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-27 Thread Goldwyn Rodrigues
On 09/27/2016 08:44 PM, Qu Wenruo wrote: > Finally reproduced it. > > Although in a low chance, about 1/10. > > Under most case, the final remove gets executed without error. Change 50m to 500m while setting the qgroup limit, the probability will increase. -- Goldwyn -- To unsubscribe

Re: [PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-27 Thread Qu Wenruo
At 09/27/2016 10:04 PM, Goldwyn Rodrigues wrote: On 09/26/2016 10:10 PM, Qu Wenruo wrote: At 09/26/2016 10:31 PM, Goldwyn Rodrigues wrote: On 09/25/2016 09:33 PM, Qu Wenruo wrote: At 09/23/2016 09:43 PM, Goldwyn Rodrigues wrote: [snipped] Sorry I still don't get the point.

Re: [PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-27 Thread Goldwyn Rodrigues
On 09/26/2016 10:10 PM, Qu Wenruo wrote: > > > At 09/26/2016 10:31 PM, Goldwyn Rodrigues wrote: >> >> >> On 09/25/2016 09:33 PM, Qu Wenruo wrote: >>> >>> >>> At 09/23/2016 09:43 PM, Goldwyn Rodrigues wrote: > [snipped] >>> >>> Sorry I still don't get the point. >>> Would you please

Re: [PATCH] qgroup: Prevent qgroup->reserved from going subzero

2016-09-26 Thread Qu Wenruo
At 09/26/2016 10:31 PM, Goldwyn Rodrigues wrote: On 09/25/2016 09:33 PM, Qu Wenruo wrote: At 09/23/2016 09:43 PM, Goldwyn Rodrigues wrote: [snipped] Sorry I still don't get the point. Would you please give a call flow of the timing dirtying page and calling