Re: [PATCH v2] block: invalidate cached plug timestamp after task switch
From: Peter Zijlstra
Date: Fri Jun 12 2026 - 05:47:05 EST
On Fri, Jun 12, 2026 at 02:40:42AM -0700, Usama Arif wrote:
> +static __always_inline void blk_plug_invalidate_ts(void)
> {
> + if (unlikely(current->flags & PF_BLOCK_TS)) {
> + struct blk_plug *plug = current->plug;
>
> + if (plug)
> + plug->cur_ktime = 0;
> + current->flags &= ~PF_BLOCK_TS;
> + }
> }
If you can guarantee PF_BLOCK_TS is only ever set when current->plug,
this can be reduced further.