Re: [PATCH 08/14] lockdep: Introduce lockdep_assume_ctx_held()

From: Bart Van Assche

Date: Thu Nov 05 2026 - 13:02:56 EST


On 11/5/26 6:58 AM, Peter Zijlstra wrote:
Aaah, so the 'solution' is to rename lockdep_assert_held(), such that
the pre-existing annotation doesn't pre-pollute things?

Yes.

But if you start
by converting existing lockdep_assert_held() to the new
lockdep_assume_*_ctx_held() you'll run into the exact same problems?

The number of lockdep_assert_held() users that has to be modified is
very small. There are only three cases in the entire kernel tree: futex,
kfence and Bluetooth. There three changes have been included in this
patch series. I have verified this by adding lock context annotations in
the entire kernel tree and by enabling lock context analysis for the
entire kernel tree. I'm sending the patches that add lock context
annotations to kernel maintainers as time permits. An example is
available here: "[PATCH v4 00/54] scsi: Enable context analysis for most
drivers"
(https://lore.kernel.org/linux-scsi/cover.1790360262.git.bvanassche@xxxxxxx/).

Thanks,

Bart.