All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Hugh Dickins <hughd@google.com>, Song Liu <songliubraving@fb.com>,
	Jiri Olsa <jolsa@kernel.org>,
	David Stevens <stevensd@chromium.org>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Peter Xu <peterx@redhat.com>,
	"Kirill A . Shutemov" <kirill@shutemov.name>,
	Yang Shi <shy828301@gmail.com>,
	David Hildenbrand <david@redhat.com>,
	Jiaqi Yan <jiaqiyan@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/3] mm/khugepaged: maintain page cache uptodate flag
Date: Thu, 23 Mar 2023 15:28:22 -0700	[thread overview]
Message-ID: <CAPhsuW5pTh2+S7VjRbRy=WUAb7-GLQpi6HKCW0ehxs5HAup_dQ@mail.gmail.com> (raw)
In-Reply-To: <ZBzK99dSmbPB7vjA@casper.infradead.org>

On Thu, Mar 23, 2023 at 2:56 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Thu, Mar 23, 2023 at 12:07:46PM -0700, Hugh Dickins wrote:
> > On an earlier audit, for different reasons, I did also run across
> > lib/buildid.c build_id_parse() using find_get_page() without checking
> > PageUptodate() - looks as if it might do the wrong thing if it races
> > with khugepaged collapsing text to huge, and should probably have a
> > similar fix.
>
> That shouldn't be using find_get_page().  It should probably use
> read_cache_folio() which will actually read in the data if it's not
> present in the page cache, and return an ERR_PTR if the data couldn't
> be read.

build_id_parse() can be called from NMI, so I don't think we can let
read_cache_folio() read-in the data.

Thanks,
Song

  reply	other threads:[~2023-03-23 22:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07  5:20 [PATCH v5 0/3] mm/khugepaged: fix khugepaged+shmem races David Stevens
2023-03-07  5:20 ` [PATCH v5 1/3] mm/khugepaged: refactor collapse_file control flow David Stevens
2023-03-23 19:51   ` Hugh Dickins
2023-03-07  5:20 ` [PATCH v5 2/3] mm/khugepaged: skip shmem with userfaultfd David Stevens
2023-03-23 19:48   ` Hugh Dickins
2023-03-24  5:34     ` David Stevens
2023-03-28 15:48       ` Peter Xu
2023-03-07  5:20 ` [PATCH v5 3/3] mm/khugepaged: maintain page cache uptodate flag David Stevens
2023-03-23 19:07   ` Hugh Dickins
2023-03-23 21:56     ` Matthew Wilcox
2023-03-23 22:28       ` Song Liu [this message]
2023-03-24  1:56         ` Hugh Dickins
2023-03-24  3:30           ` Matthew Wilcox
2023-03-24  6:03             ` Song Liu
2023-03-24 13:31               ` Matthew Wilcox
2023-03-29 16:53                 ` Song Liu
2023-03-28  9:48     ` David Stevens

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='CAPhsuW5pTh2+S7VjRbRy=WUAb7-GLQpi6HKCW0ehxs5HAup_dQ@mail.gmail.com' \
    --to=song@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=hughd@google.com \
    --cc=jiaqiyan@google.com \
    --cc=jolsa@kernel.org \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=shy828301@gmail.com \
    --cc=songliubraving@fb.com \
    --cc=stevensd@chromium.org \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.