linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Balbir Singh <bsingharora@gmail.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Alistair Popple <alistair@popple.id.au>,
	Michael Ellerman <mpe@ellerman.id.au>,
	"open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)"
	<linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] powerpc/npu: Cleanup MMIO ATSD flushing
Date: Fri, 17 Nov 2017 13:49:11 +1100	[thread overview]
Message-ID: <CAKTCnzmnOzGppZf3euCN=B9uwotC5u4YySYdi5bg4ZdYVA708w@mail.gmail.com> (raw)
In-Reply-To: <87wp2qhhbd.fsf@linux.vnet.ibm.com>

On Thu, Nov 16, 2017 at 5:24 PM, Aneesh Kumar K.V
<aneesh.kumar@linux.vnet.ibm.com> wrote:
> 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.
>

Yep, the hshift check needs to be upfront, the version below makes sense.

>> +             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;
>

I don't think I care about THP at this point

I'll respin

Balbir

      reply	other threads:[~2017-11-17  2:49 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
2017-11-17  2:49   ` Balbir Singh [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='CAKTCnzmnOzGppZf3euCN=B9uwotC5u4YySYdi5bg4ZdYVA708w@mail.gmail.com' \
    --to=bsingharora@gmail.com \
    --cc=alistair@popple.id.au \
    --cc=aneesh.kumar@linux.vnet.ibm.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).