Anyone tried 2.5.[23] on Alpha?
Subsystems (3)
I just wanted to check if anyone has tried 2.5.[23] on Alpha yet. It appears Ingo's scheduler changes haven't been ported to work on the Alpha platform as yet. I went through the pain yesterday of updating most of the 2.5.2 code and it now compiles, but the system crashes right at the beginning of init_idle(). I can send the patches I have so far, but seeing as it doesn't even come close to booting, I'm not sure I got this much right. ;) Anyone?
- Pete
Quoted 3 lines · Peter Rival
I just wanted to check if anyone has tried 2.5.[23] on Alpha yet. It appears Ingo's scheduler changes haven't been ported to work on the Alpha platform as yet.
I'm running 2.5.3-pre1 on sx164 right now with these patches. The scheduler changes are untested on SMP though.
Ivan.
include/asm-alpha/io.h +3 -1
@@ -60,7 +60,9 @@ static inline void * phys_to_virt(unsignreturn (void *) (address +IDENT_ADDR ); } -#define page_to_phys (page) (((page) - (page)->zone->zone_mem_map) << PAGE_SHIFT) +#define page_to_phys PAGE_TO_PA +/* This depends on working iommu */ +#define BIO_VMERGE_BOUNDARY (alpha_mv.mv_pci_tbi ? PAGE_SIZE : 0)/* * Change addresses as seen by the kernel (virtual) to addresses as
include/asm-alpha/bitops.h +11 -0
@@ -73,6 +73,17 @@ clear_bit(unsigned long nr, volatile voi/* * WARNING: non atomic version. */ +static inline void +__clear_bit (unsigned long nr,volatile void * addr) +{ +int *m = ((int *) addr) + (nr >>5 ); + + *m &= ~(1 << (nr &31 )); +} + +/* +* WARNING: non atomic version. +*/ static __inline__void __change_bit (unsigned long nr,volatile void * addr) {
include/asm-alpha/smp.h +1 -1
@@ -55,7 +55,7 @@ extern int __cpu_logical_map[NR_CPUS];#define cpu_logical_map (cpu) __cpu_logical_map[cpu]#define hard_smp_processor_id () __hard_smp_processor_id() -#define smp_processor_id () (current->processor) +#define smp_processor_id () (current->cpu)extern unsigned long cpu_present_mask;#define cpu_online_map cpu_present_mask
include/asm-alpha/sched.h +30 -0
@@ -0,0 +1,30 @@ +#ifndef __ALPHA_SCHED_H +#define __ALPHA_SCHED_H + +/* +* Required for scheduler. +*/ + +#include <asm/bitops.h> + +#if MAX_RT_PRIO !=128 ||MAX_PRIO !=168 +# error update this function. +#endif + +static inline int +sched_find_first_zero_bit (unsigned long *bitmap) +{ +unsigned long b0 = bitmap[0 ]; +unsigned long b1 = bitmap[1 ]; +unsigned long b2 = bitmap[2 ]; +unsigned long ofs =MAX_RT_PRIO ; + +if (unlikely (~(b0 & b1) !=0 )) { + b2 = (~b0 ? b0 : b1); + ofs = (~b0 ?0 :64 ); + } + +return ffz (b2) + ofs; +} + +#endif /* __ALPHA_SCHED_H */
include/asm-alpha/mmu_context.h +1 -0
@@ -10,6 +10,7 @@#include <linux/config.h> #include <asm/system.h> #include <asm/machvec.h> +#include <asm/sched.h> /* * Force a context reload. This is needed when we change the page
drivers/pci/pci.c +1 -0
@@ -23,6 +23,7 @@#include <linux/kmod.h> /* for hotplug_path */ #include <linux/bitops.h> #include <linux/delay.h> +#include <linux/sched.h> #include <asm/page.h> #include <asm/dma.h> /* isa_dma_bridge_buggy */
arch/alpha/mm/fault.c +1 -2
@@ -196,8 +196,7 @@ no_context:*/ out_of_memory:if (current->pid ==1 ) { - current->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }
arch/alpha/kernel/setup.c +1 -1
@@ -437,7 +437,7 @@ static void srm_console_write(struct constatic kdev_t srm_console_device (struct console *c) {/* Huh? */ -return MKDEV (TTY_MAJOR ,64 + c->index); +return mk_kdev (TTY_MAJOR ,64 + c->index); }static int __init srm_console_setup (struct console *co,char *options)
arch/alpha/kernel/srm_env.c +1 -0
@@ -43,6 +43,7 @@#include <linux/proc_fs.h> #include <asm/console.h> #include <asm/uaccess.h> +#include <asm/machvec.h> #define DIRNAME "srm_environment"/* Subdir in /proc/ */ #define VERSION "0.0.2"/* Module version */
arch/alpha/kernel/pci-noop.c +2 -0
@@ -106,6 +106,7 @@ sys_pciconfig_write(unsigned long bus, uvoid *pci_alloc_consistent (struct pci_dev *pdev,size_t size,dma_addr_t *dma_addrp) { +return NULL ; } void pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr,
@@ -116,6 +117,7 @@ dma_addr_t pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size, int direction) { + return 0; } void pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
arch/alpha/kernel/process.c +1 -2
@@ -30,6 +30,7 @@#include <linux/reboot.h> #include <linux/tty.h> #include <linux/console.h> +#include <linux/init_task.h> #include <asm/reg.h> #include <asm/uaccess.h>
@@ -74,8 +75,6 @@ voidcpu_idle (void) {/* An endless idle loop with no priority at all. */ - current->nice =20 ; -while (1 ) {/* FIXME -- EV6 and LCA45 know how to power down the CPU. */
arch/alpha/kernel/smp.c +2 -16
@@ -156,11 +156,6 @@ smp_callin(void) {int cpuid =hard_smp_processor_id (); -if (current != init_tasks[cpu_number_map (cpuid)]) { -printk ("BUG: smp_calling: cpu %d current %p init_tasks[cpu_number_map(cpuid)] %p\n" , - cpuid, current, init_tasks[cpu_number_map (cpuid)]); - } -DBGS (("CALLIN %d state 0x%lx\n" , cpuid, current->state));/* Turn on machine checks. */
@@ -491,14 +486,11 @@ smp_boot_one_cpu(int cpuid, int cpunum)if (idle == &init_task)panic ("idle process is init_task for CPU %d" , cpuid); - idle->processor = cpuid; - idle->cpus_runnable =1 << cpuid;/* we schedule the first task manually */ + idle->cpu = cpuid; __cpu_logical_map[cpunum] = cpuid; __cpu_number_map[cpuid] = cpunum; -del_from_runqueue (idle);unhash_process (idle); - init_tasks[cpunum] = idle;DBGS (("smp_boot_one_cpu: CPU %d state 0x%lx flags 0x%lx\n" , cpuid, idle->state, idle->flags));
@@ -605,17 +597,11 @@ smp_boot_cpus(void) __cpu_number_map[boot_cpuid] =0 ; __cpu_logical_map[0 ] = boot_cpuid; - current->processor = boot_cpuid; + current->cpu = boot_cpuid;smp_store_cpu_info (boot_cpuid);smp_tune_scheduling (boot_cpuid);smp_setup_percpu_timer (boot_cpuid); - -init_idle (); - -/* ??? This should be in init_idle. */ -atomic_inc (&init_mm.mm_count); - current->active_mm = &init_mm;/* Nothing to do on a UP box, or when told not to. */ if (smp_num_probed ==1 || max_cpus ==0 ) {
Boots and runs fine on my 4 CPU, 8 GB ES45 - cc'ed to Linus. Linus - we need these changes for Alpha to boot any 2.5 after 2.5.2 due to the scheduling changes.
- Pete
Quoted 228 lines · Ivan Kokshaysky
Quoted 2 lines · Peter Rival
I just wanted to check if anyone has tried 2.5.[23] on Alpha yet. It appears Ingo's scheduler changes haven't been ported to work on the Alpha platform as yet.
I'm running 2.5.3-pre1 on sx164 right now with these patches. The scheduler changes are untested on SMP though.
Ivan.
include/asm-alpha/io.h +3
-1@@ -60,7 +60,9 @@ static inline void * phys_to_virt(unsignreturn (void *) (address +IDENT_ADDR ); } -#define page_to_phys (page) (((page) - (page)->zone->zone_mem_map) << PAGE_SHIFT) +#define page_to_phys PAGE_TO_PA +/* This depends on working iommu */ +#define BIO_VMERGE_BOUNDARY (alpha_mv.mv_pci_tbi ? PAGE_SIZE : 0)/* * Change addresses as seen by the kernel (virtual) to addresses as include/asm-alpha/bitops.h +11
-0@@ -73,6 +73,17 @@ clear_bit(unsigned long nr, volatile voi/* * WARNING: non atomic version. */ +static inline void +__clear_bit (unsigned long nr,volatile void * addr) +{ +int *m = ((int *) addr) + (nr >>5 ); + + *m &= ~(1 << (nr &31 )); +} + +/* +* WARNING: non atomic version. +*/ static __inline__void __change_bit (unsigned long nr,volatile void * addr) {include/asm-alpha/smp.h +1
-1@@ -55,7 +55,7 @@ extern int __cpu_logical_map[NR_CPUS];#define cpu_logical_map (cpu) __cpu_logical_map[cpu]#define hard_smp_processor_id () __hard_smp_processor_id() -#define smp_processor_id () (current->processor) +#define smp_processor_id () (current->cpu)extern unsigned long cpu_present_mask;#define cpu_online_map cpu_present_maskinclude/asm-alpha/sched.h +30
-0@@ -0,0 +1,30 @@ +#ifndef __ALPHA_SCHED_H +#define __ALPHA_SCHED_H + +/* +* Required for scheduler. +*/ + +#include <asm/bitops.h> + +#if MAX_RT_PRIO !=128 ||MAX_PRIO !=168 +# error update this function. +#endif + +static inline int +sched_find_first_zero_bit (unsigned long *bitmap) +{ +unsigned long b0 = bitmap[0 ]; +unsigned long b1 = bitmap[1 ]; +unsigned long b2 = bitmap[2 ]; +unsigned long ofs =MAX_RT_PRIO ; + +if (unlikely (~(b0 & b1) !=0 )) { + b2 = (~b0 ? b0 : b1); + ofs = (~b0 ?0 :64 ); + } + +return ffz (b2) + ofs; +} + +#endif /* __ALPHA_SCHED_H */ include/asm-alpha/mmu_context.h +1
-0@@ -10,6 +10,7 @@#include <linux/config.h> #include <asm/system.h> #include <asm/machvec.h> +#include <asm/sched.h> /* * Force a context reload. This is needed when we change the page drivers/pci/pci.c +1
-0@@ -23,6 +23,7 @@#include <linux/kmod.h> /* for hotplug_path */ #include <linux/bitops.h> #include <linux/delay.h> +#include <linux/sched.h> #include <asm/page.h> #include <asm/dma.h> /* isa_dma_bridge_buggy */ arch/alpha/mm/fault.c +1
-2@@ -196,8 +196,7 @@ no_context:*/ out_of_memory:if (current->pid ==1 ) { - current->policy |=SCHED_YIELD ; -schedule (); +yield ();down_read (&mm->mmap_sem); goto survive; }arch/alpha/kernel/setup.c +1
-1@@ -437,7 +437,7 @@ static void srm_console_write(struct constatic kdev_t srm_console_device (struct console *c) {/* Huh? */ -return MKDEV (TTY_MAJOR ,64 + c->index); +return mk_kdev (TTY_MAJOR ,64 + c->index); }static int __init srm_console_setup (struct console *co,char *options)arch/alpha/kernel/srm_env.c +1
-0@@ -43,6 +43,7 @@#include <linux/proc_fs.h> #include <asm/console.h> #include <asm/uaccess.h> +#include <asm/machvec.h> #define DIRNAME "srm_environment"/* Subdir in /proc/ */ #define VERSION "0.0.2"/* Module version */ arch/alpha/kernel/pci-noop.c +2
-0@@ -106,6 +106,7 @@ sys_pciconfig_write(unsigned long bus, uvoid *pci_alloc_consistent (struct pci_dev *pdev,size_t size,dma_addr_t *dma_addrp) { +return NULL ; } void pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr,@@ -116,6 +117,7 @@ dma_addr_t pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size, int direction) { + return 0; } void pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,arch/alpha/kernel/process.c +1
-2@@ -30,6 +30,7 @@#include <linux/reboot.h> #include <linux/tty.h> #include <linux/console.h> +#include <linux/init_task.h> #include <asm/reg.h> #include <asm/uaccess.h> @@ -74,8 +75,6 @@ voidcpu_idle (void) {/* An endless idle loop with no priority at all. */ - current->nice =20 ; -while (1 ) {/* FIXME -- EV6 and LCA45 know how to power down the CPU. */ arch/alpha/kernel/smp.c +2
-16@@ -156,11 +156,6 @@ smp_callin(void) {int cpuid =hard_smp_processor_id (); -if (current != init_tasks[cpu_number_map (cpuid)]) { -printk ("BUG: smp_calling: cpu %d current %p init_tasks[cpu_number_map(cpuid)] %p\n" , - cpuid, current, init_tasks[cpu_number_map (cpuid)]); - } -DBGS (("CALLIN %d state 0x%lx\n" , cpuid, current->state));/* Turn on machine checks. */ @@ -491,14 +486,11 @@ smp_boot_one_cpu(int cpuid, int cpunum)if (idle == &init_task)panic ("idle process is init_task for CPU %d" , cpuid); - idle->processor = cpuid; - idle->cpus_runnable =1 << cpuid;/* we schedule the first task manually */ + idle->cpu = cpuid; __cpu_logical_map[cpunum] = cpuid; __cpu_number_map[cpuid] = cpunum; -del_from_runqueue (idle);unhash_process (idle); - init_tasks[cpunum] = idle;DBGS (("smp_boot_one_cpu: CPU %d state 0x%lx flags 0x%lx\n" , cpuid, idle->state, idle->flags));@@ -605,17 +597,11 @@ smp_boot_cpus(void) __cpu_number_map[boot_cpuid] =0 ; __cpu_logical_map[0 ] = boot_cpuid; - current->processor = boot_cpuid; + current->cpu = boot_cpuid;smp_store_cpu_info (boot_cpuid);smp_tune_scheduling (boot_cpuid);smp_setup_percpu_timer (boot_cpuid); - -init_idle (); - -/* ??? This should be in init_idle. */ -atomic_inc (&init_mm.mm_count); - current->active_mm = &init_mm;/* Nothing to do on a UP box, or when told not to. */ if (smp_num_probed ==1 || max_cpus ==0 ) {