Thread (3 messages) flat view 3 messages, 2 authors, 2017-11-17

Re: [PATCH] powerpc/npu: Cleanup MMIO ATSD flushing

From: Aneesh Kumar K.V <hidden>
Date: 2017-11-16 06:24:31

Balbir Singh [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help