lkml.org 
[lkml]   [2023]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH mm-hotfixes-unstable] shmem: fix smaps BUG sleeping while atomic
On Tue, Aug 22, 2023 at 10:14:47PM -0700, Hugh Dickins wrote:
> smaps_pte_hole_lookup() is calling shmem_partial_swap_usage() with page
> table lock held: but shmem_partial_swap_usage() does cond_resched_rcu()
> if need_resched(): "BUG: sleeping function called from invalid context".
>
> Since shmem_partial_swap_usage() is designed to count across a range, but
> smaps_pte_hole_lookup() only calls it for a single page slot, just break
> out of the loop on the last or only page, before checking need_resched().
>
> Fixes: 230100321518 ("mm/smaps: simplify shmem handling of pte holes")
> Signed-off-by: Hugh Dickins <hughd@google.com>
> Cc: stable@vger.kernel.org # 5.16+

Oops.. thanks Hugh.

Acked-by: Peter Xu <peterx@redhat.com>

--
Peter Xu

\
 
 \ /
  Last update: 2023-08-23 18:42    [W:0.174 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site