linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Edward Liaw <edliaw@google.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH mm-hotfixes-unstable] shmem: fix smaps BUG sleeping while atomic
Date: Wed, 23 Aug 2023 12:41:00 -0400	[thread overview]
Message-ID: <ZOY2nMjTOVe2ozIS@x1n> (raw)
In-Reply-To: <6fe3b3ec-abdf-332f-5c23-6a3b3a3b11a9@google.com>

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



      reply	other threads:[~2023-08-23 16:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  5:14 Hugh Dickins
2023-08-23 16:41 ` Peter Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZOY2nMjTOVe2ozIS@x1n \
    --to=peterx@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=edliaw@google.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox