[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04ca54ad-0e03-84b1-bf5c-131a582137d4@codeaurora.org>
Date: Fri, 3 Dec 2021 17:25:40 +0530
From: Charan Teja Kalla <charante@...eaurora.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: Charan Teja Reddy <quic_charante@...cinc.com>, hughd@...gle.com,
akpm@...ux-foundation.org, vbabka@...e.cz, rientjes@...gle.com,
david@...hat.com, mhocko@...e.com, surenb@...gle.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm: shmem: implement POSIX_FADV_[WILL|DONT]NEED for
shmem
()
On 12/2/2021 9:24 PM, Matthew Wilcox wrote:
> Would this change to the documentation have prevented you from making
> this mistake?
>
> The advanced API is based around the xa_state. This is an opaque data
> structure which you declare on the stack using the XA_STATE()
> macro. This macro initialises the xa_state ready to start walking
> around the XArray. It is used as a cursor to maintain the position
> in the XArray and let you compose various operations together without
> -having to restart from the top every time.
> +having to restart from the top every time. The contents of the xa_state
> +are protected by the rcu_read_lock() or the xas_lock(). If you need to
> +drop whichever of those locks is protecting your state and tree, you must
> +call xas_pause() so that future calls do not rely on the parts of the
> +state which were left unprotected.
Yes, this looks much clear to me.
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum, a Linux Foundation Collaborative Project
Powered by blists - more mailing lists