Re: [PATCH 3/3] livepatch: Avoid potential RCU stalls in klp transition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 11, 2025 at 02:24:37PM +0800, Yafang Shao wrote:
> +++ b/kernel/livepatch/transition.c
> @@ -491,9 +491,18 @@ void klp_try_complete_transition(void)
>  			complete = false;
>  			break;
>  		}
> +
> +		/* Avoid potential RCU stalls */
> +		if (need_resched()) {
> +			complete = false;
> +			break;
> +		}
>  	}
>  	read_unlock(&tasklist_lock);
>  
> +	/* The above operation might be expensive. */
> +	cond_resched();
> +

This is also nasty, yet another reason to use rcu_read_lock() if we can.

Also, with the new lazy preemption model, I believe cond_resched() is
pretty much deprecated.

Also, for future patch sets, please also add lkml to cc.  Thanks.

-- 
Josh




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux