[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231113082427.GB16138@noisy.programming.kicks-ass.net>
Date: Mon, 13 Nov 2023 09:24:27 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Chandan Babu R <chandan.babu@...cle.com>,
"Darrick J . Wong" <djwong@...nel.org>, linux-xfs@...r.kernel.org,
Mateusz Guzik <mjguzik@...il.com>
Subject: Re: [PATCH v3 1/4] locking: Add rwsem_assert_held() and
rwsem_assert_held_write()
On Fri, Nov 10, 2023 at 08:41:16PM +0000, Matthew Wilcox (Oracle) wrote:
> +static inline void rwsem_assert_held_nolockdep(const struct rw_semaphore *sem)
> +{
> + WARN_ON(atomic_long_read(&sem->count) == RWSEM_UNLOCKED_VALUE);
> +}
> +
> +static inline void rwsem_assert_held_write_nolockdep(const struct rw_semaphore *sem)
> +{
> + WARN_ON(!(atomic_long_read(&sem->count) & RWSEM_WRITER_LOCKED));
> +}
> +static inline void rwsem_assert_held_nolockdep(const struct rw_semaphore *sem)
> +{
> + BUG_ON(!rwsem_is_locked(sem));
> +}
What's with the WARN_ON() vs BUG_ON() thing?
Powered by blists - more mailing lists