From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Balbir Singh <bsingharora@gmail.com>, alistair@popple.id.au
Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org,
Balbir Singh <bsingharora@gmail.com>
Subject: Re: [PATCH] powerpc/npu: Cleanup MMIO ATSD flushing
Date: Thu, 16 Nov 2017 11:54:22 +0530 [thread overview]
Message-ID: <87wp2qhhbd.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171113081611.27374-1-bsingharora@gmail.com>
Balbir Singh <bsingharora@gmail.com> writes:
+ address = start;
> + do {
> + local_irq_disable();
> + find_linux_pte(mm->pgd, address, &is_thp, &hshift);
> + if (!is_thp)
> + shift = PAGE_SHIFT;
It can still be hugetlb if is_thp is false.
> + else if (hshift && !is_thp)
> + shift = hshift;
> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> + else
> + shift = HPAGE_PMD_SIZE;
That is wrong. I guess it should be shift = HPAGE_PMD_SHIFT. But i am
not sure we need to make it this complex at all. See below.
> +#else
> + else {
> + shift = PAGE_SHIFT;
> + pr_warn_once("unsupport page size for mm %p,addr %lx\n",
> + mm, start);
> + }
> +#endif
I am still not sure this is correct from a pure page table walking
point. Why not
if (hshift)
shift = hshift;
else
shift = PAGE_SHIFT;
if you didn't want to differentiate between thp and hugetlb mapping you
can drop is_thp completely.
-aneesh
next prev parent reply other threads:[~2017-11-16 6:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-13 8:16 [PATCH] powerpc/npu: Cleanup MMIO ATSD flushing Balbir Singh
2017-11-16 6:24 ` Aneesh Kumar K.V [this message]
2017-11-17 2:49 ` Balbir Singh
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=87wp2qhhbd.fsf@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=alistair@popple.id.au \
--cc=bsingharora@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).