ppc64: global interrupt queue cleanup
PATCH 1/1 ppc64: global interrupt queue cleanup
Move the code to set global interrupt queue membership to xics.c, and remove no longer needed extern declarations. Also call it on all cpus (even the boot cpu) to prepare for kexec.
---
arch/ppc64/kernel/pSeries_smp.c +0 -7
@@ -326,13 +326,6 @@cpu_clear (cpu, of_spin_map); -/* -* Put the calling processor into the GIQ. This is really only -* necessary from a secondary thread as the OF start-cpu interface -* performs this function for us on primary threads. -*/ -rtas_set_indicator (GLOBAL_INTERRUPT_QUEUE , - (1UL << interrupt_server_size) -1 - default_distrib_server,1 ); }static DEFINE_SPINLOCK (timebase_lock);
arch/ppc64/kernel/xics.c +12 -4
@@ -432,6 +432,7 @@ { ops->qirr_info (cpu,IPI_PRIORITY ); } +#endif /* CONFIG_SMP */ void xics_setup_cpu (void ) {
@@ -439,9 +440,17 @@ ops->cppr_info (cpu,0xff );iosync (); -} -#endif /* CONFIG_SMP */ +/* +* Put the calling processor into the GIQ. This is really only +* necessary from a secondary thread as the OF start-cpu interface +* performs this function for us on primary threads. +* +* XXX: undo of teardown on kexec needs this too, as may hotplug +*/ +rtas_set_indicator (GLOBAL_INTERRUPT_QUEUE , + (1UL << interrupt_server_size) -1 - default_distrib_server,1 ); +}void xics_init_IRQ (void ) {
@@ -563,8 +572,7 @@for (; i <NR_IRQS ; ++i)get_irq_desc (i)->handler = &xics_pic; - ops->cppr_info (boot_cpuid,0xff ); -iosync (); +xics_setup_cpu ();ppc64_boot_msg (0x21 ,"XICS Done" ); }
include/asm-ppc64/xics.h +0 -3
@@ -30,7 +30,4 @@ extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned; -extern unsigned int default_distrib_server; -extern unsigned int interrupt_server_size; -#endif /* _PPC64_KERNEL_XICS_H */
Re: [PATCH] ppc64: native hash clear
Andrew, Paulus,
There are 2 more patches for kexec ppc64. I did not see those two get
posted.
Request these patches to get merged into the next -mm.
Add code to clear the hash table and invalidate the tlb for native (SMP, non-LPAR) mode. Supports 16M and 4k pages.
---
linux-2.6.12-rc3-mm3-sharada/arch/ppc64/mm/hash_native.c | 47 ++++++++++++++++++- linux-2.6.12-rc3-mm3-sharada/include/asm-ppc64/mmu.h | 22 ++++++++ 2 files changed, 68 insertions(+), 1 deletion(-)
arch/ppc64/mm/hash_native.c renamed from arch/ppc64/mm/hash_native.c~ppc64-native-hash-clear +46 -1
@@ -304,6 +304,50 @@ static void native_hpte_invalidate(unsiglocal_irq_restore (flags); } +/* +* clear all mappings on kexec. All cpus are in real mode (or they will +* be when they isi), and we are the only one left. We rely on our kernel +* mapping being 0xC0's and the hardware ignoring those two real bits. +* +* TODO: add batching support when enabled. remember, no dynamic memory here, +* athough there is the control page available... +*/ +static void native_hpte_clear (void ) +{ +unsigned long slot, slots, flags; +HPTE *hptep = htab_address; +Hpte_dword0 dw0; +unsigned long pteg_count; + + pteg_count = htab_hash_mask +1 ; + +local_irq_save (flags); + +/* we take the tlbie lock and hold it. Some hardware will +* deadlock if we try to tlbie from two processors at once. +*/ +spin_lock (&native_tlbie_lock); + + slots = pteg_count *HPTES_PER_GROUP ; + +for (slot =0 ; slot < slots; slot++, hptep++) { +/* +* we could lock the pte here, but we are the only cpu +* running, right? and for crash dump, we probably +* don't want to wait for a maybe bad cpu. +*/ + dw0 = hptep->dw0.dw0; + +if (dw0.v) { + hptep->dw0.dword0 =0 ; +tlbie (slot2va (dw0.avpn, dw0.l, dw0.h, slot), dw0.l); + } + } + +spin_unlock (&native_tlbie_lock); +local_irq_restore (flags); +} +static void native_flush_hash_range (unsigned long context,unsigned long number,int local) {
@@ -415,7 +459,8 @@ void hpte_init_native(void) ppc_md.hpte_updatepp = native_hpte_updatepp; ppc_md.hpte_updateboltedpp = native_hpte_updateboltedpp; ppc_md.hpte_insert = native_hpte_insert; - ppc_md.hpte_remove = native_hpte_remove; + ppc_md.hpte_remove = native_hpte_remove; + ppc_md.hpte_clear_all = native_hpte_clear;if (tlb_batching_enabled ()) ppc_md.flush_hash_range = native_flush_hash_range;htab_finish_init ();
include/asm-ppc64/mmu.h renamed from include/asm-ppc64/mmu.h~ppc64-native-hash-clear +22 -0
@@ -180,6 +180,28 @@ static inline void tlbiel(unsigned long asmvolatile ("ptesync" : : :"memory" ); } +static inline unsigned long slot2va (unsigned long avpn,unsigned long large, +unsigned long secondary,unsigned long slot) +{ +unsigned long va; + + va = avpn <<23 ; + +if (!large) { +unsigned long vpi, pteg; + + pteg = slot /HPTES_PER_GROUP ; +if (secondary) + pteg = ~pteg; + + vpi = ((va >>28 ) ^ pteg) & htab_hash_mask; + + va |= vpi <<PAGE_SHIFT ; + } + +return va; +} +/* * Handle a fault by adding an HPTE. If the address can't be determined * to be valid via Linux page tables, return 1. If handled return 0
_
Re: [PATCH] ppc64: kexec support for ppc64
This patch implements the kexec support for ppc64
kexec support for ppc64 platforms.
A couple of notes:
1) We copy the pages in virtual mode, using the full base kernel
and a statically allocated stack. At kexec_prepare time we
scan the pages and if any overlap our (0, _end[]) range we return -ETXTBSY.
On PowerPC 64 systems running in LPAR (logical partitioning) mode, only a small region of memory, referred to as the RMO, can be accessed in real mode. Since Linux runs with only one zone of memory in the memory allocator, and it can be orders of magnitude more memory than the RMO, looping until we allocate pages in the source region is not feasible. Copying in virtual means we don't have to write a hash table generation and call hypervisor to insert translations, instead we rely on the pinned kernel linear mapping. The kernel already has move to linked location built in, so there is no requirement to load it at 0.
If we want to load something other than a kernel, then a stub can be written to copy a linear chunk in real mode.
2) The start entry point gets passed parameters from the kernel. Slaves are started at a fixed address after copying code from the entry point.
All CPUs get passed their firmware assigned physical id in r3 (most calling conventions use this register for the first argument).
This is used to distinguish each CPU from all other CPUs. Since firmware is not around, there is no other way to obtain this information other than to pass it somewhere.
A single CPU, referred to here as the master and the one executing
the kexec call, branches to start with the address of start in r4.
While this can be calculated, we have to load it through a gpr to branch to this point so defining the register this is contained in is free. A stack of unspecified size is available at r1 (also common calling convention).
All remaining running CPUs are sent to start at absolute address 0x60 after copying the first 0x100 bytes from start to address 0. This convention was chosen because it matches what the kernel has been doing itself. (only gpr3 is defined).
Note: This is not quite the convention of the kexec bootblock v2 in the kernel. A stub has been written to convert between them, and we may adjust the kernel in the future to allow this directly without any stub.
3) Destination pages can be placed anywhere, even where they would not be accessible in real mode. This will allow us to place ram disks above the RMO if we choose.
---
linux-2.6.12-rc3-mm3-sharada/arch/ppc64/Kconfig | 17 linux-2.6.12-rc3-mm3-sharada/arch/ppc64/kernel/Makefile | 1 linux-2.6.12-rc3-mm3-sharada/arch/ppc64/kernel/head.S | 6 linux-2.6.12-rc3-mm3-sharada/arch/ppc64/kernel/machine_kexec.c | 301 +++++++++++++ linux-2.6.12-rc3-mm3-sharada/arch/ppc64/kernel/misc.S | 179 +++++++ linux-2.6.12-rc3-mm3-sharada/arch/ppc64/kernel/mpic.c | 29 + linux-2.6.12-rc3-mm3-sharada/arch/ppc64/kernel/mpic.h | 3 linux-2.6.12-rc3-mm3-sharada/arch/ppc64/kernel/pSeries_setup.c | 10 linux-2.6.12-rc3-mm3-sharada/arch/ppc64/kernel/setup.c | 19 linux-2.6.12-rc3-mm3-sharada/arch/ppc64/kernel/xics.c | 25 + linux-2.6.12-rc3-mm3-sharada/include/asm-ppc64/kexec.h | 45 + linux-2.6.12-rc3-mm3-sharada/include/asm-ppc64/machdep.h | 1 linux-2.6.12-rc3-mm3-sharada/include/asm-ppc64/xics.h | 1 13 files changed, 620 insertions(+), 17 deletions(-)
arch/ppc64/Kconfig renamed from arch/ppc64/Kconfig~kexec-ppc64 +17 -0
@@ -123,6 +123,23 @@ config PPC_SPLPAR processors, that is, which share physical processors between two or more partitions. +config KEXEC + bool "kexec system call (EXPERIMENTAL)" + depends on PPC_MULTIPLATFORM && EXPERIMENTAL + help + kexec is a system call that implements the ability to shutdown your + current kernel, and to start another kernel. It is like a reboot + but it is indepedent of the system firmware. And like a reboot + you can start any kernel with it, not just Linux. + + The name comes from the similiarity to the exec system call. + + It is an ongoing process to be certain the hardware in a machine + is properly shutdown, so do not be surprised if this code does not + initially work for you. It may help to enable device hotplugging + support. As of this writing the exact hardware interface is + strongly in flux, so no good recommendation can be made. + config IBMVIO depends on PPC_PSERIES || PPC_ISERIES bool
arch/ppc64/kernel/Makefile renamed from arch/ppc64/kernel/Makefile~kexec-ppc64 +1 -0
@@ -34,6 +34,7 @@ obj-$(CONFIG_PPC_PSERIES) += pSeries_pci pSeries_nvram.o rtasd.o ras.o pSeries_reconfig.o \ xics.o rtas.o pSeries_setup.o pSeries_iommu.o +obj-$(CONFIG_KEXEC) += machine_kexec.o obj-$(CONFIG_EEH) += eeh.o obj-$(CONFIG_PROC_FS) += proc_ppc64.o obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o
arch/ppc64/kernel/head.S renamed from arch/ppc64/kernel/head.S~kexec-ppc64 +3 -3
@@ -1194,7 +1194,7 @@ _GLOBAL(pSeries_secondary_smp_init) bl .__restore_cpu_setup /* Set up a paca value for this processor. Since we have the - * physical cpu id in r3, we need to search the pacas to find + * physical cpu id in r24, we need to search the pacas to find * which logical id maps to our physical one. */ LOADADDR(r13, paca) /* Get base vaddr of paca array */
@@ -1207,8 +1207,8 @@ _GLOBAL(pSeries_secondary_smp_init) cmpwi r5,NR_CPUS blt 1b -99: HMT_LOW /* Couldn't find our CPU id */ - b 99b + mr r3,r24 /* not found, copy phys to r3 */ + b .kexec_wait /* next kernel might do better */ 2: mtspr SPRG3,r13 /* Save vaddr of paca in SPRG3 */ /* From now on, r24 is expected to be logica cpuid */
arch/ppc64/kernel/machine_kexec.c new file +301 -0
301 lines not on this page · raw message
arch/ppc64/kernel/misc.S renamed from arch/ppc64/kernel/misc.S~kexec-ppc64 +177 -2
197 lines not on this page · raw message
arch/ppc64/kernel/mpic.c renamed from arch/ppc64/kernel/mpic.c~kexec-ppc64 +29 -0
@@ -792,6 +792,35 @@ void mpic_setup_this_cpu(void)#endif /* CONFIG_SMP */ } +/* +* XXX: someone who knows mpic should check this. +* do we need to eoi the ipi here (see xics comments)? +* or can we reset the mpic in the new kernel? +*/ +void mpic_teardown_this_cpu (void ) +{ +struct mpic *mpic = mpic_primary; +unsigned long flags; +u32 msk =1 <<hard_smp_processor_id (); +unsigned int i; + +BUG_ON (mpic ==NULL ); + +DBG ("%s: teardown_this_cpu(%d)\n" , mpic->name,hard_smp_processor_id ()); +spin_lock_irqsave (&mpic_lock, flags); + +/* let the mpic know we don't want intrs. */ +for (i =0 ; i < mpic->num_sources ; i++) +mpic_irq_write (i,MPIC_IRQ_DESTINATION , +mpic_irq_read (i,MPIC_IRQ_DESTINATION ) & ~msk); + +/* Set current processor priority to max */ +mpic_cpu_write (MPIC_CPU_CURRENT_TASK_PRI ,0xf ); + +spin_unlock_irqrestore (&mpic_lock, flags); +} + +void mpic_send_ipi (unsigned int ipi_no,unsigned int cpu_mask) {struct mpic *mpic = mpic_primary;
arch/ppc64/kernel/mpic.h renamed from arch/ppc64/kernel/mpic.h~kexec-ppc64 +3 -0
@@ -255,6 +255,9 @@ extern unsigned int mpic_irq_get_priorit/* Setup a non-boot CPU */ extern void mpic_setup_this_cpu (void ); +/* Clean up for kexec (or cpu offline or ...) */ +extern void mpic_teardown_this_cpu (void ); +/* Request IPIs on primary mpic */ extern void mpic_request_ipis (void );
arch/ppc64/kernel/pSeries_setup.c renamed from arch/ppc64/kernel/pSeries_setup.c~kexec-ppc64 +6 -4
@@ -195,14 +195,16 @@ static void __init pSeries_setup_arch(vo {/* Fixup ppc_md depending on the type of interrupt controller */ if (ppc64_interrupt_controller ==IC_OPEN_PIC ) { - ppc_md.init_IRQ = pSeries_init_mpic; - ppc_md.get_irq = mpic_get_irq; + ppc_md.init_IRQ = pSeries_init_mpic; + ppc_md.get_irq = mpic_get_irq; + ppc_md.cpu_irq_down = mpic_teardown_this_cpu;/* Allocate the mpic now, so that find_and_init_phbs() can * fill the ISUs */ pSeries_setup_mpic (); }else { - ppc_md.init_IRQ = xics_init_IRQ; - ppc_md.get_irq = xics_get_irq; + ppc_md.init_IRQ = xics_init_IRQ; + ppc_md.get_irq = xics_get_irq; + ppc_md.cpu_irq_down = xics_teardown_cpu; }#ifdef CONFIG_SMP
arch/ppc64/kernel/setup.c renamed from arch/ppc64/kernel/setup.c~kexec-ppc64 +11 -8
@@ -677,29 +677,32 @@ void __init setup_system(void)DBG (" <- setup_system()\n" ); } - -void machine_restart (char *cmd) +/* also used by kexec */ +void machine_shutdown (void ) {if (ppc_md.nvram_sync) ppc_md.nvram_sync (); +} + +void machine_restart (char *cmd) +{ +machine_shutdown (); ppc_md.restart (cmd); }EXPORT_SYMBOL (machine_restart); - +void machine_power_off (void ) { -if (ppc_md.nvram_sync) - ppc_md.nvram_sync (); +machine_shutdown (); ppc_md.power_off (); }EXPORT_SYMBOL (machine_power_off); - +void machine_halt (void ) { -if (ppc_md.nvram_sync) - ppc_md.nvram_sync (); +machine_shutdown (); ppc_md.halt (); }
arch/ppc64/kernel/xics.c renamed from arch/ppc64/kernel/xics.c~kexec-ppc64 +25 -0
@@ -647,6 +647,31 @@ static void xics_set_affinity(unsigned i } } +void xics_teardown_cpu (void ) +{ +int cpu =smp_processor_id (); +int status; + + ops->cppr_info (cpu,0x00 ); +iosync (); + +/* +* we need to EOI the IPI if we got here from kexec down IPI +* +* xics doesn't care if we duplicate an EOI as long as we +* don't EOI and raise priority. +* +* probably need to check all the other interrupts too +* should we be flagging idle loop instead? +* or creating some task to be scheduled? +*/ + ops->xirr_info_set (cpu,XICS_IPI ); + + status =rtas_set_indicator (GLOBAL_INTERRUPT_QUEUE , + (1UL << interrupt_server_size) -1 - default_distrib_server,0 ); +WARN_ON (status !=0 ); +} +#ifdef CONFIG_HOTPLUG_CPU /* Interrupts are disabled. */
include/asm-ppc64/kexec.h new file +45 -0
45 lines not on this page · raw message
include/asm-ppc64/machdep.h renamed from include/asm-ppc64/machdep.h~kexec-ppc64 +1 -0
@@ -85,6 +85,7 @@ struct machdep_calls {void (*init_IRQ)(void );int (*get_irq)(struct pt_regs *); +void (*cpu_irq_down)(void );/* PCI stuff */ void (*pcibios_fixup)(void );
include/asm-ppc64/xics.h renamed from include/asm-ppc64/xics.h~kexec-ppc64 +1 -0
@@ -17,6 +17,7 @@void xics_init_IRQ (void );int xics_get_irq (struct pt_regs *);void xics_setup_cpu (void ); +void xics_teardown_cpu (void );void xics_cause_IPI (int cpu);void xics_request_IPIs (void );void xics_migrate_irqs_away (void );
_
Re: [PATCH] ppc64: kexec support for ppc64
Quoted 2 lines · R Sharada
This patch implements the kexec support for ppc64
Well that's pretty neat. How well does this work?
I assume you'll be working on kdump-via-kexec for ppc64?
This kdump/kexec stuff has been hanging around for far too long, IMO. I'd like to think about what we can do to get things moving along a bit more.
I have two issues with it:
a) Vague feelings that the low-level ia32 changes may cause APIC/etc breakage with some PCs.
b) Much more significantly: I still do not believe that it has been demonstrated that the whole kdump-via-kexec scheme will have a sufficiently high success rate for this to become Linux's way of doing crashdumps.
And it would not be good if in six months time we decide that the practical problems in getting it all working sufficiently well are insurmountable and we have to revert it all and start working on something else.
Recently I've seem a couple of "kdump worked for me" reports, which are greatly appreciated, but I don't think they're statistically significant.
So am I right to have this concern? If so, how can we settle this? (ie: who's going to do it? ;))
Perhaps we could declare that kexec is sufficiently useful and mature in its own right and just merge up those bits while we work on kdump. This also gives us a bit of pipelining: continue to test and stabilise kexec while kdump remains in development.
Opinions are sought...
Re: [PATCH] ppc64: kexec support for ppc64
Quoted 10 lines · Andrew Morton
Quoted 2 lines · R Sharada
This patch implements the kexec support for ppc64
Well that's pretty neat. How well does this work?
I assume you'll be working on kdump-via-kexec for ppc64?
This kdump/kexec stuff has been hanging around for far too long, IMO. I'd like to think about what we can do to get things moving along a bit more.
Agreed!
Quoted 22 lines
I have two issues with it:
a) Vague feelings that the low-level ia32 changes may cause APIC/etc breakage with some PCs.
b) Much more significantly: I still do not believe that it has been demonstrated that the whole kdump-via-kexec scheme will have a sufficiently high success rate for this to become Linux's way of doing crashdumps.
And it would not be good if in six months time we decide that the practical problems in getting it all working sufficiently well are insurmountable and we have to revert it all and start working on something else.
Recently I've seem a couple of "kdump worked for me" reports, which are greatly appreciated, but I don't think they're statistically significant.
So am I right to have this concern? If so, how can we settle this? (ie: who's going to do it? ;))
Quoted 6 lines
Perhaps we could declare that kexec is sufficiently useful and mature in its own right and just merge up those bits while we work on kdump. This also gives us a bit of pipelining: continue to test and stabilise kexec while kdump remains in development.
Opinions are sought...
I'm in favor of getting as much of kexec moving towards wider integration and testing as possible. We won't catch your issue on ia32 without wider testing on ia32 boxen - and I think it is stable enough that that type of testing should drive it towards full stability sooner.
On your second issue, kdump-via-kexec is *way* better than all the alternatives. We have a lot of distro/customer experience with the alternatives and, well, they all suck, badly. Kexec has some tough issues with some of the low level interactions and ensuring that control can get transferred to the new kernel but those are relatively minor compared to the "copy all my innards out out from a broken kernel" approach.
You recently mentioned the pain of a single bug in an -mm tree taking three painful days to track down. With the current dump solutions, we often spend *weeks* trying to get to a root cause where the customer is begging that we get their business running again. As a result, some otherwise relatively simple-to-fix, hard-to-find problems aren't getting diagnosed for weeks or even months, if ever. Getting a crash dump allows us to pore over these problems without keeping a real user's machine out of production, and without hoping that the problem might happen again in the future.
Also, the major distros have widly varying solutions in this space; writing supporting tools and patching bugs is being done multiple times, being done only for the distros, and not improving mainline at all. Convergence here would help us focus more efforts on mainline instead of replicating efforts on distros that don't benefit mainline and are constantly being re-implemented (e.g. a big waste of resources that could be better applied to making everyone's lives better).
Kexec offers as much assurance as is possible of being able to get a crash dump quickly. The only thing better would be a firmware implemented memory dumper, which just isn't an option on most common platforms.
If it takes a little list or test matrix of platforms tested over the short term to help verify what machines work, we might be able to set something like that up as well.
gerrit
Re: [PATCH] ppc64: kexec support for ppc64
Quoted 3 lines · Gerrit Huizenga
[ ... ]
But you didn't address the question of whether the kexec feature is sufficiently useful in its own right to justify merging.
Quoted 4 lines
If it takes a little list or test matrix of platforms tested over the short term to help verify what machines work, we might be able to set something like that up as well.
Yes, please do that. But remember that Linux has a distributed test team of thousands. I have a separate proposal:
My big checkbox for kdump is "can I personally use kdump to diagnose and solve testers' bug reports?".
If we can reach the stage where a random person downloads a -mm kernel, hits a bug and, with a reasonable success rate, can send me a kernel core file which I find useful then yeah, it's proven.
Problem is, I haven't gotten around to moving this idea an inch forward and am unlikely to do so.
It would really help if some of the kdump developers could assist: make sure the instructions are easy, that the tools are available, work with people on the mailing list to get a core file from them, then, using the core file, work with the relevant maintainer to identify and solve the bug. We did this a few weeks ago with the -mm timer deadlock. Off-list, I think.
Possible?
Re: [PATCH] ppc64: kexec support for ppc64
Quoted 7 lines · Andrew Morton
Quoted 3 lines · Gerrit Huizenga
[ ... ]
But you didn't address the question of whether the kexec feature is sufficiently useful in its own right to justify merging.
Yeah - I skirted that. I like kexec by itself for quick reboots but I honestly haven't used it much for that. I am *really* interested in kdump + kexec, and kdump depends on kexec. Working with two moving targets has been a bit more challenging, hence I'd prefer to see kexec stable as a provider technology so we can address the bugs and build the kdump support on top.
Quoted 6 lines
Quoted 3 lines
If it takes a little list or test matrix of platforms tested over the short term to help verify what machines work, we might be able to set something like that up as well.
Yes, please do that. But remember that Linux has a distributed test team of thousands. I have a separate proposal:
I'll see if we can find a way to make this happen - even tracking a little web page of "My IBM T41p successfully ran kexec" or "My G5 ran kexec" would be useful info, I think as a starting point.
Something like:
Hardware Ran kexec Ran kdump Kdump was useful
should be enough to record some success, as at least a starting point.
Quoted 2 lines
My big checkbox for kdump is "can I personally use kdump to diagnose and solve testers' bug reports?".
Now *this* I completely agree with. That is the ultimate goal. And, we've had challenges with this internally because kexec & kdump have been under so much churn. We have a grid of machines for testing, and I *know* we get a bunch of Oopses during development. We have someone looking into integrating kexec/kdump into that environment so that every Ooops leads to a crash dump. It has been rough going with kexec & kdump in churn, so stabilizing will actually help us with this.
Quoted 3 lines
If we can reach the stage where a random person downloads a -mm kernel, hits a bug and, with a reasonable success rate, can send me a kernel core file which I find useful then yeah, it's proven.
Completely agreed.
Quoted 2 lines
Problem is, I haven't gotten around to moving this idea an inch forward and am unlikely to do so.
Understood. We'll do what we can from our end but as always, help from any quarter is appreciated.
Quoted 7 lines
It would really help if some of the kdump developers could assist: make sure the instructions are easy, that the tools are available, work with people on the mailing list to get a core file from them, then, using the core file, work with the relevant maintainer to identify and solve the bug. We did this a few weeks ago with the -mm timer deadlock. Off-list, I think.
Possible?
Yes. I'll push this a little more on Monday from our side and maybe we can get a little independent help/verification from Randy, Eric, etc.
gerrit
Re: [PATCH] ppc64: kexec support for ppc64
In reply to Andrew MortonQuoted 2 lines · Andrew Morton
But you didn't address the question of whether the kexec feature is sufficiently useful in its own right to justify merging.
On POWER4 boxes running in SMP (non-partitioned) mode it would be extremely useful, because the firmware takes such an age to boot the machine.
Paul.
Re: [Fastboot] Re: [PATCH] ppc64: kexec support for ppc64
In reply to Andrew MortonHello Andrew,
Quoted 6 lines · Andrew Morton
This kdump/kexec stuff has been hanging around for far too long, IMO. I'd like to think about what we can do to get things moving along a bit more.
I have two issues with it:
Quoted 7 lines
a) Vague feelings that the low-level ia32 changes may cause APIC/etc breakage with some PCs.
b) Much more significantly: I still do not believe that it has been demonstrated that the whole kdump-via-kexec scheme will have a sufficiently high success rate for this to become Linux's way of doing crashdumps.
This is a chicken-and-egg problem. Unless we have kexec/kdump in mainline with a lot of users, we may not find out all the corner cases.
Quoted 9 lines
And it would not be good if in six months time we decide that the practical problems in getting it all working sufficiently well are insurmountable and we have to revert it all and start working on something else.
So am I right to have this concern? If so, how can we settle this? (ie: who's going to do it? ;))
Quoted 6 lines
Perhaps we could declare that kexec is sufficiently useful and mature in its own right and just merge up those bits while we work on kdump. This also gives us a bit of pipelining: continue to test and stabilise kexec while kdump remains in development.
Opinions are sought...
FWIW, based on prior experience in other OS, I believe that kexec based approach is the most flexible and safest for supporting such a diverse set of platforms that linux supports. The issues however are -
1. I don't think we can achieve kdump with very high reliability within the few months it has had so far. Again, if prior experience with similar mechanism is worth anything, it will take a long time to achieve very high reliability on dozens of chipsets, several cpus, dozens of different platforms and various combinations thereof not to mention many different situations when kdump is used.
2. The way I see it, beyond a certain amount reliability (common x86, x86_64, ppc64 platforms, normal kernel developer use), we will need exposure to a much larger user base (large customer deployments will be the most useful) to find and sort out the remaining corner cases.
I hope we have it available for a large user base in mainline as soon as it is reliable enough for common platforms and kernel developer use.
Thanks
Dipankar
Re: [Fastboot] Re: [PATCH] ppc64: kexec support for ppc64
In reply to Andrew MortonQuoted 9 lines · Andrew Morton
Quoted 2 lines · R Sharada
This patch implements the kexec support for ppc64
Well that's pretty neat. How well does this work?
I assume you'll be working on kdump-via-kexec for ppc64?
Quoted 7 lines
This kdump/kexec stuff has been hanging around for far too long, IMO. I'd like to think about what we can do to get things moving along a bit more.
I have two issues with it:
a) Vague feelings that the low-level ia32 changes may cause APIC/etc breakage with some PCs.
Do you suspect impact during normal operation, or only upon kexec-on-panic ? If its the former, then wider testing with CONFIG_KEXEC turned on is really important.
Quoted 11 lines
b) Much more significantly: I still do not believe that it has been demonstrated that the whole kdump-via-kexec scheme will have a sufficiently high success rate for this to become Linux's way of doing crashdumps.
And it would not be good if in six months time we decide that the practical problems in getting it all working sufficiently well are insurmountable and we have to revert it all and start working on something else.
Quoted 7 lines
Recently I've seem a couple of "kdump worked for me" reports, which are greatly appreciated, but I don't think they're statistically significant.
So am I right to have this concern? If so, how can we settle this? (ie: who's going to do it? ;))
As Dipankar and Gerrit have mentioned from their prior experience and as several of us learnt the hard way over years of effort working on various different options for crash dumps for Linux, if anything stands a chance of practical success for diverse platforms and devices so it works for a wide community vs only specific sets of environments, it is the kexec approach. A 100% successful dumping solution is theoretically impossible to achieve with software alone; we could have endless debates about where which solution fails, and never really get anywhere :(. More than anything a *convergence* on one solution that we all focus on improving is critical, to achieve as much success as we can.
kdump is only going to be needed when the system panics, and not during normal operation ... so I'd say that it is worth it *even* if it doesn't have a proven high success rate yet. If it doesn't hurt anything else, and whatever it gets us *whenever* it does work is useful, I wouldn't really worry too much - we can't be worse off than we are with kdump than without, can we ?
Even LKCD with all its imperfections and lower reliability compared to the kdump approach, still is being used when it works ! In some situations every little bit helps ... Even if we can't solve world hunger.
As Werner has pointed out in the past for kexec and as Dipankar just did as well, we have to accept that achieving high reliability is a maturation process that is simply going to take time and wider deployments. Which is only going to happen through adoption ...
All it needs is a big push to make it easy for people to use, because without real usage even inclusion in mainline isn't going to help.
So I think we need the following 2 things for further progress:
(1) Ensure that there are no stability concerns for normal kernel operation. Are there any at the moment ? Anything that stops people from compiling with CONFIG_KEXEC by default ?
(2) Actively help people in the community to use it (*visibly*, so it makes it easier for those who haven't already used it to pick up). What Maneesh did for the timer problem is a good example, and more of such instances will go a long way. At the same time, I think it is going to be a hard for kdump developers alone to focus on identifying and solving bugs in various kernel areas (Bugs that need a dump for analysis usually aren't the easiest of problems) *as well as* fixing kexec/kdump to work in increasing number of situations. They'll need help ... and maybe some direction on what to prioritize.
How do we make that happen ?
(3) Avoid any major churn in kexec/kdump during this phase that can impact stability or usability to make life easier for all.
Quoted 5 lines
Perhaps we could declare that kexec is sufficiently useful and mature in its own right and just merge up those bits while we work on kdump. This also gives us a bit of pipelining: continue to test and stabilise kexec while kdump remains in development.
Several months back, I would likely have agreed with that.
Now, I'm not so sure. After the kdump redesign, a large part of the kdump support is actually provided by kexec-on-panic which is an integral part of kexec. The additional bits for dump capture alone may not be a whole lot ... But, I'd let Maneesh/Vivek comment on that.
Quoted 2 lines
Opinions are sought...
Was this anywhere close to what you were looking for ?
Regards
Suparna
Quoted 4 lines
_______________________________________________
fastboot mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/fastboot
Signature · 3 lines
Suparna Bhattacharya ([email protected]) Linux Technology Center IBM Software Lab, India
Re: [Fastboot] Re: [PATCH] ppc64: kexec support for ppc64
Quoted 13 lines · Suparna Bhattacharya
Quoted 12 lines · Andrew Morton
Quoted 2 lines · R Sharada
This patch implements the kexec support for ppc64
Well that's pretty neat. How well does this work?
I assume you'll be working on kdump-via-kexec for ppc64?
This kdump/kexec stuff has been hanging around for far too long, IMO. I'd like to think about what we can do to get things moving along a bit more.
Quoted 8 lines
Quoted 4 lines
I have two issues with it:
a) Vague feelings that the low-level ia32 changes may cause APIC/etc breakage with some PCs.
Do you suspect impact during normal operation, or only upon kexec-on-panic ? If its the former, then wider testing with
CONFIG_KEXECturned on is really important.
Following are the kexec patches which modify the concerned area and are _not_ under CONFIG_KEXEC. So it is also important to test such codepath with and without CONFIG_KEXEC. We have been testing various x86 machines with these patches and so far we have not observed any problems related to machine shutdown or APIC/IOAPIC shutdown.
x86-rename-apic_mode_exint.patch
x86-local-apic-fix.patch
x86-i8259-shutdown.patch
x86_64-i8259-shutdown.patch
x86-apic-virtwire-on-shutdown.patch
x86_64-apic-virtwire-on-shutdown.patch
x86-machine_shutdown.patch
x86_64-machine_shutdown.patch
Quoted 5 lines
Quoted 5 lines
b) Much more significantly: I still do not believe that it has been demonstrated that the whole kdump-via-kexec scheme will have a sufficiently high success rate for this to become Linux's way of doing crashdumps.
Following are the links to kdump testing results and kexec-tools patches
http://lse.sourceforge.net/kdump/kdump-test.html
http://lse.sourceforge.net/kdump/patches/kexec-tools-1.101-kdump.patch
Quoted 4 lines
Quoted 4 lines
And it would not be good if in six months time we decide that the practical problems in getting it all working sufficiently well are insurmountable and we have to revert it all and start working on something else.
At this point of time we have device initialisation problem in hand which causes intermittent failures in second kernel boot in case of kexec-on-panic.
Quoted 9 lines
Quoted 7 lines
Recently I've seem a couple of "kdump worked for me" reports, which are greatly appreciated, but I don't think they're statistically significant.
So am I right to have this concern? If so, how can we settle this? (ie: who's going to do it? ;))
[..]
Quoted 6 lines
Quoted 5 lines
Perhaps we could declare that kexec is sufficiently useful and mature in its own right and just merge up those bits while we work on kdump. This also gives us a bit of pipelining: continue to test and stabilise kexec while kdump remains in development.
Quoted 6 lines
Several months back, I would likely have agreed with that.
Now, I'm not so sure. After the kdump redesign, a large part of the kdump support is actually provided by kexec-on-panic which is an integral part of kexec. The additional bits for dump capture alone may not be a whole lot ... But, I'd let Maneesh/Vivek comment on that.
That's right. After the kexec rework, significant chunk of kdump functionality particularly related to panic codepath, which halts other CPU's and saves register states, is merged with kexec, as kexec-on-panic functionality.
kdump code in kernel is mainly reduced to dump capturing functionality only. If kexec-on-panic can successfully boot second kernel, there are remote chances of /proc/vmcore or /dev/oldmem not getting generated.
Thanks
Maneesh
Signature · 6 lines
Maneesh Soni Linux Technology Center, IBM India Software Labs, Bangalore, India email: [email protected] Phone: 91-80-25044990
Re: [PATCH] ppc64: kexec support for ppc64
In reply to Andrew MortonHello Andrew,
Quoted 6 lines · Andrew Morton
Quoted 2 lines · R Sharada
This patch implements the kexec support for ppc64
Well that's pretty neat. How well does this work?
We have tested the kexec support for ppc64, on the following platforms:
- Power4 (p630), in lpar, non-lpar mode
- Power5
The Power4 testing was done on 4-cpu non-lpar and 2-cpu lpar configurations.
It has been tested to work in both the lpar and non-lpar environments,
on Power4 and we have tested successive kexec reboots as well and found it to
work. The only thing that we found that had to be done was to make sure the
network interface was brought down, prior to reboot, as otherwise it would
sometimes cause EEH errors.
Milton has tested it on his Power5 environment as well.
On lpar on Power5, that Haren has been testing, he has been observing
that in 2nd or 3rd successive kexec reboot, the IPR SCSI driver initially comes
up ok but after a while interrupts seem to be getting disabled and while the h/wis sending the interrupts, they do not get serviced and are getting lost. Haren has been working on debugging this, with assistance from Milton.
We however, do not have the kexec-tools code for ppc64 inside of kexec-tools. We have been using home-grown code for loading, generating the device-tree data and assembly trampoline code for the kexec transition to the new kernel. This tools is currently hosted at the following url:
http://www.kernel.org/pub/linux/kernel/people/suparna/kdump/ppc64-tools-20050331.tar.gz
I am currently working on integrating them into Eric's kexec-tools.
Quoted 2 lines
I assume you'll be working on kdump-via-kexec for ppc64?
Yes, once the kexec-tools is integrated into Eric's kexec-tools, we will work on getting the kdump parts in place for ppc64.
Thanks and Regards,
Sharada