Re: fixmap align initialization

Andrea Arcangeli (arcangeli@mbox.queen.it)
Tue, 11 Aug 1998 01:44:07 +0200 (CEST)


On Mon, 10 Aug 1998, MOLNAR Ingo wrote:

>> unsigned long apic_phys, ioapic_phys;
>>
>> + memory_start = PAGE_ALIGN(memory_start);
>
>we dont need this one here, as paging_init() aligns on page boundary
>already.

I know that the PAGE_ALIGN() are not needed but it' s nice for maintain
the thing and they don' t add memory or runtime overhead at all and the
two functions really depends on start_mem alignment.

>> - for (idx=1; idx < __end_of_fixed_addresses; idx += PTRS_PER_PTE)
>> + for (idx=0; idx < __end_of_fixed_addresses; idx += PTRS_PER_PTE)
>
>oops, right. This one still has a small bug when we have exactly 4092k
>fixmap mappings (quite unlikely :), so we need rather this one:

wwooppss, thanks. I noticed that I am used to add bug in bugfix argghh
;-).

> + for (idx=1; idx <= __end_of_fixed_addresses; idx += PTRS_PER_PTE)

This should be the right patch (feel free to remove the PAGE_ALIGN()s from
it since they are really not needed):

--- /usr/src/linux/arch/i386/mm/init.c Sat Aug 8 15:22:48 1998
+++ linux/arch/i386/mm/init.c Tue Aug 11 01:11:29 1998
@@ -210,15 +210,15 @@
/*
* allocate page table(s) for compile-time fixed mappings
*/
-static unsigned long fixmap_init (unsigned long start_mem)
+static unsigned long __init fixmap_init (unsigned long start_mem)
{
pgd_t * pg_dir;
unsigned int idx;
unsigned long address;

- start_mem &= PAGE_MASK;
+ start_mem = PAGE_ALIGN(start_mem);

- for (idx=1; idx < __end_of_fixed_addresses; idx += PTRS_PER_PTE)
+ for (idx=1; idx <= __end_of_fixed_addresses; idx += PTRS_PER_PTE)
{
address = fix_to_virt(__end_of_fixed_addresses-idx);
pg_dir = swapper_pg_dir + (address >> PGDIR_SHIFT);
--- /usr/src/linux/arch/i386/kernel/smp.c Sat Aug 8 15:20:09 1998
+++ linux/arch/i386/kernel/smp.c Mon Aug 10 19:45:36 1998
@@ -658,6 +658,7 @@
{
unsigned long apic_phys, ioapic_phys;

+ memory_start = PAGE_ALIGN(memory_start);
if (smp_found_config) {
apic_phys = mp_lapic_addr;
ioapic_phys = mp_ioapic_addr;

I would ask you also how much could be useful the per-IRQ stack patch. The
patch is pretty running now but still need some minor or major bugfix. So
before continue to work on that piece of code (not stable yet) I' d like
to know if I am working for something really needed. With 64 irq on a UP
machine the phys space alloced would be 64*4k = 256k of memory for the IRQ
stacks.

The problems with the patch happens using the network. I can' t understand
why sometimes the kernel locks running a `find /` via rlogin. If I map the
current-> page (the low 4k of irq kstack) read only, the kernel reset too.
Mapping it as PAGE_KERNEL the kernel "only" locks and run two long Oops
that goes out of screen (the second is inside show_regs() if I remeber
well) and I can' t go UP/DOWN with shift-PGUP/PGDOWN. I know, I am
touching really hot piece of code ;-).

The strange thing is that before implement the mmu trick and without
bother about current-> everything was pretty stable (except the
need_resched that was not updated).

Andrea[s] Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html