xfs
[Top] [All Lists]

Re: [PATCH 009/119] xfs: convert list of extents to free into a regular

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH 009/119] xfs: convert list of extents to free into a regular list
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Sun, 17 Jul 2016 20:30:04 -0700
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160621005712.GN26977@dastard>
References: <146612627129.12839.3827886950949809165.stgit@xxxxxxxxxxxxxxxx> <146612632997.12839.18026491074892368053.stgit@xxxxxxxxxxxxxxxx> <20160617115930.GH19042@xxxxxxxxxxxxx> <20160618201509.GA5042@xxxxxxxxxxxxxxxx> <20160621005712.GN26977@dastard>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
On 6/20/16 5:57 PM, Dave Chinner wrote:
> On Sat, Jun 18, 2016 at 01:15:10PM -0700, Darrick J. Wong wrote:
>> On Fri, Jun 17, 2016 at 04:59:30AM -0700, Christoph Hellwig wrote:
>>>>  {
>>>> +  struct xfs_bmap_free_item       *new;           /* new element */
>>>>  #ifdef DEBUG
>>>>    xfs_agnumber_t          agno;
>>>>    xfs_agblock_t           agbno;
>>>> @@ -597,17 +595,7 @@ xfs_bmap_add_free(
>>>>    new = kmem_zone_alloc(xfs_bmap_free_item_zone, KM_SLEEP);
>>>>    new->xbfi_startblock = bno;
>>>>    new->xbfi_blockcount = (xfs_extlen_t)len;
>>>> +  list_add(&new->xbfi_list, &flist->xbf_flist);
>>>>    flist->xbf_count++;
>>>
>>> Please kill xbf_count while you're at it, it's entirely superflous.
>>
>> The deferred ops conversion patch kills this off by moving the whole
>> "defer an op to the next transaction by logging redo items" logic
>> into a separate file and mechanism.
>>
>> This patch is just a cleanup to reduce some of the open coded list ugliness
>> before starting on the rmap stuff.  Once the deferred ops code lands, all
>> three of these functions go away.
> 
> Ok, so because all these functions go away, I'll take this patch now
> without the suggested cleanups so that you don't have to rework it.
> 
> ....
> 
>>>> +  list_sort((*tp)->t_mountp, &flist->xbf_flist, xfs_bmap_free_list_cmp);
>>>
>>> Can you add a comment on why we are sorting the list?
>>
>> We sort the list so that we process the freed extents in AG order to
>> avoid deadlocking.
>>
>> I'll add a comment to the deferred ops code if there isn't one already.
> 
> This seems best - add the clean up to the later patches rather than
> have to rework lots of patches because of minor mods to early
> patches...

I'm woefully late to the game here, but adding comments later doesn't
help a future reader of commits like this, when neither the commit log
nor the patch contents explains things like why it's being sorted.

> then use list_sort to sort it prior to processing.

The changelog should say *why* a thing was done, not just *what* was
done; the diff already tells us that, right...

</soapbox>

-Eric

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 009/119] xfs: convert list of extents to free into a regular list, Eric Sandeen <=