From: David Rientjes <rientjes@google.com>
To: Zach O'Keefe <zokeefe@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, Hugh Dickins <hughd@google.com>,
Yang Shi <shy828301@gmail.com>,
Miaohe Lin <linmiaohe@huawei.com>
Subject: Re: [PATCH mm-unstable 2/4] mm/khugepaged: consistently order cc->is_khugepaged and pte_* checks
Date: Wed, 20 Jul 2022 17:42:40 -0700 (PDT) [thread overview]
Message-ID: <4943bf1c-92dc-14d8-7fc7-b1a1d3dd06a@google.com> (raw)
In-Reply-To: <20220720140603.1958773-3-zokeefe@google.com>
On Wed, 20 Jul 2022, Zach O'Keefe wrote:
> cc->is_khugepaged is used to predicate the khugepaged-only behavior
> of enforcing khugepaged heuristics limited by the sysfs knobs
> khugepaged_max_ptes_[none|swap|shared].
>
> In branches where khugepaged_max_ptes_* is checked, consistently check
> cc->is_khugepaged first. Also, local counters (for comparison vs
> khugepaged_max_ptes_* limits) were previously incremented in the
> comparison expression. Some of these counters (unmapped) are
> additionally used outside of khugepaged_max_ptes_* enforcement, and
> all counters are communicated in tracepoints. Move the correct
> accounting of these counters before branching statements to avoid future
> errors due to C's short-circuiting evaluation.
>
> Fixes: 9fab4752a181 ("mm/khugepaged: add flag to predicate khugepaged-only behavior")
> Link: https://lore.kernel.org/linux-mm/Ys2qJm6FaOQcxkha@google.com/
> Signed-off-by: Zach O'Keefe <zokeefe@google.com>
Acked-by: David Rientjes <rientjes@google.com>
next prev parent reply other threads:[~2022-07-21 0:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 14:05 [PATCH mm-unstable 0/4] mm: fixes for userspace hugepage collapse, v7 Zach O'Keefe
2022-07-20 14:06 ` [PATCH mm-unstable 1/4] mm/khugepaged: Use minimal bits to store num page < HPAGE_PMD_NR Zach O'Keefe
2022-07-20 17:26 ` Yang Shi
2022-07-21 0:41 ` David Rientjes
2022-07-20 14:06 ` [PATCH mm-unstable 2/4] mm/khugepaged: consistently order cc->is_khugepaged and pte_* checks Zach O'Keefe
2022-07-20 17:27 ` Yang Shi
2022-07-20 19:09 ` Zach O'Keefe
2022-07-21 0:42 ` David Rientjes [this message]
2022-07-20 14:06 ` [PATCH mm-unstable 3/4] mm/khugepaged: delay computation of hpage boundaries until use Zach O'Keefe
2022-07-20 17:30 ` Yang Shi
2022-07-21 0:43 ` David Rientjes
2022-07-20 14:06 ` [PATCH mm-unstable 4/4] Revert "mm/madvise: add huge_memory:mm_madvise_collapse tracepoint" Zach O'Keefe
2022-07-20 17:30 ` Yang Shi
2022-07-21 0:43 ` David Rientjes
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=4943bf1c-92dc-14d8-7fc7-b1a1d3dd06a@google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linmiaohe@huawei.com \
--cc=linux-mm@kvack.org \
--cc=shy828301@gmail.com \
--cc=zokeefe@google.com \
/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;
as well as URLs for NNTP newsgroup(s).