Re: [PATCH 1/1] Use pmd_table() MACRO for unmap_area_sections()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 06, 2008 at 03:56:35AM +0300, Hiroshi DOYU wrote:
> Would it be possible to have "pmd_table()" definition "in pgtable.h"?

Well, the first question is... where has this come from, and why.

Looking at the omap tree, it's because of arch/arm/plat-omap/mmu.c,
which seems to be somewhat weird and complex, duplicating some of
what's going on elsewhere in the kernel.

(And with the changes I've just queued up for the next mainline merge
window, this file will probably break because of it's use of the kernel
page table macros.)

A more portable way to do that would be to split out the innards of
__arm_ioremap_pfn() into a separate function, and use that instead
of exmap_set_armmmu().  Then, replace exmap_clear_armmmu() with
unmap_area_sections() to tear down the ARM side of the mapping.

As far as 'mmu->twl_mm' goes, the only reason I can see for that
existing is as a way to use the kernel's page table accessors to
manipulate something that isn't used for as the CPU's page table,
which in turn leads to quite a number of nasty hacks in the code.
Really that wants to use its own accessors and macros, and twl_mm
eliminated.  A mm_struct isn't small.  And by doing so, you'll
avoid the bug and memory leak in omap_mmu_register().  kfree'ing
(!) a mm_struct onto a different slab cache from whence it came!

Which probably will mean that there ends up only being one place
where the construct which pmd_table() is replacing exists.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux