simple_lmk: Remove unnecessary clean-up when timeout is reached
Zeroing out the mm struct pointers when the timeout is hit isn't needed because mm_free_lock prevents any readers from accessing the mm struct pointers while clean-up occurs, and since the simple_lmk_mm_freed() loop bound is set to zero during clean-up, there is no possibility of dying processes ever reading stale mm struct pointers. Therefore, it is unnecessary to clear out the mm struct pointers when the timeout is reached. Now the only step to do when the timeout is reached is to re-init the completion, but since reinit_completion() just sets a struct member to zero, call reinit_completion() unconditionally as it is faster than encapsulating it within a conditional statement. Also take this opportunity to rename some variables and tidy up some code indentation. Signed-off-by:Sultan Alsawaf <sultan@kerneltoast.com> Signed-off-by:
Danny Lin <danny@kdrag0n.dev>
Loading
Please register or sign in to comment