[PATCH] (RFC) slaughter imalloc

John Rose johnrose at austin.ibm.com
Wed May 18 06:15:08 EST 2005


Hi Ben-

Great job!  The patch cleans things up nicely.

For PHB removal, iounmap_explicit() will be called for the range of the
PHB.  In many cases, this range will have gaps of invalidated PTEs from
children slots that have already been removed.  Will unmap_vm_area()
and/or the invalidate_pte hcall tolerate such gaps?  I don't know
enough to answer that w/o actually testing it.

While we're cleaning stuff up, we might look at naming the explicit
functions consistently.  I wrote them, so I'm the guilty party :)
__ioremap_explicit <-> iounmap_explicit, etc.

Here are some more comments:

+/*
+ * map_io_page currently only called by __ioremap

Not totally accurate, since explicit() calls it too :)  I should have 
removed this line...

+ * map_io_page adds an entry to the ioremap page table
+ * and adds an entry to the HPT, possibly bolting it
+ */
+static int map_io_page(unsigned long ea, unsigned long pa, int flags)
+{
+	pgd_t *pgdp;
+	pud_t *pudp;
+	pmd_t *pmdp;
+	pte_t *ptep;
+	unsigned long vsid;
+
+	if (mem_init_done) {
+		spin_lock(&init_mm.page_table_lock);
+		pgdp = pgd_offset_k(ea);
+		pudp = pud_alloc(&init_mm, pgdp, ea);
+		if (!pudp)
+			return -ENOMEM;
+		pmdp = pmd_alloc(&init_mm, pudp, ea);
+		if (!pmdp)
+			return -ENOMEM;
+		ptep = pte_alloc_kernel(&init_mm, pmdp, ea);
+		if (!ptep)
+			return -ENOMEM;
+		pa = abs_to_phys(pa);
+		set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
+							  __pgprot(flags)));
+		spin_unlock(&init_mm.page_table_lock);

Now that we're so vmalloc-hip, could we use map_vm_area() here?

+EXPORT_SYMBOL(ioremap_bot); /* poor XFS ... */

Does XFS really use this!?

Thanks-
John





More information about the Linuxppc64-dev mailing list