* Re: [PATCH] powerpc 2.6.21-rt6: revert spider_net
From: Thomas Gleixner @ 2007-05-22 18:52 UTC (permalink / raw)
To: Linas Vepstas; +Cc: mingo, linux-kernel, linuxppc-dev
In-Reply-To: <20070522184632.GL5921@austin.ibm.com>
On Tue, 2007-05-22 at 13:46 -0500, Linas Vepstas wrote:
> On Tue, May 22, 2007 at 08:53:32PM +0900, Tsutomu OWA wrote:
> >
> > Hi Ingo and Thomas,
> >
> > To revert spider_net.c to original one as it turns out that the patch
>
> As the spidernet maintainer, I had not forwarded the previous patch
> upstream; it should not have been applied.
Linas,
that's against preempt-rt, where we picked up owa-sans patch.
Thanks,
tglx
^ permalink raw reply
* Re: [PATCH] Performance Stats: Kernel patch
From: Dave Jones @ 2007-05-22 18:48 UTC (permalink / raw)
To: Maxim Uvarov; +Cc: linuxppc-dev, LKML
In-Reply-To: <20070522171950.23728.95735.stgit@localhost.localdomain>
On Tue, May 22, 2007 at 05:19:52PM +0000, Maxim Uvarov wrote:
> diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
> index 4b187bb..bccfd6a 100644
> --- a/include/asm-i386/thread_info.h
> +++ b/include/asm-i386/thread_info.h
> @@ -33,6 +33,7 @@ struct thread_info {
> int preempt_count; /* 0 => preemptable, <0 => BUG */
>
>
> + unsigned long syscall_count; /* Syscall counter */
> mm_segment_t addr_limit; /* thread address space:
> 0-0xBFFFFFFF for user-thead
> 0-0xFFFFFFFF for kernel-thread
It seems a bit unkind to bloat up the thread_info for every process
of every user when the common case will be people that don't care about
this feature at all.
Especially when the same information could be got from ptrace.
Dave
--
http://www.codemonkey.org.uk
^ permalink raw reply
* Re: [PATCH] powerpc 2.6.21-rt6: revert spider_net
From: Linas Vepstas @ 2007-05-22 18:46 UTC (permalink / raw)
To: Tsutomu OWA; +Cc: linuxppc-dev, mingo, tglx, linux-kernel
In-Reply-To: <yyi646l6pmr.wl@toshiba.co.jp>
On Tue, May 22, 2007 at 08:53:32PM +0900, Tsutomu OWA wrote:
>
> Hi Ingo and Thomas,
>
> To revert spider_net.c to original one as it turns out that the patch
As the spidernet maintainer, I had not forwarded the previous patch
upstream; it should not have been applied.
--linas
^ permalink raw reply
* [PATCH] (revised) pseries: asm/pci-bridge.h CONFIG_ minor cleanup
From: Linas Vepstas @ 2007-05-22 18:18 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20070522170058.GJ5921@austin.ibm.com>
Use the correct CONFIG_ option to mark off the EEH bits.
Move the EEH bits to the bottom of the struct.
The config_space array is used by EEH only; it does not
need to be part of the struct for non-pseries machines.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
----
Revised patch, per commments from Michael Ellerman.
include/asm-powerpc/pci-bridge.h | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
Index: linux-2.6.22-rc1/include/asm-powerpc/pci-bridge.h
===================================================================
--- linux-2.6.22-rc1.orig/include/asm-powerpc/pci-bridge.h 2007-05-21 18:13:00.000000000 -0500
+++ linux-2.6.22-rc1/include/asm-powerpc/pci-bridge.h 2007-05-22 12:03:50.000000000 -0500
@@ -70,19 +70,21 @@ struct pci_dn {
int devfn; /* pci device and function number */
int class_code; /* pci device class */
-#ifdef CONFIG_PPC_PSERIES
+ struct pci_controller *phb; /* for pci devices */
+ struct iommu_table *iommu_table; /* for phb's or bridges */
+ struct pci_dev *pcidev; /* back-pointer to the pci device */
+ struct device_node *node; /* back-pointer to the device_node */
+
+ int pci_ext_config_space; /* for pci devices */
+
+#ifdef CONFIG_EEH
int eeh_mode; /* See eeh.h for possible EEH_MODEs */
int eeh_config_addr;
int eeh_pe_config_addr; /* new-style partition endpoint address */
int eeh_check_count; /* # times driver ignored error */
int eeh_freeze_count; /* # times this device froze up. */
-#endif
- int pci_ext_config_space; /* for pci devices */
- struct pci_controller *phb; /* for pci devices */
- struct iommu_table *iommu_table; /* for phb's or bridges */
- struct pci_dev *pcidev; /* back-pointer to the pci device */
- struct device_node *node; /* back-pointer to the device_node */
u32 config_space[16]; /* saved PCI config space */
+#endif
};
/* Get the pointer to a device_node's pci_dn */
^ permalink raw reply
* Re: [PATCH 3/5] Float the pci bus number on MPC8641HPCN board.
From: Wade Farnsworth @ 2007-05-22 17:59 UTC (permalink / raw)
To: Zhang Wei; +Cc: linuxppc-dev, paulus
In-Reply-To: <1179805110278-git-send-email-wei.zhang@freescale.com>
On Tue, 2007-05-22 at 11:38 +0800, Zhang Wei wrote:
> int mpc86xx_exclude_device(u_char bus, u_char devfn)
> {
> + struct pci_controller *hose;
> +
> + hose = pci_bus_to_hose(bus);
> + if (unlikely(!hose))
> + return PCIBIOS_DEVICE_NOT_FOUND;
> +
> + /* Correcting the hose->bus_offset value. */
> + out_be32(hose->cfg_addr, 0x80000000 | ((hose->first_busno
> + - hose->bus_offset) << 16));
> + if (unlikely(in_le32(hose->cfg_data) == 0xffffffff))
> + hose->bus_offset = hose->bus_offset ? 0 : hose->first_busno;
> +
> return PCIBIOS_SUCCESSFUL;
> }
What is the purpose of this code and why put it in
mpc86xx_exclude_device?
--Wade
^ permalink raw reply
* Re: [PATCH 0/5] Add the support for MPC8641 silicon rev 2.0 and MPC8641HPCN board 2.0
From: Wade Farnsworth @ 2007-05-22 17:47 UTC (permalink / raw)
To: Zhang Wei; +Cc: linuxppc-dev, paulus
In-Reply-To: <11798051102658-git-send-email-wei.zhang@freescale.com>
On Tue, 2007-05-22 at 11:38 +0800, Zhang Wei wrote:
> Hi, Paul,
>
> The below 5 patches add the support for MPC8641 rev 2.0 silicon and MPC8641HPCN board 2.0.
>
> [PATCH 1/5] Remove the errata fix codes for MPC8641 silicon ver 1.0 which is end of life.
> [PATCH 2/5] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
> [PATCH 3/5] Float the pci bus number on MPC8641HPCN board.
> [PATCH 4/5] Set RC of mpc8641 to transparent bridge for transfer legacy I/O access.
> [PATCH 5/5] Set IDE in ULI1575 to not native mode.
>
> The MPC8641 rev 2.0 silicon fix the PCI/PCI-Express errata in rev 1.0. And the rev 1.0 silicon is end of life. So the dts tree and codes should be changes. Codes which are not compatible with PCI/PCI-Express specifications are removed. Some minor issues are fixed.
>
> Thanks!
>
> Best Regards,
> Zhang Wei
>
I can't get your patches to apply to Paulus' tree. Which tree are these
against?
--Wade
^ permalink raw reply
* Re: [PATCH] pseries: asm/pci-bridge.h CONFIG_ minor cleanup
From: Linas Vepstas @ 2007-05-22 17:00 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <1179794459.7189.2.camel@concordia.ozlabs.ibm.com>
On Tue, May 22, 2007 at 10:40:59AM +1000, Michael Ellerman wrote:
> On Mon, 2007-05-21 at 18:18 -0500, Linas Vepstas wrote:
> > Use the correct CONFIG_ option to mark off the EEH bits.
>
> You're making the struct 4 bytes larger by creating a hole here :(
Hmm. Perhaps I could shuffle one of the ints down ...
I figured there might be some vague cache-line benefits to
getting the eeh stuff out of the way.
> > u32 config_space[16]; /* saved PCI config space */
> > +#endif
>
> It looks correct, but I think it's worth mentioning in the changelog
> that config_space was previously unconditionally defined, but is now
> within CONFIG_EEH.
I could just tell that someone would remark on this; why I didn't
mention it, I don't know.
--linas
^ permalink raw reply
* Re: [PATCH 0/5] Add the support for MPC8641 silicon rev 2.0 and MPC8641HPCN board 2.0
From: Jon Loeliger @ 2007-05-22 16:28 UTC (permalink / raw)
To: Wei Zhang; +Cc: linuxppc-dev@ozlabs.org, Paul Mackerras
In-Reply-To: <11798051102658-git-send-email-wei.zhang@freescale.com>
On Mon, 2007-05-21 at 22:38, Zhang Wei wrote:
> Hi, Paul,
>
> The below 5 patches add the support for MPC8641 rev 2.0 silicon and MPC8641HPCN board 2.0.
>
> [PATCH 1/5] Remove the errata fix codes for MPC8641 silicon ver 1.0 which is end of life.
> [PATCH 2/5] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
> [PATCH 3/5] Float the pci bus number on MPC8641HPCN board.
> [PATCH 4/5] Set RC of mpc8641 to transparent bridge for transfer legacy I/O access.
> [PATCH 5/5] Set IDE in ULI1575 to not native mode.
>
> The MPC8641 rev 2.0 silicon fix the PCI/PCI-Express errata in rev 1.0. And the rev 1.0 silicon is end of life. So the dts tree and codes should be changes. Codes which are not compatible with PCI/PCI-Express specifications are removed. Some minor issues are fixed.
>
> Thanks!
>
> Best Regards,
> Zhang Wei
Hi Guys,
Until I can get this to work in my test tree, I'd like
to delay these patches. I'm neither NACK'ing nor ACK'ing
them at this point in time.
Thanks,
jdl
^ permalink raw reply
* Re: powerpc 750cl availability
From: Rogelio Serrano @ 2007-05-22 15:38 UTC (permalink / raw)
To: Stephen Winiecki; +Cc: linuxppc-dev
In-Reply-To: <OFFC1F7F41.FBC6131F-ON872572E3.0054328A-852572E3.005511BA@us.ibm.com>
On 5/22/07, Stephen Winiecki <stevewin@us.ibm.com> wrote:
> FYI, here are the part numbers for the IBM 750CL/TSI110 evaluation board
> ('Hackberry') / evaluation kit which you should be able to use with
> distributers like Avnet to identify the product:
>
> IBM kit p/n - 41K7364
> OEM p/n - IBM25EB750CLWINHCK00
>
> The kit includes the board schematics. The Linux 'Holly' platform
> definition which was recently added to /powerpc supports Hackberry as well
> (Holly =750CL/TSI109).
>
I contacted nuhorizons. They have the last remaining board in their
warehouse in singapore. 2250 USD is too much for me though.
> Thanks,
>
> Steve
>
>
>
^ permalink raw reply
* Re: [Patch 2/2] Kexec/Kdump support POWER6
From: Olof Johansson @ 2007-05-22 15:34 UTC (permalink / raw)
To: Sachin P. Sant; +Cc: linuxppc-dev, ellerman, Milton Miller II
In-Reply-To: <4652E17C.7080607@in.ibm.com>
Hi,
On Tue, May 22, 2007 at 05:56:36PM +0530, Sachin P. Sant wrote:
> On Power machines supporting VRMA, Kexec/Kdump does not work.
> Hypervisor stores VRMA mapping used by the OS, in the hpte hash
> tables. Make sure these hpte entries are left untouched.
> diff -Naurp linux-2.6.22-rc2-vrma/arch/powerpc/kernel/machine_kexec_64.c linux-2.6.22-rc2-p6/arch/powerpc/kernel/machine_kexec_64.c
> --- linux-2.6.22-rc2-vrma/arch/powerpc/kernel/machine_kexec_64.c 2007-05-21 15:14:58.000000000 +0530
> +++ linux-2.6.22-rc2-p6/arch/powerpc/kernel/machine_kexec_64.c 2007-05-21 15:19:14.000000000 +0530
> @@ -279,6 +279,9 @@ void default_machine_kexec(struct kimage
> kexec_stack.thread_info.task = current_thread_info()->task;
> kexec_stack.thread_info.flags = 0;
>
> + if (have_vrma)
> + pSeries_find_hpte_vrma();
> +
This will break kexec builds on non-pseries. It's referring to platform
code that might not be built.
> /* Some things are best done in assembly. Finding globals with
> * a toc is easier in C, so pass in what we can.
> */
> diff -Naurp linux-2.6.22-rc2-vrma/arch/powerpc/platforms/pseries/lpar.c linux-2.6.22-rc2-p6/arch/powerpc/platforms/pseries/lpar.c
> --- linux-2.6.22-rc2-vrma/arch/powerpc/platforms/pseries/lpar.c 2007-05-21 15:14:57.000000000 +0530
> +++ linux-2.6.22-rc2-p6/arch/powerpc/platforms/pseries/lpar.c 2007-05-22 15:53:11.000000000 +0530
> @@ -369,6 +369,56 @@ static long pSeries_lpar_hpte_remove(uns
> return -1;
> }
>
> +unsigned long hpte_vrma_slots[HPTE_V_RMA_NUM];
> +unsigned int num_hpte_vrma_slots = 0;
> +
> +void pSeries_find_hpte_vrma(void)
Does this function find the vrma, or save it away? Seems like the name
is misleading.
> +{
> + unsigned int step;
> + unsigned long hash, slot, vaddr;
> + unsigned long dword0, dummy1, rma_size;
> + long lpar_rc;
> + int i;
> +
> + /* Get the RMA size */
> + rma_size = lmb.rmo_size;
> +
> + /* Get the VRMA page size */
> + step = 1 << ppc64_vrma_page_size;
Is ppc64_vrma_page_size really the size, or the shift? Above would
indicate that it's really a shift value.
> +
> + vaddr = HPTE_V_RMA_VPN + rma_size;
> +
> + /* Find hpte's with VRMA mappings */
> + for (; vaddr >= HPTE_V_RMA_VPN; vaddr -= step) {
> + hash = hpt_hash(vaddr, mmu_psize_defs[MMU_PAGE_16M].shift);
Why is 16M hardcoded here, when you're taking such great care to read
out the pagesize earlier?
> + slot = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
> +
> + for (i = 0; i < HPTES_PER_GROUP; i++) {
> + lpar_rc = plpar_pte_read(0, slot,
> + &dword0, &dummy1);
> + if (!lpar_rc && dword0 &&
> + ((dword0 & HPTE_V_MASK) == MAGIC_SKIP_HPTE)) {
Indentation
> + /* store the hpte */
> + hpte_vrma_slots[num_hpte_vrma_slots++] = slot;
Here you rely on global exported state (num_hpte_vrma_slots), increasing it without
checking for limits. What happens if this function is ever called twice? Should you
set it to 0 in the beginning of the function and check it against the size of the
hpte_vrma_slots array instead?
> + break;
> + }
> + slot++;
> + }
> + }
> +}
> +
> +static inline int check_vrma_slot(int slot)
> +{
> + int j;
> +
> + for (j = 0; j < num_hpte_vrma_slots; j++)
> + if (hpte_vrma_slots[j] == slot)
> + return 1;
> +
> + return 0;
> +
> +}
> +
> static void pSeries_lpar_hptab_clear(void)
> {
> unsigned long size_bytes = 1UL << ppc64_pft_size;
> @@ -377,8 +427,12 @@ static void pSeries_lpar_hptab_clear(voi
> int i;
>
> /* TODO: Use bulk call */
> - for (i = 0; i < hpte_count; i++)
> + for (i = 0; i < hpte_count; i++) {
> + if (have_vrma && check_vrma_slot(i))
> + /* You don't want to remove this hpte */
> + continue;
> plpar_pte_remove_raw(0, i, 0, &dummy1, &dummy2);
> + }
> }
>
> /*
> diff -Naurp linux-2.6.22-rc2-vrma/include/asm-powerpc/kexec.h linux-2.6.22-rc2-p6/include/asm-powerpc/kexec.h
> --- linux-2.6.22-rc2-vrma/include/asm-powerpc/kexec.h 2007-05-21 15:14:55.000000000 +0530
> +++ linux-2.6.22-rc2-p6/include/asm-powerpc/kexec.h 2007-05-21 15:19:14.000000000 +0530
> @@ -24,6 +24,8 @@
>
> #define KEXEC_CONTROL_CODE_SIZE 4096
>
> +extern void pSeries_find_hpte_vrma(void);
> +
Same comment as above: This isn't a kexec function as much as a pseries function, so
it should be defined in some other header instead.
> /* The native architecture */
> #ifdef __powerpc64__
> #define KEXEC_ARCH KEXEC_ARCH_PPC64
> diff -Naurp linux-2.6.22-rc2-vrma/include/asm-powerpc/mmu-hash64.h linux-2.6.22-rc2-p6/include/asm-powerpc/mmu-hash64.h
> --- linux-2.6.22-rc2-vrma/include/asm-powerpc/mmu-hash64.h 2007-05-21 15:14:55.000000000 +0530
> +++ linux-2.6.22-rc2-p6/include/asm-powerpc/mmu-hash64.h 2007-05-21 15:23:31.000000000 +0530
> @@ -94,6 +94,11 @@ extern char initial_stab[];
> #define HPTE_R_C ASM_CONST(0x0000000000000080)
> #define HPTE_R_R ASM_CONST(0x0000000000000100)
>
> +#define HPTE_V_RMA_VPN ASM_CONST(0x001FFFFFF0000000)
> +#define HPTE_V_MASK ASM_CONST(0xc000000000000000)
> +#define MAGIC_SKIP_HPTE ASM_CONST(0x4000000000000000)
> +#define HPTE_V_RMA_NUM 16
"MAGIC_SKIP_HPTE"? I'm sure there's a proper name for this field in the
PAPR, isn't there? Also, HPTE_V_RMA_NUM isn't a HPTE_V field, it shouldn't
have that prefix. It's not a property of the mmu in the first place.
These should maybe be local defines in the pseries lpar code instead, since it's
more of a lpar<->phyp interface than mmu programming interface.
-Olof
^ permalink raw reply
* Re: powerpc 750cl availability
From: Stephen Winiecki @ 2007-05-22 15:29 UTC (permalink / raw)
To: rogelio.serrano; +Cc: linuxppc-dev
In-Reply-To: <a9951d2a0705201954k33c06fc8n6912587a45d66c1d@mail.gmail.com>
FYI, here are the part numbers for the IBM 750CL/TSI110 evaluation board
('Hackberry') / evaluation kit which you should be able to use with
distributers like Avnet to identify the product:
IBM kit p/n - 41K7364
OEM p/n - IBM25EB750CLWINHCK00
The kit includes the board schematics. The Linux 'Holly' platform
definition which was recently added to /powerpc supports Hackberry as well
(Holly =750CL/TSI109).
Thanks,
Steve
^ permalink raw reply
* Re: [PATCH] powerpc: Fix powerpc vmlinux.lds.S
From: Will Schmidt @ 2007-05-22 15:01 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Paul Mackerras
In-Reply-To: <1179808385.32247.791.camel@localhost.localdomain>
On Tue, 2007-22-05 at 14:33 +1000, Benjamin Herrenschmidt wrote:
> Sam's recent changes broke things for us, some stuff sneaked in before
> the entry point. In fact, we don't need that *(.text.*) thing anymore
> and it incorrectly matched .text.init.refok, thus putting it
> before .text. .. ouch !
.. Which manifests itself on some systems as a hang after
"returning from prom_init".
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Applying this makes my systems happy again... :-)
Acked-by: Will Schmidt <will_schmidt@vnet.ibm.com>
> ---
>
> Index: linux-work/arch/powerpc/kernel/vmlinux.lds.S
> ===================================================================
> --- linux-work.orig/arch/powerpc/kernel/vmlinux.lds.S 2007-05-22 14:16:39.000000000 +1000
> +++ linux-work/arch/powerpc/kernel/vmlinux.lds.S 2007-05-22 14:19:00.000000000 +1000
> @@ -34,7 +34,6 @@ SECTIONS
> /* Text and gots */
> .text : {
> _text = .;
> - *(.text.*)
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
>
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* RE: Fixed PHY problems
From: Joakim Tjernlund @ 2007-05-22 13:23 UTC (permalink / raw)
To: Hammond Christian-r55079; +Cc: linuxppc-dev
In-Reply-To: <14B28267C4526A42BA5AC7DAA07B783866B7E7@zuk35exm20.fsl.freescale.net>
On Mon, 2007-05-21 at 13:46 +0100, Hammond Christian-r55079 wrote:
> Thanks,
>=20
> Regarding the PHY set-up in the dts once the patch has been applied, =
how
> should it be implemented?
>=20
> I had edited from...
>=20
> phy1: ethernet-phy@01 {
> reg =3D <0>;
> device_type =3D "ethernet-phy";
> interface =3D <6>;
> };=20
>=20
> To...
>=20
> phy1: fixed-phy@64 {
> reg =3D <d#100>;
> device_type =3D "ethernet-phy";
> interface =3D <6>;
> };
>=20
> When bringing up the fixed phy in ifconfig I get the following =
recurring
> dump and prompt access is lost. Should this implementation not just
> ignore the phy set-up?
Yes, but some bits are missing and I don't know OF/PHY lib/MDIO well
enough to make out what to do.
Jocke
^ permalink raw reply
* Re: Using Cypress EZ-Host on ML403/5
From: Grant Likely @ 2007-05-22 13:30 UTC (permalink / raw)
To: Peter Luan; +Cc: linux-usb-devel, Linux PPC Linux PPC
In-Reply-To: <-2527994964044273640@unknownmsgid>
On 5/22/07, Peter Luan <peterluan@truebroad.com> wrote:
>
>
>
>
> Hey Grant, >>I've got it running on my board now after figuring out how to
> wire up external interrupts in EDK. :-)
>
>
> (http://ozlabs.org/pipermail/linuxppc-embedded/2007-May/026965.html)
>
> What do you mean? I've patched my linux kernel-2.6.22-rc1 according to the
> followings:
>
> http://thread.gmane.org/gmane.linux.usb.devel/53285
>
> and I compiled the kernel successfully, but my usb can't work very well.
> Could you tell me what I should do to make it work very well on my ml403
> board.
I'm sorry, I really don't understand what you're having a problem
with. You need to provide a lot more detail about what you've done
and what does not work.
Also, please cc the mailing list when asking for help. It's the
polite thing to do and there are more people than me who can help you.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* [PATCH] Performance Stats: Kernel patch
From: Maxim Uvarov @ 2007-05-22 17:19 UTC (permalink / raw)
To: LKML; +Cc: linuxppc-dev
Hello Andrew,
Sorry for bothering you. I know you are very busy but could
you please tell me what is situation of this patch? You wrote
me you'll discuss it with someone about it and say can it be
accepted or not and in which form. As I understand the
situation all problems now are in syscall counter. What
about other counters?
I changed headers and re-resent patch as you asked. Are there any new?
If it could be accepted I can do fast syscalls counting too.
Thank you very much,
Maxim.
Patch makes available to the user the following
task and process performance statistics:
* Involuntary Context Switches (task_struct->nivcsw)
* Voluntary Context Switches (task_struct->nvcsw)
* Number of system calls (added new counter
thread_info->sysall_count)
Statistics information is available from:
1. taskstats interface (Documentation/accounting/)
2. /proc/PID/status (task only).
This data is useful for detecting hyperactivity
patterns between processes.
Signed-off-by: Maxim Uvarov <muvarov@ru.mvista.com>
---
Documentation/accounting/getdelays.c | 20 ++++++++++++++++++--
Documentation/accounting/taskstats-struct.txt | 7 +++++++
arch/i386/kernel/asm-offsets.c | 1 +
arch/i386/kernel/entry.S | 3 +++
arch/powerpc/kernel/asm-offsets.c | 2 ++
arch/powerpc/kernel/entry_32.S | 5 +++++
arch/powerpc/kernel/entry_64.S | 5 +++++
arch/x86_64/kernel/asm-offsets.c | 1 +
arch/x86_64/kernel/entry.S | 3 +++
fs/proc/array.c | 14 ++++++++++++++
include/asm-i386/thread_info.h | 1 +
include/asm-powerpc/thread_info.h | 1 +
include/asm-x86_64/thread_info.h | 1 +
include/linux/taskstats.h | 6 +++++-
kernel/fork.c | 3 +++
kernel/taskstats.c | 6 ++++++
16 files changed, 76 insertions(+), 3 deletions(-)
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index e9126e7..1be7d65 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -49,6 +49,7 @@ char name[100];
int dbg;
int print_delays;
int print_io_accounting;
+int print_task_stats;
__u64 stime, utime;
#define PRINTF(fmt, arg...) { \
@@ -187,7 +188,7 @@ void print_delayacct(struct taskstats *t)
"IO %15s%15s\n"
" %15llu%15llu\n"
"MEM %15s%15s\n"
- " %15llu%15llu\n\n",
+ " %15llu%15llu\n"
"count", "real total", "virtual total", "delay total",
t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total,
t->cpu_delay_total,
@@ -196,6 +197,15 @@ void print_delayacct(struct taskstats *t)
"count", "delay total", t->swapin_count, t->swapin_delay_total);
}
+void print_taskstats(struct taskstats *t)
+{
+ printf("\n\nTask %15s%15s%15s\n"
+ " %15lu%15lu%15lu\n",
+ "syscalls", "voluntary", "nonvoluntary",
+ t->syscall_counter, t->nvcsw, t->nivcsw);
+
+}
+
void print_ioacct(struct taskstats *t)
{
printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n",
@@ -227,7 +237,7 @@ int main(int argc, char *argv[])
struct msgtemplate msg;
while (1) {
- c = getopt(argc, argv, "diw:r:m:t:p:v:l");
+ c = getopt(argc, argv, "qdiw:r:m:t:p:v:l");
if (c < 0)
break;
@@ -240,6 +250,10 @@ int main(int argc, char *argv[])
printf("printing IO accounting\n");
print_io_accounting = 1;
break;
+ case 'q':
+ printf("printing task/process stasistics:\n");
+ print_task_stats = 1;
+ break;
case 'w':
strncpy(logfile, optarg, MAX_FILENAME);
printf("write to file %s\n", logfile);
@@ -381,6 +395,8 @@ int main(int argc, char *argv[])
print_delayacct((struct taskstats *) NLA_DATA(na));
if (print_io_accounting)
print_ioacct((struct taskstats *) NLA_DATA(na));
+ if (print_task_stats)
+ print_taskstats((struct taskstats *) NLA_DATA(na));
if (fd) {
if (write(fd, NLA_DATA(na), na->nla_len) < 0) {
err(1,"write error\n");
diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.txt
index 661c797..606aef6 100644
--- a/Documentation/accounting/taskstats-struct.txt
+++ b/Documentation/accounting/taskstats-struct.txt
@@ -22,6 +22,8 @@ There are three different groups of fields in the struct taskstats:
/* Extended accounting fields end */
Their values are collected if CONFIG_TASK_XACCT is set.
+4) Per-task and per-thread statistics
+
Future extension should add fields to the end of the taskstats struct, and
should not change the relative position of each field within the struct.
@@ -158,4 +160,9 @@ struct taskstats {
/* Extended accounting fields end */
+4) Per-task and per-thread statiscits
+ __u64 syscall_counter; /* Syscall counter */
+ __u64 nvcsw; /* Context voluntary switch counter */
+ __u64 nivcsw; /* Context involuntary switch counter */
+
}
diff --git a/arch/i386/kernel/asm-offsets.c b/arch/i386/kernel/asm-offsets.c
index 1b2f3cd..4ad49d2 100644
--- a/arch/i386/kernel/asm-offsets.c
+++ b/arch/i386/kernel/asm-offsets.c
@@ -56,6 +56,7 @@ void foo(void)
OFFSET(TI_addr_limit, thread_info, addr_limit);
OFFSET(TI_restart_block, thread_info, restart_block);
OFFSET(TI_sysenter_return, thread_info, sysenter_return);
+ OFFSET(TI_syscall_count, thread_info, syscall_count);
BLANK();
OFFSET(GDS_size, Xgt_desc_struct, size);
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index 5e47683..836961f 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -332,6 +332,9 @@ sysenter_past_esp:
SAVE_ALL
GET_THREAD_INFO(%ebp)
+#ifdef CONFIG_TASKSTATS
+ incl TI_syscall_count(%ebp) # Increment syscalls counter
+#endif
/* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
jnz syscall_trace_entry
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 030d300..b640039 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -94,6 +94,8 @@ int main(void)
DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
DEFINE(TI_TASK, offsetof(struct thread_info, task));
+ DEFINE(TI_SYSCALL_COUNT, offsetof(struct thread_info, syscall_count));
+
#ifdef CONFIG_PPC32
DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index c03e829..5d919e4 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -202,6 +202,11 @@ _GLOBAL(DoSyscall)
bl do_show_syscall
#endif /* SHOW_SYSCALLS */
rlwinm r10,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
+#ifdef CONFIG_TASKSTATS
+ lwz r11,TI_SYSC_CNT(r10)
+ addi r11,r11,1
+ stw r11,TI_SYSC_CNT(r10)
+#endif
lwz r11,TI_FLAGS(r10)
andi. r11,r11,_TIF_SYSCALL_T_OR_A
bne- syscall_dotrace
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 2551c08..5907f76 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -115,6 +115,11 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
addi r9,r1,STACK_FRAME_OVERHEAD
#endif
clrrdi r11,r1,THREAD_SHIFT
+#ifdef CONFIG_TASKSTATS
+ ld r10,TI_SYSCALL_COUNT(r11)
+ addi r10,r10,1
+ std r10,TI_SYSCALL_COUNT(r11)
+#endif
ld r10,TI_FLAGS(r11)
andi. r11,r10,_TIF_SYSCALL_T_OR_A
bne- syscall_dotrace
diff --git a/arch/x86_64/kernel/asm-offsets.c b/arch/x86_64/kernel/asm-offsets.c
index 96687e2..da57356 100644
--- a/arch/x86_64/kernel/asm-offsets.c
+++ b/arch/x86_64/kernel/asm-offsets.c
@@ -35,6 +35,7 @@ int main(void)
ENTRY(addr_limit);
ENTRY(preempt_count);
ENTRY(status);
+ ENTRY(syscall_count);
BLANK();
#undef ENTRY
#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 9f5dac6..af40ead 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -229,6 +229,9 @@ ENTRY(system_call)
movq %rcx,RIP-ARGOFFSET(%rsp)
CFI_REL_OFFSET rip,RIP-ARGOFFSET
GET_THREAD_INFO(%rcx)
+#ifdef CONFIG_TASKSTATS
+ addq $1, threadinfo_syscall_count(%rcx) # Increment syscalls counter
+#endif
testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx)
jnz tracesys
cmpq $__NR_syscall_max,%rax
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 70e4fab..c805c08 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -290,6 +290,19 @@ static inline char *task_cap(struct task_struct *p, char *buffer)
cap_t(p->cap_permitted),
cap_t(p->cap_effective));
}
+static inline char *task_perf(struct task_struct *p, char *buffer)
+{
+ /* Syscall counter adds 1 line overhead on each syscall execution
+ * in entry.S, so probably it is the leave this stuff under ifdefs.
+ */
+#ifdef CONFIG_TASKSTATS
+ buffer += sprintf(buffer, "Syscalls:\t%lu\n", p->thread_info->syscall_count);
+#endif
+ return buffer + sprintf(buffer, "voluntary_ctxt_switches:\t%lu\n"
+ "nonvoluntary_ctxt_switches:\t%lu\n",
+ p->nvcsw,
+ p->nivcsw);
+}
int proc_pid_status(struct task_struct *task, char * buffer)
{
@@ -309,6 +322,7 @@ int proc_pid_status(struct task_struct *task, char * buffer)
#if defined(CONFIG_S390)
buffer = task_show_regs(task, buffer);
#endif
+ buffer = task_perf(task, buffer);
return buffer - orig;
}
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 4b187bb..bccfd6a 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -33,6 +33,7 @@ struct thread_info {
int preempt_count; /* 0 => preemptable, <0 => BUG */
+ unsigned long syscall_count; /* Syscall counter */
mm_segment_t addr_limit; /* thread address space:
0-0xBFFFFFFF for user-thead
0-0xFFFFFFFF for kernel-thread
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h
index 3f32ca8..5306ac2 100644
--- a/include/asm-powerpc/thread_info.h
+++ b/include/asm-powerpc/thread_info.h
@@ -35,6 +35,7 @@ struct thread_info {
int cpu; /* cpu we're on */
int preempt_count; /* 0 => preemptable,
<0 => BUG */
+ unsigned long syscall_count; /* Syscall counter */
struct restart_block restart_block;
unsigned long local_flags; /* private flags for thread */
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h
index 74a6c74..e53022d 100644
--- a/include/asm-x86_64/thread_info.h
+++ b/include/asm-x86_64/thread_info.h
@@ -31,6 +31,7 @@ struct thread_info {
__u32 cpu; /* current CPU */
int preempt_count; /* 0 => preemptable, <0 => BUG */
+ unsigned long syscall_count; /* Syscall counter */
mm_segment_t addr_limit;
struct restart_block restart_block;
};
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index 3fced47..98dfde7 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -31,7 +31,7 @@
*/
-#define TASKSTATS_VERSION 3
+#define TASKSTATS_VERSION 4
#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
* in linux/sched.h */
@@ -141,6 +141,10 @@ struct taskstats {
__u64 write_syscalls; /* write syscalls */
/* Extended accounting fields end */
+ __u64 syscall_counter; /* Syscall counter */
+ __u64 nvcsw;
+ __u64 nivcsw;
+
#define TASKSTATS_HAS_IO_ACCOUNTING
/* Per-task storage I/O accounting starts */
__u64 read_bytes; /* bytes of read I/O */
diff --git a/kernel/fork.c b/kernel/fork.c
index fc723e5..5213738 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1042,6 +1042,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
p->wchar = 0; /* I/O counter: bytes written */
p->syscr = 0; /* I/O counter: read syscalls */
p->syscw = 0; /* I/O counter: write syscalls */
+#ifdef CONFIG_TASKSTATS
+ p->thread_info->syscall_count = 0; /* Syscall counter: total numbers of syscalls */
+#endif
task_io_accounting_init(p);
acct_clear_integrals(p);
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index 4c3476f..d7bf33f 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -196,6 +196,9 @@ static int fill_pid(pid_t pid, struct task_struct *tsk,
/* fill in basic acct fields */
stats->version = TASKSTATS_VERSION;
+ stats->syscall_counter = tsk->thread_info->syscall_count;
+ stats->nvcsw = tsk->nvcsw;
+ stats->nivcsw = tsk->nivcsw;
bacct_add_tsk(stats, tsk);
/* fill in extended acct fields */
@@ -242,6 +245,9 @@ static int fill_tgid(pid_t tgid, struct task_struct *first,
*/
delayacct_add_tsk(stats, tsk);
+ stats->syscall_counter += tsk->thread_info->syscall_count;
+ stats->nvcsw += tsk->nvcsw;
+ stats->nivcsw += tsk->nivcsw;
} while_each_thread(first, tsk);
unlock_task_sighand(first, &flags);
^ permalink raw reply related
* Re: [PATCH 0/5] Add the support for MPC8641 silicon rev 2.0 and MPC8641HPCN board 2.0
From: Kumar Gala @ 2007-05-22 12:54 UTC (permalink / raw)
To: Zhang Wei-r63237; +Cc: ppc-dev dev ML, Paul Mackerras
In-Reply-To: <46B96294322F7D458F9648B60E15112C2348C8@zch01exm26.fsl.freescale.net>
On May 21, 2007, at 11:46 PM, Zhang Wei-r63237 wrote:
> Hi, Kumar,
>
> Please see my inline comments:
>>>
>>> [PATCH 1/5] Remove the errata fix codes for MPC8641 silicon ver
>>> 1.0 which is end of life.
>
> This patch is not included in Wade's patch.
>
> MPC8641 silicon 1.0 is end of life and not full following
> PCI/PCI-Express specifications.
> Rev 2.0 silicon fixes these PCI/PCI-Express errata and follows the
> PCI/PCI-Ex specifications.
> So, using generic PCI codes is okay.
Was rev1.0 silicon ever used by customers w/ production systems?
>>> [PATCH 2/5] Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
>
> This's a simple and clear solution to Wade's pci fix patch. Some
> changes
> of Wade's pci fix patch are redundant.
>
>>> [PATCH 3/5] Float the pci bus number on MPC8641HPCN board.
>
> This patch is not included in Wade's patch.
>
> Every PCI hose bus range number is started from 0 before. This patch
> make the hose bus range number is started from previous hose last bus
> number added one.
> And PCI-Ex tranining status check is added to avoid the system halt.
>
>>> [PATCH 4/5] Set RC of mpc8641 to transparent bridge for transfer
>>> legacy I/O access.
>
> This patch is different than Wade's pci fix patch.
> Wade's pci patch changing MPC8641 PCI_CLASS property is not a good
> solution. Only set it to transport bridge is okay.
> And this quirk functions should applied to both MPC8641 and MPC8641D,
> not only dual core version.
>
>>> [PATCH 5/5] Set IDE in ULI1575 to not native mode.
>
> This patch is not included in Wade's patch.
> It makes IDE in ULI1575 works.
>
>>
>> How do these patches differ/interace from what Wade posted a
>> few days
>> ago?
>
> Wade's MTD patch (patch 1), Legacy patch (patch 2), superIO patch
> (patch
> 3), RTC patch (patch 4) is not overlap with my patches.
> But Wade's PCI patch (patch 5) most of codes is for supporting a
> discontinued and end of life silicon and I do not agree with the
> changes
> about PCI_CLASS of MPC8641. The dts fixing is too complex. I
> suggest to
> reject Wade's PCI patch.
Is Wade going to rebase his patches on top of your's?
- k
^ permalink raw reply
* Re: [PPC] Remove duplicate export of __div64_32.
From: Kumar Gala @ 2007-05-22 12:51 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18002.50866.169757.638254@cargo.ozlabs.ibm.com>
On May 22, 2007, at 5:32 AM, Paul Mackerras wrote:
> Kumar Gala writes:
>
>> We now get the export of __div64_32 from lib/div64.c and can drop
>> the one
>> in ppc_ksysm.c
>
> Great, but please remove the #include <asm/div64.h> as well.
git-amend'd :)
- k
^ permalink raw reply
* [Patch 2/2] Kexec/Kdump support POWER6
From: Sachin P. Sant @ 2007-05-22 12:26 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Milton Miller II, ellerman
In-Reply-To: <4652E109.4020204@in.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 201 bytes --]
On Power machines supporting VRMA, Kexec/Kdump does not work.
Hypervisor stores VRMA mapping used by the OS, in the hpte hash
tables. Make sure these hpte entries are left untouched.
Thanks
-Sachin
[-- Attachment #2: kexec-kdump-support-for-POWRE6 --]
[-- Type: text/plain, Size: 4218 bytes --]
* On Power machines supporting VRMA, Kexec/Kdump does not work.
* Hypervisor stores VRMA mapping used by the OS, in the hpte hash tables.
* Make sure these hpte entries are left untouched.
Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
Signed-off-by : Mohan Kumar M <mohan@in.ibm.com>
---
diff -Naurp linux-2.6.22-rc2-vrma/arch/powerpc/kernel/machine_kexec_64.c linux-2.6.22-rc2-p6/arch/powerpc/kernel/machine_kexec_64.c
--- linux-2.6.22-rc2-vrma/arch/powerpc/kernel/machine_kexec_64.c 2007-05-21 15:14:58.000000000 +0530
+++ linux-2.6.22-rc2-p6/arch/powerpc/kernel/machine_kexec_64.c 2007-05-21 15:19:14.000000000 +0530
@@ -279,6 +279,9 @@ void default_machine_kexec(struct kimage
kexec_stack.thread_info.task = current_thread_info()->task;
kexec_stack.thread_info.flags = 0;
+ if (have_vrma)
+ pSeries_find_hpte_vrma();
+
/* Some things are best done in assembly. Finding globals with
* a toc is easier in C, so pass in what we can.
*/
diff -Naurp linux-2.6.22-rc2-vrma/arch/powerpc/platforms/pseries/lpar.c linux-2.6.22-rc2-p6/arch/powerpc/platforms/pseries/lpar.c
--- linux-2.6.22-rc2-vrma/arch/powerpc/platforms/pseries/lpar.c 2007-05-21 15:14:57.000000000 +0530
+++ linux-2.6.22-rc2-p6/arch/powerpc/platforms/pseries/lpar.c 2007-05-22 15:53:11.000000000 +0530
@@ -369,6 +369,56 @@ static long pSeries_lpar_hpte_remove(uns
return -1;
}
+unsigned long hpte_vrma_slots[HPTE_V_RMA_NUM];
+unsigned int num_hpte_vrma_slots = 0;
+
+void pSeries_find_hpte_vrma(void)
+{
+ unsigned int step;
+ unsigned long hash, slot, vaddr;
+ unsigned long dword0, dummy1, rma_size;
+ long lpar_rc;
+ int i;
+
+ /* Get the RMA size */
+ rma_size = lmb.rmo_size;
+
+ /* Get the VRMA page size */
+ step = 1 << ppc64_vrma_page_size;
+
+ vaddr = HPTE_V_RMA_VPN + rma_size;
+
+ /* Find hpte's with VRMA mappings */
+ for (; vaddr >= HPTE_V_RMA_VPN; vaddr -= step) {
+ hash = hpt_hash(vaddr, mmu_psize_defs[MMU_PAGE_16M].shift);
+ slot = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
+
+ for (i = 0; i < HPTES_PER_GROUP; i++) {
+ lpar_rc = plpar_pte_read(0, slot,
+ &dword0, &dummy1);
+ if (!lpar_rc && dword0 &&
+ ((dword0 & HPTE_V_MASK) == MAGIC_SKIP_HPTE)) {
+ /* store the hpte */
+ hpte_vrma_slots[num_hpte_vrma_slots++] = slot;
+ break;
+ }
+ slot++;
+ }
+ }
+}
+
+static inline int check_vrma_slot(int slot)
+{
+ int j;
+
+ for (j = 0; j < num_hpte_vrma_slots; j++)
+ if (hpte_vrma_slots[j] == slot)
+ return 1;
+
+ return 0;
+
+}
+
static void pSeries_lpar_hptab_clear(void)
{
unsigned long size_bytes = 1UL << ppc64_pft_size;
@@ -377,8 +427,12 @@ static void pSeries_lpar_hptab_clear(voi
int i;
/* TODO: Use bulk call */
- for (i = 0; i < hpte_count; i++)
+ for (i = 0; i < hpte_count; i++) {
+ if (have_vrma && check_vrma_slot(i))
+ /* You don't want to remove this hpte */
+ continue;
plpar_pte_remove_raw(0, i, 0, &dummy1, &dummy2);
+ }
}
/*
diff -Naurp linux-2.6.22-rc2-vrma/include/asm-powerpc/kexec.h linux-2.6.22-rc2-p6/include/asm-powerpc/kexec.h
--- linux-2.6.22-rc2-vrma/include/asm-powerpc/kexec.h 2007-05-21 15:14:55.000000000 +0530
+++ linux-2.6.22-rc2-p6/include/asm-powerpc/kexec.h 2007-05-21 15:19:14.000000000 +0530
@@ -24,6 +24,8 @@
#define KEXEC_CONTROL_CODE_SIZE 4096
+extern void pSeries_find_hpte_vrma(void);
+
/* The native architecture */
#ifdef __powerpc64__
#define KEXEC_ARCH KEXEC_ARCH_PPC64
diff -Naurp linux-2.6.22-rc2-vrma/include/asm-powerpc/mmu-hash64.h linux-2.6.22-rc2-p6/include/asm-powerpc/mmu-hash64.h
--- linux-2.6.22-rc2-vrma/include/asm-powerpc/mmu-hash64.h 2007-05-21 15:14:55.000000000 +0530
+++ linux-2.6.22-rc2-p6/include/asm-powerpc/mmu-hash64.h 2007-05-21 15:23:31.000000000 +0530
@@ -94,6 +94,11 @@ extern char initial_stab[];
#define HPTE_R_C ASM_CONST(0x0000000000000080)
#define HPTE_R_R ASM_CONST(0x0000000000000100)
+#define HPTE_V_RMA_VPN ASM_CONST(0x001FFFFFF0000000)
+#define HPTE_V_MASK ASM_CONST(0xc000000000000000)
+#define MAGIC_SKIP_HPTE ASM_CONST(0x4000000000000000)
+#define HPTE_V_RMA_NUM 16
+
/* Values for PP (assumes Ks=0, Kp=1) */
/* pp0 will always be 0 for linux */
#define PP_RWXX 0 /* Supervisor read/write, User none */
^ permalink raw reply
* [Patch 1/2] Kexec/Kdump support POWER6
From: Sachin P. Sant @ 2007-05-22 12:24 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Milton Miller II, ellerman
In-Reply-To: <4652E088.9080207@in.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 66 bytes --]
Read supported VRMA page size from device tree.
Thanks
-Sachin
[-- Attachment #2: detect-vrma-page-size --]
[-- Type: text/plain, Size: 2009 bytes --]
* Read supported VRMA page size from device tree.
Signed-Off-By : Sachin Sant <sachinp@in.ibm.com>
Signed-Off-By : Mohan Kumar M <mohan@in.ibm.com>
---
diff -Naurp linux-2.6.22-rc2/arch/powerpc/kernel/setup_64.c linux-2.6.22-rc2-vrma/arch/powerpc/kernel/setup_64.c
--- linux-2.6.22-rc2/arch/powerpc/kernel/setup_64.c 2007-05-19 09:36:17.000000000 +0530
+++ linux-2.6.22-rc2-vrma/arch/powerpc/kernel/setup_64.c 2007-05-21 15:15:30.000000000 +0530
@@ -73,6 +73,10 @@ int have_of = 1;
int boot_cpuid = 0;
u64 ppc64_pft_size;
+/* For VRMA */
+u64 ppc64_vrma_page_size;
+int have_vrma = 0;
+
/* Pick defaults since we might want to patch instructions
* before we've read this from the device tree.
*/
diff -Naurp linux-2.6.22-rc2/arch/powerpc/mm/hash_utils_64.c linux-2.6.22-rc2-vrma/arch/powerpc/mm/hash_utils_64.c
--- linux-2.6.22-rc2/arch/powerpc/mm/hash_utils_64.c 2007-05-19 09:36:17.000000000 +0530
+++ linux-2.6.22-rc2-vrma/arch/powerpc/mm/hash_utils_64.c 2007-05-21 15:18:10.000000000 +0530
@@ -199,6 +199,13 @@ static int __init htab_dt_scan_page_size
if (type == NULL || strcmp(type, "cpu") != 0)
return 0;
+ prop = (u32 *)of_get_flat_dt_prop(node, "ibm,vrma-page-sizes", &size);
+ if (prop != NULL) {
+ DBG("VRMA Page size from device-tree:\n");
+ ppc64_vrma_page_size = prop[0];
+ have_vrma = 1;
+ }
+
prop = (u32 *)of_get_flat_dt_prop(node,
"ibm,segment-page-sizes", &size);
if (prop != NULL) {
diff -Naurp linux-2.6.22-rc2/include/asm-powerpc/page_64.h linux-2.6.22-rc2-vrma/include/asm-powerpc/page_64.h
--- linux-2.6.22-rc2/include/asm-powerpc/page_64.h 2007-05-19 09:36:17.000000000 +0530
+++ linux-2.6.22-rc2-vrma/include/asm-powerpc/page_64.h 2007-05-21 15:15:30.000000000 +0530
@@ -76,6 +76,10 @@ static inline void copy_page(void *to, v
/* Log 2 of page table size */
extern u64 ppc64_pft_size;
+/* For VRMA */
+extern u64 ppc64_vrma_page_size;
+extern int have_vrma;
+
/* Large pages size */
#ifdef CONFIG_HUGETLB_PAGE
extern unsigned int HPAGE_SHIFT;
^ permalink raw reply
* [Patch 0/2] Kexec/Kdump support POWER6
From: Sachin P. Sant @ 2007-05-22 12:22 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Milton Miller II, ellerman
Here are a set of patches which adds kdump support for Power6.
The first patch reads VRMA page size from device tree.
Second patch adds Kexec/Kdump support for Power6 processor.
On Power machines supporting VRMA, Kexec/Kdump does not work.
Hypervisor stores VRMA mapping used by the OS, in the hpte
hash tables. This patch makes sure these hpte entries are
left untouched.
Comments are welcome.
Thanks
-Sachin
Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
Signed-off-by : Mohan Kumar M <mohan@in.ibm.com>
---
^ permalink raw reply
* [PATCH] powerpc 2.6.21-rt6: revert spider_net
From: Tsutomu OWA @ 2007-05-22 11:53 UTC (permalink / raw)
To: linuxppc-dev, linux-kernel; +Cc: mingo, tglx
Hi Ingo and Thomas,
Please apply.
To revert spider_net.c to original one as it turns out that the patch
I sent was unnecessary. It was my mistake.
Compile, boot and netperf tested on celleb.
thanks for your time!
Signed-off-by: Tsutomu OWA <tsutomu.owa@toshiba.co.jp>
-- owa
--- linux-2.6.21-rt3/drivers/net/spider_net.c 2007-05-21 15:19:42.000000000 +0900
+++ rt/drivers/net/spider_net.c 2007-04-26 12:08:32.000000000 +0900
@@ -688,6 +688,7 @@ spider_net_prepare_tx_descr(struct spide
struct spider_net_descr *descr;
struct spider_net_hw_descr *hwdescr;
dma_addr_t buf;
+ unsigned long flags;
buf = pci_map_single(card->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
if (pci_dma_mapping_error(buf)) {
@@ -698,8 +699,10 @@ spider_net_prepare_tx_descr(struct spide
return -ENOMEM;
}
+ spin_lock_irqsave(&chain->lock, flags);
descr = card->tx_chain.head;
if (descr->next == chain->tail->prev) {
+ spin_unlock_irqrestore(&chain->lock, flags);
pci_unmap_single(card->pdev, buf, skb->len, PCI_DMA_TODEVICE);
return -ENOMEM;
}
@@ -714,6 +717,7 @@ spider_net_prepare_tx_descr(struct spide
hwdescr->dmac_cmd_status =
SPIDER_NET_DESCR_CARDOWNED | SPIDER_NET_DMAC_NOCS;
+ spin_unlock_irqrestore(&chain->lock, flags);
if (skb->protocol == htons(ETH_P_IP) && skb->ip_summed == CHECKSUM_PARTIAL)
switch (skb->nh.iph->protocol) {
@@ -738,6 +742,7 @@ spider_net_set_low_watermark(struct spid
{
struct spider_net_descr *descr = card->tx_chain.tail;
struct spider_net_hw_descr *hwdescr;
+ unsigned long flags;
int status;
int cnt=0;
int i;
@@ -763,6 +768,7 @@ spider_net_set_low_watermark(struct spid
descr = descr->next;
/* Set the new watermark, clear the old watermark */
+ spin_lock_irqsave(&card->tx_chain.lock, flags);
descr->hwdescr->dmac_cmd_status |= SPIDER_NET_DESCR_TXDESFLG;
if (card->low_watermark && card->low_watermark != descr) {
hwdescr = card->low_watermark->hwdescr;
@@ -770,7 +776,7 @@ spider_net_set_low_watermark(struct spid
hwdescr->dmac_cmd_status & ~SPIDER_NET_DESCR_TXDESFLG;
}
card->low_watermark = descr;
-
+ spin_unlock_irqrestore(&card->tx_chain.lock, flags);
return cnt;
}
@@ -778,7 +784,6 @@ spider_net_set_low_watermark(struct spid
* spider_net_release_tx_chain - processes sent tx descriptors
* @card: adapter structure
* @brutal: if set, don't care about whether descriptor seems to be in use
- * @locked: if set, tx_chain locked is held by caller.
*
* returns 0 if the tx ring is empty, otherwise 1.
*
@@ -788,7 +793,7 @@ spider_net_set_low_watermark(struct spid
* scheduled again (if we were scheduled) and will not loose initiative.
*/
static int
-spider_net_release_tx_chain(struct spider_net_card *card, int brutal, int locked)
+spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
{
struct spider_net_descr_chain *chain = &card->tx_chain;
struct spider_net_descr *descr;
@@ -799,11 +804,9 @@ spider_net_release_tx_chain(struct spide
int status;
while (1) {
- if (!locked)
- spin_lock_irqsave(&chain->lock, flags);
+ spin_lock_irqsave(&chain->lock, flags);
if (chain->tail == chain->head) {
- if (!locked)
- spin_unlock_irqrestore(&chain->lock, flags);
+ spin_unlock_irqrestore(&chain->lock, flags);
return 0;
}
descr = chain->tail;
@@ -818,8 +821,7 @@ spider_net_release_tx_chain(struct spide
case SPIDER_NET_DESCR_CARDOWNED:
if (!brutal) {
- if (!locked)
- spin_unlock_irqrestore(&chain->lock, flags);
+ spin_unlock_irqrestore(&chain->lock, flags);
return 1;
}
@@ -840,8 +842,7 @@ spider_net_release_tx_chain(struct spide
default:
card->netdev_stats.tx_dropped++;
if (!brutal) {
- if (!locked)
- spin_unlock_irqrestore(&chain->lock, flags);
+ spin_unlock_irqrestore(&chain->lock, flags);
return 1;
}
}
@@ -851,9 +852,7 @@ spider_net_release_tx_chain(struct spide
skb = descr->skb;
descr->skb = NULL;
buf_addr = hwdescr->buf_addr;
-
- if (!locked)
- spin_unlock_irqrestore(&chain->lock, flags);
+ spin_unlock_irqrestore(&chain->lock, flags);
/* unmap the skb */
if (skb) {
@@ -917,28 +916,18 @@ spider_net_xmit(struct sk_buff *skb, str
{
int cnt;
struct spider_net_card *card = netdev_priv(netdev);
- unsigned long flags;
-
- if (!spin_trylock_irqsave(&card->tx_chain.lock, flags))
- return NETDEV_TX_BUSY;
- //? collision ? return NETDEV_TX_LOCKED;
- spider_net_release_tx_chain(card, 0, 1);
+ spider_net_release_tx_chain(card, 0);
if (spider_net_prepare_tx_descr(card, skb) != 0) {
- spin_unlock_irqrestore(&card->tx_chain.lock, flags);
card->netdev_stats.tx_dropped++;
netif_stop_queue(netdev);
return NETDEV_TX_BUSY;
}
cnt = spider_net_set_low_watermark(card);
-
- spin_unlock_irqrestore(&card->tx_chain.lock, flags);
-
if (cnt < 5)
spider_net_kick_tx_dma(card);
-
return NETDEV_TX_OK;
}
@@ -954,20 +943,11 @@ spider_net_xmit(struct sk_buff *skb, str
static void
spider_net_cleanup_tx_ring(struct spider_net_card *card)
{
- unsigned long flags;
-
- if (!spin_trylock_irqsave(&card->tx_chain.lock, flags))
- return;
-
- if ((spider_net_release_tx_chain(card, 0, 1) != 0) &&
+ if ((spider_net_release_tx_chain(card, 0) != 0) &&
(card->netdev->flags & IFF_UP)) {
- spin_unlock_irqrestore(&card->tx_chain.lock, flags);
spider_net_kick_tx_dma(card);
netif_wake_queue(card->netdev);
- } else
- spin_unlock_irqrestore(&card->tx_chain.lock, flags);
-
-
+ }
}
/**
@@ -2112,7 +2092,7 @@ spider_net_stop(struct net_device *netde
spider_net_disable_rxdmac(card);
/* release chains */
- spider_net_release_tx_chain(card, 1, 0);
+ spider_net_release_tx_chain(card, 1);
spider_net_free_rx_chain_contents(card);
spider_net_free_chain(card, &card->tx_chain);
^ permalink raw reply
* [PATCH] powerpc 2.6.21-rt6: replace preempt_schedule w/ preempt_schedule_irq
From: Tsutomu OWA @ 2007-05-22 11:47 UTC (permalink / raw)
To: linuxppc-dev, linux-kernel; +Cc: mingo, tglx
Hi Ingo and Thomas,
Please apply.
Replace preempt_schedule() w/ preempt_schedule_irq() in irq return path,
to avoid irq-entry recursion and stack overflow problems for powerpc64.
It hits when doing netperf from another machine to the machine running rt kernel.
This patch applies on top of linux-2.6.21 + patch-2.6.21-rt6.
Compile, boot and netperf tested on celleb.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
~ $ uname -a
Linux Linux 2.6.21-rt6 #1 SMP PREEMPT RT Tue May 22 19:18:00 JST 2007 ppc64 unkn
own
~ $ Unable to handle kernel paging request for data at address 0xc0000180004cd9b
0
Faulting instruction address: 0xc00000000003da48
cpu 0x0: Vector: 300 (Data Access) at [c00000000fffba00]
pc: c00000000003da48: .resched_task+0x34/0xc4
lr: c0000000000410b4: .try_to_wake_up+0x4cc/0x5a8
sp: c00000000fffbc80
msr: 9000000000001032
dar: c0000180004cd9b0
dsisr: 40000000
current = 0xc00000000244ed20
paca = 0xc0000000004cd980
pid = 425, comm = netserver
enter ? for help
[c00000000fffbd00] c0000000000410b4 .try_to_wake_up+0x4cc/0x5a8
[c00000000fffbde0] c0000000000880c8 .redirect_hardirq+0x68/0x88
[c00000000fffbe60] c00000000008aec8 .handle_level_irq+0x13c/0x220
[c00000000fffbf00] c000000000032538 .spider_irq_cascade+0x98/0xec
[c00000000fffbf90] c000000000022280 .call_handle_irq+0x1c/0x2c
[c0000000025abea0] c00000000000c33c .do_IRQ+0xc8/0x17c
[c0000000025abf30] c00000000000444c hardware_interrupt_entry+0x18/0x4c
--- Exception: 501 (Hardware Interrupt) at c00000000000afec .raw_local_irq_restore+0x3c/0x40
[link register ] c0000000003baaac .preempt_schedule+0xac/0xd0
[c0000000025ac220] c0000000003baa88 .preempt_schedule+0x88/0xd0 (unreliable)
[c0000000025ac2b0] c000000000008bd8 do_work+0x38/0x5c
--- Exception: 501 (Hardware Interrupt) at c00000000000afec .raw_local_irq_resto
<snip><snip><snip><snip><snip><snip><snip><snip><snip><snip><snip><snip><snip>
--- Exception: 501 (Hardware Interrupt) at c00000000000afec .raw_local_irq_restore+0x3c/0x40
[link register ] c0000000003baaac .preempt_schedule+0xac/0xd0
[c0000000025af320] c0000000003baa88 .preempt_schedule+0x88/0xd0 (unreliable)
[c0000000025af3b0] c000000000008bd8 do_work+0x38/0x5c
--- Exception: 501 (Hardware Interrupt) at c00000000002eb64 .__copy_tofrom_user+0x164/0x580
[link register ] c00000000002f26c .copy_to_user+0x34/0x50
[c0000000025af6a0] 00000000000005a8 (unreliable)
[c0000000025af710] c000000000318674 .memcpy_toiovec+0x58/0xc4
[c0000000025af7b0] c000000000318d4c .skb_copy_datagram_iovec+0x90/0x2d0
[c0000000025af870] c000000000349bf4 .tcp_recvmsg+0x534/0x8d8
[c0000000025af960] c000000000310fd8 .sock_common_recvmsg+0x5c/0x84
[c0000000025af9f0] c00000000030ea58 .sock_recvmsg+0x110/0x15c
[c0000000025afc00] c0000000003101b0 .sys_recvfrom+0xf0/0x174
[c0000000025afd90] c00000000032e20c .compat_sys_socketcall+0x178/0x214
[c0000000025afe30] c000000000008608 syscall_exit+0x0/0x40
--- Exception: c01 (System Call) at 000000000fe86df0
SP (ffe709c0) is in userspace
0:mon>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
thanks in advance.
Signed-off-by: Tsutomu OWA <tsutomu.owa@toshiba.co.jp>
-- owa
--- mcount/arch/powerpc/kernel/entry_64.S 2007-05-15 18:46:38.000000000 +0900
+++ send/rt/arch/powerpc/kernel/entry_64.S 2007-05-15 15:44:40.000000000 +0900
@@ -559,14 +559,9 @@ do_work:
cmpdi r0,0
crandc eq,cr1*4+eq,eq
bne restore
- /* here we are preempting the current task */
1:
- li r0,1
- stb r0,PACASOFTIRQEN(r13)
- stb r0,PACAHARDIRQEN(r13)
- ori r10,r10,MSR_EE
- mtmsrd r10,1 /* reenable interrupts */
- bl .preempt_schedule
+ /* preempt_schedule_irq() expects interrupts disabled. */
+ bl .preempt_schedule_irq
mfmsr r10
clrrdi r9,r1,THREAD_SHIFT
rldicl r10,r10,48,1 /* disable interrupts again */
^ permalink raw reply
* Re: fsl booke MM vs. SMP questions
From: Dave Liu @ 2007-05-22 10:56 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: ppc-dev, Paul Mackerras, Kumar Gala
In-Reply-To: <1179803367.32247.785.camel@localhost.localdomain>
On Tue, 2007-05-22 at 13:09 +1000, Benjamin Herrenschmidt wrote:
> In the end, the best solution might still be to simply not do any of
> this and instead send an IPI on invalidations. That's the method used by
> most architectures in linux (if not all) that do software TLB load on
> SMP. Basically, the invalidate code path then does:
>
> - Update the linux PTE
> - write barrier
> - send IPI interrupt to all CPUs in mm->cpu_vm_mask
> - local TLB flush
>
> And the IPI does a local TLB flush on all affected CPUs.
How to avoid IPI interrupt missing if the IPI interrupt is edge-
triggered?
or How to make sure TLB flushed on the else all affected CPUs?
-d
^ permalink raw reply
* Re: [PPC] Remove duplicate export of __div64_32.
From: Paul Mackerras @ 2007-05-22 10:32 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0705170756500.4833@localhost.localdomain>
Kumar Gala writes:
> We now get the export of __div64_32 from lib/div64.c and can drop the one
> in ppc_ksysm.c
Great, but please remove the #include <asm/div64.h> as well.
Paul.
^ permalink raw reply
* Re: fsl booke MM vs. SMP questions
From: Benjamin Herrenschmidt @ 2007-05-22 10:05 UTC (permalink / raw)
To: Gabriel Paubert; +Cc: ppc-dev, Dave Liu, Paul Mackerras, Kumar Gala
In-Reply-To: <20070522100212.GA13225@iram.es>
On Tue, 2007-05-22 at 12:02 +0200, Gabriel Paubert wrote:
>
> Well, there should always be an stwcx. to clear reservation before
> any interrupt return. Otherwise you'll be able to cause hard to
> reproduce bugs in the interrupted code.
Well, that's the point. The BookE TLB refill exception is a very fast
path that doesn't use the normal interrupt return code path. It thus
needs to be careful about not leaving dangling reservations.
On some CPUs, there are also performance issues with leaving dangling
lwarx iirc but I don't have the details off the top of my mind.
Cheers,
Ben.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox