[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ad978b0c-b814-02ad-6304-6096d5cacf9a@huaweicloud.com>
Date: Mon, 4 Nov 2024 09:55:42 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 4/6] Xarray: skip unneeded xas_store() and
xas_clear_mark() in __xa_alloc()
on 11/2/2024 12:02 AM, Matthew Wilcox wrote:
> On Fri, Nov 01, 2024 at 11:50:26PM +0800, Kemeng Shi wrote:
>> If xas_find_marked() failed, there is no need to call xas_store() and
>> xas_clear_mark(). Just call xas_store() and xas_clear_mark() if
>> xas_find_marked() succeed.
>
> No. The point of the xas interfaces is that they turn into no-ops once
> an error has occurred.
Yes, xas interfaces can tolerate error. The question is do we really need to
call xas_store(...) here if we already know there is no room to store new entry.
But no insistant on this as it's not a big deal anyway.
Will drop this on next version if you still disklike this.
Thanks.
>
>> - else
>> + else {
>> *id = xas.xa_index;
>> - xas_store(&xas, entry);
>> - xas_clear_mark(&xas, XA_FREE_MARK);
>> + xas_store(&xas, entry);
>> + xas_clear_mark(&xas, XA_FREE_MARK);
>> + }
>> } while (__xas_nomem(&xas, gfp));
>>
>> return xas_error(&xas);
>> --
>> 2.30.0
>>
>
Powered by blists - more mailing lists