dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

189383 Commits

Author SHA1 Message Date
Tom Zanussi b1dcc03cb8 perf/scripts: Tuple was set from long in both branches in python_process_event()
This is a fix to the signed/unsigned field handling in the
Python scripting engine, based on a patch from Roel Kluin.

Basically, Python wants to use a PyInt (which is internally a
long) if it can i.e. if the value will fit into that type.  If
not, it stores it into a PyLong, which isn't actually a long,
but an arbitrary-precision integer variable.

The code below is similar to to what Python does internally, and
it seems to work as expected on the x86 and x86_64 sytems I
tested it on.

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Roel Kluin <roel.kluin@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: rostedt@goodmis.org
LKML-Reference: <1270184305.6422.10.camel@tropicana>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-04-02 21:32:16 +02:00
Mike Galbraith 8bb39f9aa0 perf: Fix 'perf sched record' deadlock
perf sched record can deadlock a box should the holder of
handle->data->lock take an interrupt, and then attempt to
acquire an rq lock held by a CPU trying to acquire the
same lock. Disable interrupts.

   CPU0                            CPU1
   sched event with rq->lock held
                                   grab handle->data->lock
   spin on handle->data->lock
                                   interrupt
                                   try to grab rq->lock

Reported-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Tested-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1269598293.6174.8.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-04-02 19:30:05 +02:00
Torok Edwin 257ef9d21f perf, x86: Fix callgraphs of 32-bit processes on 64-bit kernels
When profiling a 32-bit process on a 64-bit kernel, callgraph tracing
stopped after the first function, because it has seen a garbage memory
address (tried to interpret the frame pointer, and return address as a
64-bit pointer).

Fix this by using a struct stack_frame with 32-bit pointers when the
TIF_IA32 flag is set.

Note that TIF_IA32 flag must be used, and not is_compat_task(), because
the latter is only set when the 32-bit process is executing a syscall,
which may not always be the case (when tracing page fault events for
example).

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: x86@kernel.org
Cc: linux-kernel@vger.kernel.org
LKML-Reference: <1268820436-13145-1-git-send-email-edwintorok@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-04-02 19:30:03 +02:00
Peter Zijlstra b38b24ead3 perf, x86: Fix AMD hotplug & constraint initialization
Commit 3f6da39 ("perf: Rework and fix the arch CPU-hotplug hooks") moved
the amd northbridge allocation from CPUS_ONLINE to CPUS_PREPARE_UP
however amd_nb_id() doesn't work yet on prepare so it would simply bail
basically reverting to a state where we do not properly track node wide
constraints - causing weird perf results.

Fix up the AMD NorthBridge initialization code by allocating from
CPU_UP_PREPARE and installing it from CPU_STARTING once we have the
proper nb_id. It also properly deals with the allocation failing.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
[ robustify using amd_has_nb() ]
Signed-off-by: Stephane Eranian <eranian@google.com>
LKML-Reference: <1269353485.5109.48.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-04-02 19:30:02 +02:00
Peter Zijlstra 8525702409 x86: Move notify_cpu_starting() callback to a later stage
Because we need to have cpu identification things done by the time we run
CPU_STARTING notifiers.

( This init ordering will be relied on by the next fix. )

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1269353485.5109.48.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-04-02 19:30:01 +02:00
Ingo Molnar 50d11d190a Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into perf/urgent 2010-04-02 19:29:17 +02:00
Linus Torvalds 42be79e37e Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (76 commits)
  drm/radeon/kms: enable ACPI powermanagement mode on radeon gpus.
  drm/radeon/kms: rs400/480 should set common registers.
  drm/radeon/kms: add sanity check to wptr.
  drm/radeon/kms/evergreen: get DP working
  drm/radeon/kms: add hw_i2c module option
  drm/radeon/kms: use new pre/post_xfer i2c bit algo hooks
  drm/radeon/kms: disable MSI on IGP chips
  drm/radeon/kms: display watermark updates (v2)
  drm/radeon/kms/dp: disable training pattern on the sink at the end of link training
  drm/radeon/kms: minor fixes for eDP with LCD* device tags (v2)
  drm/radeon/kms/dp: remove extraneous training complete call
  drm/radeon/kms/atom: minor fixes to transmitter setup
  drm/radeon/kms: Only restrict BO to visible VRAM size when pinning to VRAM.
  drm: fix build error when SYSRQ is disabled
  drm/radeon/kms: fix macbookpro connector quirk
  drm/radeon/r6xx/r7xx: further safe reg clean up
  drm/radeon: bump the UMS driver version for r6xx/r7xx const buffer support
  drm/radeon/kms: bump the version for r6xx/r7xx const buffer support
  drm/radeon/r6xx/r7xx: CS parser fixes
  drm/radeon/kms: fix some typos in r6xx/r7xx hpd setup
  ...

Fix up MSI-related conflicts in drivers/gpu/drm/radeon/radeon_irq_kms.c
2010-04-01 09:19:42 -07:00
Linus Torvalds 445c682b93 Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze
* 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze: (35 commits)
  microblaze: Support word copying in copy_tofrom_user
  microblaze: Print early printk information to log buffer
  microblaze: head.S typo fix
  microblaze: Use MICROBLAZE_TLB_SIZE in asm code
  microblaze: Kconfig Fix - pci
  microblaze: Adding likely macros
  microblaze: Add .type and .size to ASM functions
  microblaze: Fix TLB macros
  microblaze: Use instruction with delay slot
  microblaze: Remove additional resr and rear loading
  microblaze: Change register usage for ESR and EAR
  microblaze: Prepare work for optimization in exception code
  microblaze: Add DEBUG option
  microblaze: Support systems without lmb bram
  microblaze: uaccess: Sync strlen, strnlen, copy_to/from_user
  microblaze: uaccess: Unify __copy_tofrom_user
  microblaze: uaccess: Move functions to generic location
  microblaze: uaccess: Fix put_user for noMMU
  microblaze: uaccess: Fix get_user macro for noMMU
  microblaze: uaccess: fix clear_user for noMMU kernel
  ...
2010-04-01 09:14:20 -07:00
Linus Torvalds c7681f4637 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
  eeepc-wmi: new driver for WMI based hotkeys on Eee PC laptops
  asus-laptop: fix warning in asus_handle_init
2010-04-01 09:13:57 -07:00
Oleg Nesterov b95c35e76b oom: fix the unsafe usage of badness() in proc_oom_score()
proc_oom_score(task) has a reference to task_struct, but that is all.
If this task was already released before we take tasklist_lock

	- we can't use task->group_leader, it points to nowhere

	- it is not safe to call badness() even if this task is
	  ->group_leader, has_intersects_mems_allowed() assumes
	  it is safe to iterate over ->thread_group list.

	- even worse, badness() can hit ->signal == NULL

Add the pid_alive() check to ensure __unhash_process() was not called.

Also, use "task" instead of task->group_leader. badness() should return
the same result for any sub-thread. Currently this is not true, but
this should be changed anyway.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-04-01 08:50:21 -07:00
Michal Simek ca3865bae5 microblaze: Support word copying in copy_tofrom_user
Word copying is used only for aligned addresses.
Here is space for improving to use any better copying technique.
Look at memcpy implementation.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:25 +02:00
Michal Simek 6059b3cbeb microblaze: Print early printk information to log buffer
If early printk console is not enabled then all messages
are written to log buffer.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:25 +02:00
Michal Simek 3f21893586 microblaze: head.S typo fix
I forget to change register name in comments.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:24 +02:00
Michal Simek 0691c97d74 microblaze: Use MICROBLAZE_TLB_SIZE in asm code
TLB size was hardcoded in asm code. This patch brings ability
to change TLB size only in one place. (mmu.h).

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:24 +02:00
Michal Simek 9373dd6ab1 microblaze: Kconfig Fix - pci
I forget to remove pci Kconfig option.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:24 +02:00
Michal Simek 78ebfa884b microblaze: Adding likely macros
On the base on GCOV analytics is helpful to add likely/unlikely
macros.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:24 +02:00
Michal Simek 13851966da microblaze: Add .type and .size to ASM functions
Cachegrind analysis need this fix to be able to log asm functions.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:24 +02:00
Michal Simek e84452dd9f microblaze: Fix TLB macros
To be able to do trace TLB operations.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:24 +02:00
Michal Simek 3765d6958d microblaze: Use instruction with delay slot
Sync labels.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:23 +02:00
Michal Simek bd1637d63e microblaze: Remove additional resr and rear loading
RESR and REAR uses the same regs in whole file.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:23 +02:00
Michal Simek b175bcfe31 microblaze: Change register usage for ESR and EAR
This change synchronize register usage in code.
ESR = R4
EAR = R3

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:23 +02:00
Michal Simek 7a6bbdc930 microblaze: Prepare work for optimization in exception code
Any sync branch must follow mts instructions not mfs.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:23 +02:00
Michal Simek 708e7153d6 microblaze: Add DEBUG option
Disable debug option in asm code.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:23 +02:00
Michal Simek ee68f1745e microblaze: Support systems without lmb bram
When the system has no lmb bram, main memory should be start from
zero because of microblaze vectors.

DTS fragment could look like:
	DDR2_SDRAM: memory@0 {
		device_type = "memory";
		reg = < 0x0 0x10000000 >;
	} ;

Then you have to setup CONFIG_KERNEL_BASE_ADDR=0 which caused
that kernel physical start address will be zero. On reset vector place
will be jump to 0x100 and on 0x100 starts kernel text.

You have to solve how to load the kernel before cpu starts.
Tested with XMD.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:23 +02:00
Michal Simek 89ae9753ae microblaze: uaccess: Sync strlen, strnlen, copy_to/from_user
Last sync.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:23 +02:00
Michal Simek 94804a9b3d microblaze: uaccess: Unify __copy_tofrom_user
Move to generic location.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:22 +02:00
Michal Simek cca79120c2 microblaze: uaccess: Move functions to generic location
noMMU and MMU use them.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:22 +02:00
Michal Simek ef4e277b5d microblaze: uaccess: Fix put_user for noMMU
Here is small regression on dhrystone tests and I think
that on all benchmarking tests. It is due to better checking
mechanism in put_user macro

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:22 +02:00
Michal Simek 3a6d77245e microblaze: uaccess: Fix get_user macro for noMMU
Use unified version.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:22 +02:00
Michal Simek 527bdb52d5 microblaze: uaccess: fix clear_user for noMMU kernel
Previous patches fixed only MMU version and this is the first
patch for noMMU kernel

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:21 +02:00
Michal Simek 40e11e3380 microblaze: uaccess: Fix strncpy_from_user function
Generic implementation for noMMU and MMU version

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:21 +02:00
Michal Simek 4270690bd4 microblaze: uaccess: fix copy_from_user macro
copy_from_user macro also use copy_tofrom_user function

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:21 +02:00
Michal Simek cc5a428b7a microblaze: uaccess: copy_to_user unification
noMMU and MMU kernel will use copy copy_tofrom_user
asm implementation.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:20 +02:00
Michal Simek 0dcb409de7 microblaze: uaccess: sync put/get/clear_user macros
Add macro description and resort.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:20 +02:00
Michal Simek 8b651aa4a7 microblaze: uaccess: fix put_user and get_user macros
Use FIXUP macros and resort them.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:20 +02:00
Michal Simek c77a9c4bb7 microblaze: uaccess: fix __get_user_asm macro
It is used __FIXUP_SECTION and __EX_TABLE_SECTION macros.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:20 +02:00
Michal Simek 40b1156db0 microblaze: uaccess: fix clean user macro
This is the first patch which does uaccess unification.
I choosed to do several patches to be able to use bisect
in future if any fault happens.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:20 +02:00
Michal Simek 60a729f7bb microblaze: move noMMU __range_ok function to uaccess.h
The same noMMU and MMU functions should be placed in
one file.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:20 +02:00
Michal Simek 357bc3c928 microblaze: Move exception_table_entry upward
Just sort to be able remove whole block.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:19 +02:00
Michal Simek 40db083433 microblaze: Remove segment.h
I would like to use asm-generic uaccess.h where are segment
macros defined. This is just first step.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:19 +02:00
Michal Simek 4009819cf9 microblaze: Remove memset in free_init_pages
We don't need to do it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:19 +02:00
Arun Bhanu 6fa114e0f1 microblaze: Makefile cleanups
If CONFIG_INITRAMFS_SOURCE is set, "scripts/gen_initramfs_list.sh"
checks if the cpio image exists. Remove the duplicate check from the
Makefile.

Remove the "clean-kernel" variable which is unused in the Makefile and
is not used by the Kbuild.

Signed-off-by: Arun Bhanu <arun@bhanu.net>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:19 +02:00
Arun Bhanu 8a8804f1ab microblaze: Fix Makefile to delete build generated files
'make clean' does not to delete the following build generated file:
	arch/microblaze/boot/linux.bin.ub

'make mrproper' does not to delete the following build generated files:
	arch/microblaze/boot/simpleImage.*

Fix the Makefile to delete these build generated files.

See [1] for a discussion on why simpleImage.* files are deleted with 'make
mrproper' and not with 'make clean'.
	[1] http://lkml.org/lkml/2010/3/12/96

Signed-off-by: Arun Bhanu <arun@bhanu.net>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:19 +02:00
Arun Bhanu 699d17bc14 microblaze: Add a missing single quote to make 'make help' happy
'make ARCH=microblaze help' fails with the following error due to a
missing single quote.

/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [help] Error 2

Signed-off-by: Arun Bhanu <arun@bhanu.net>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:19 +02:00
Steven J. Magnani 0c4ec16b86 microblaze: Fix "kstack=" parsing
The "kstack=" command line parameter is not parsed correctly.
All proper values are interpreted as zero.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-04-01 08:38:18 +02:00
Jason Wessel ab310b5edb x86,kgdb: Always initialize the hw breakpoint attribute
It is required to call hw_breakpoint_init() on an attr before using it
in any other calls.  This fixes the problem where kgdb will sometimes
fail to initialize on x86_64.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: 2.6.33 <stable@kernel.org>
LKML-Reference: <1269975907-27602-1-git-send-email-jason.wessel@windriver.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2010-04-01 08:26:32 +02:00
Frederic Weisbecker e49a5bd381 perf: Use hot regs with software sched switch/migrate events
Scheduler's task migration events don't work because they always
pass NULL regs perf_sw_event(). The event hence gets filtered
in perf_swevent_add().

Scheduler's context switches events use task_pt_regs() to get
the context when the event occured which is a wrong thing to
do as this won't give us the place in the kernel where we went
to sleep but the place where we left userspace. The result is
even more wrong if we switch from a kernel thread.

Use the hot regs snapshot for both events as they belong to the
non-interrupt/exception based events family. Unlike page faults
or so that provide the regs matching the exact origin of the event,
we need to save the current context.

This makes the task migration event working and fix the context
switch callchains and origin ip.

Example: perf record -a -e cs

Before:

    10.91%      ksoftirqd/0                  0  [k] 0000000000000000
                |
                --- (nil)
                    perf_callchain
                    perf_prepare_sample
                    __perf_event_overflow
                    perf_swevent_overflow
                    perf_swevent_add
                    perf_swevent_ctx_event
                    do_perf_sw_event
                    __perf_sw_event
                    perf_event_task_sched_out
                    schedule
                    run_ksoftirqd
                    kthread
                    kernel_thread_helper

After:

    23.77%  hald-addon-stor  [kernel.kallsyms]  [k] schedule
            |
            --- schedule
               |
               |--60.00%-- schedule_timeout
               |          wait_for_common
               |          wait_for_completion
               |          blk_execute_rq
               |          scsi_execute
               |          scsi_execute_req
               |          sr_test_unit_ready
               |          |
               |          |--66.67%-- sr_media_change
               |          |          media_changed
               |          |          cdrom_media_changed
               |          |          sr_block_media_changed
               |          |          check_disk_change
               |          |          cdrom_open

v2: Always build perf_arch_fetch_caller_regs() now that software
events need that too. They don't need it from modules, unlike trace
events, so we keep the EXPORT_SYMBOL in trace_event_perf.c

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
2010-04-01 08:26:31 +02:00
Frederic Weisbecker eb1e79611c perf: Correctly align perf event tracing buffer
The trace event buffer used by perf to record raw sample events
is typed as an array of char and may then not be aligned to 8
by alloc_percpu().

But we need it to be aligned to 8 in sparc64 because we cast
this buffer into a random structure type built by the TRACE_EVENT()
macro to store the traces. So if a random 64 bits field is accessed
inside, it may be not under an expected good alignment.

Use an array of long instead to force the appropriate alignment, and
perform a compile time check to ensure the size in byte of the buffer
is a multiple of sizeof(long) so that its actual size doesn't get
shrinked under us.

This fixes unaligned accesses reported while using perf lock
in sparc 64.

Suggested-by: David Miller <davem@davemloft.net>
Suggested-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
2010-04-01 08:26:30 +02:00
Dave Airlie d668046c13 drm/radeon/kms: enable ACPI powermanagement mode on radeon gpus.
Some GPUs have an APM/ACPI PM mode selection switch and some BIOSes
set this to APM. We really want this in ACPI mode for Linux.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-01 12:50:46 +10:00
Dave Airlie 08a370fa75 drm/radeon/kms: rs400/480 should set common registers.
These GPUs should be setting these registers up also.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-04-01 12:50:28 +10:00