Re: [PATCH] perf util: optimize util/machine.c:machines__find().

2013-11-21 Thread Dongsheng Yang
On 11/21/2013 07:06 PM, Arnaldo Carvalho de Melo wrote: This changes machines__find to always return the machine for the host (pid == 0). This function is also used for VM lookups. Nope: /* Native host kernel uses -1 as pid index in machine */ #define HOST_KERNEL_ID (-1)

[PATCH] perf util: Join four conditions in two in perf_evlist__create_maps().

2013-11-27 Thread Dongsheng Yang
-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/util/evlist.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index bbc746a..2258eb4 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -819,11

Re: [PATCH] perf util: Join four conditions in two in perf_evlist__create_maps().

2013-11-27 Thread Dongsheng Yang
On 11/27/2013 04:43 AM, Adrian Hunter wrote: On 28/11/13 00:23, Dongsheng Yang wrote: There are four condition branchs in perf_evlist__create_maps, but they only do two kinds of thing. 1st and 4th call cpu_map__new(), and the others call cpu_map__dummy_new(). This patch joins them in two

Re: [PATCH] perf util: Join four conditions in two in perf_evlist__create_maps().

2013-11-27 Thread Dongsheng Yang
On 11/27/2013 05:49 AM, Adrian Hunter wrote: On 28/11/13 00:52, Dongsheng Yang wrote: On 11/27/2013 04:43 AM, Adrian Hunter wrote: On 28/11/13 00:23, Dongsheng Yang wrote: There are four condition branchs in perf_evlist__create_maps, but they only do two kinds of thing. 1st and 4th call

[PATCH] perf target: Move what map fucntion to call check into function.

2013-11-27 Thread Dongsheng Yang
Check for cpu_map__dummy_new() or cpu_map__new() to be called in perf_evlist__create_maps() is more complicated. This patch moves the checking work into target.h, combining two conditions and making perf_evlist__create_maps() more readable. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com

[PATCH] perf machine: Remove condition in machine__get_kernel_start_addr.

2013-11-28 Thread Dongsheng Yang
In machine__get_kernel_start_addr, the code, which is using machine-root_dir to build filename, works for both host and guests initialized from guestmount. So this patch remove the branch for machine__is_host. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/util/machine.c

Re: [PATCH] perf machine: Remove condition in machine__get_kernel_start_addr.

2013-11-28 Thread Dongsheng Yang
Sorry for the error patch :(, Please ignore it. On 11/28/2013 04:47 PM, Dongsheng Yang wrote: In machine__get_kernel_start_addr, the code, which is using machine-root_dir to build filename, works for both host and guests initialized from guestmount. So this patch remove the branch

Re: [PATCH] perf target: Move what map fucntion to call check into function.

2013-11-28 Thread Dongsheng Yang
I will resend the correct one. Sorry for the bother. On 11/28/2013 02:32 PM, Dongsheng Yang wrote: Check for cpu_map__dummy_new() or cpu_map__new() to be called in perf_evlist__create_maps() is more complicated. This patch moves the checking work into target.h, combining two conditions

[PATCH] perf machine: Remove condition in machine__get_kernel_start_addr.

2013-11-28 Thread Dongsheng Yang
In machine__get_kernel_start_addr, the code, which is using machine-root_dir to build filename, works for both host and guests initialized from guestmount. So this patch remove the branch for machine__is_host. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/util/machine.c

[PATCH] perf machine: Remove condition in machine__get_kernel_start_addr.

2013-11-28 Thread Dongsheng Yang
In machine__get_kernel_start_addr, the code, which is using machine-root_dir to build filename, works for both host and guests initialized from guestmount. So this patch remove the branch for machine__is_host. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/util/machine.c

Re: [PATCH] perf Makefile: Correct the message in feature-libnuma checking.

2013-12-01 Thread Dongsheng Yang
ccing linux-kernel@vger.kernel.org On 11/29/2013 01:14 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Nov 29, 2013 at 04:05:52PM -0500, Dongsheng Yang escreveu: The package required for numa is named numactl-devel in Fedora and RHEL and libnuma-devel in OpenSuSE. This patch correct the package

Re: [PATCH] perf Makefile: Correct the message in feature-libnuma checking.

2013-12-01 Thread Dongsheng Yang
On 12/01/2013 08:33 PM, Peter Hurley wrote: On 12/02/2013 09:11 AM, Dongsheng Yang wrote: ccing linux-kernel@vger.kernel.org On 11/29/2013 01:14 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Nov 29, 2013 at 04:05:52PM -0500, Dongsheng Yang escreveu: The package required for numa is named

[PATCH V2] perf Makefile: Correct the message in feature-libnuma checking.

2013-12-01 Thread Dongsheng Yang
The package required for numa is named numactl-devel in Fedora or RHEL, and libnuma-devel in OpenSuSE, and libnuma-dev in Ubuntu. This patch corrects the package name in warning message in feature-libnuma checking. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- Changes since v1

[PATCH] perf kvm record: Change the default value of perf_guest to 0.

2013-11-14 Thread Dongsheng Yang
- perf.data.host * --guest- perf.data.guest * --host --guest - perf.data.kvm Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/builtin-kvm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin

[PATCH] perf kvm record: Change the default value of perf_guest to 0.

2013-11-14 Thread Dongsheng Yang
- perf.data.host * --guest- perf.data.guest * --host --guest - perf.data.kvm Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/builtin-kvm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin

Re: [PATCH] perf kvm record: Change the default value of perf_guest to 0.

2013-11-14 Thread Dongsheng Yang
Hi David: On 11/14/2013 03:38 PM, David Ahern wrote: On 11/14/13, 2:51 PM, Dongsheng Yang wrote: Currently, we can not record the event counters of host to perf.data.host. Example: perf kvm --host record -a sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured

[PATCH 0/5] perf tools: some update for perf tool.

2013-12-04 Thread Dongsheng Yang
. If you think it is not necessary, I am ok to squash them into one commit. Thanx Yang Dongsheng Yang (5): perf tools: Remove condition in machine__get_kernel_start_addr. perf tools: Move the checking of which map function to call into function. perf tools: Update the Document for perf

[PATCH 5/5] perf tool: Fix a type of '=' in Document of perf-kvm.

2013-12-04 Thread Dongsheng Yang
-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/Documentation/perf-kvm.txt | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/Documentation/perf-kvm.txt b/tools/perf/Documentation/perf-kvm.txt index be1d263..96a9a1d 100644 --- a/tools/perf

[PATCH 4/5] perf tools: Add more detail about buildid-list in Document of perf-kvm.

2013-12-04 Thread Dongsheng Yang
. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/Documentation/perf-kvm.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-kvm.txt b/tools/perf/Documentation/perf-kvm.txt index 830613a..be1d263 100644 --- a/tools/perf

[PATCH 1/5] perf tools: Remove condition in machine__get_kernel_start_addr.

2013-12-04 Thread Dongsheng Yang
In machine__get_kernel_start_addr, the code, which is using machine-root_dir to build filename, works for both host and guests initialized from guestmount. So this patch remove the branch for machine__is_host. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/util/machine.c

[PATCH 3/5] perf tools: Update the Document for perf kvm record for new behavior.

2013-12-04 Thread Dongsheng Yang
As we have changed the default behavior of perf kvm to --guest enabled, the document about perf kvm record is outdated. This patch update it to show the correct output with --host/--guest/neither/both of them. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/Documentation

[PATCH 2/5] perf tools: Move the checking of which map function to call into function.

2013-12-04 Thread Dongsheng Yang
Check for cpu_map__dummy_new() or cpu_map__new() to be called in perf_evlist__create_maps() is more complicated. This patch moves the checking work into target.h, combining two conditions and making perf_evlist__create_maps() more readable. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com

Re: [PATCH 3/5] perf tools: Update the Document for perf kvm record for new behavior.

2013-12-05 Thread Dongsheng Yang
On 12/04/2013 09:27 AM, Arnaldo Carvalho de Melo wrote: Em Wed, Dec 04, 2013 at 05:56:41PM -0500, Dongsheng Yang escreveu: As we have changed the default behavior of perf kvm to --guest enabled, the document about perf kvm record is outdated. This patch update it to show the correct output

[PATCH] perf tools: Fix bug for perf kvm report without guestmount.

2013-12-06 Thread Dongsheng Yang
] scheduler_tick 1.75%:6471 [guest.kernel.kallsyms] [g] native_apic_mem_write 0.21%:6471 [guest.kernel.kallsyms] [g] apic_timer_interrupt Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/util/session.c | 7 ++- 1 file changed, 6 insertions(+), 1

[PATCH 3/3] perf tools: Change the default filenames for perf kvm diff to perf.data.xxx and perf.data.xxx.old

2013-12-06 Thread Dongsheng Yang
. This patch remove the hard coding of default filenames in builtin-diff.c, and generate the suitable filename from current options in perf kvm diff command. It makes the default behavior of perf kvm diff be more valuable. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/builtin

[PATCH 2/3] perf tools: Make perf kvm diff support --guestmount.

2013-12-06 Thread Dongsheng Yang
In manpage of perf-kvm, --guestmount is supported by diff command, but it does not work well. This patch change the extend the checking in buildid-diff from guestkallsyms or guestmodules to perf_guest. Then this checking can cover the all cases perf kvm is used for. Signed-off-by: Dongsheng Yang

[PATCH 1/3] perf tools: Move code to generate filename for perf-kvm to function.

2013-12-06 Thread Dongsheng Yang
The code in builtin-kvm.c to generate filename for perf-kvm is useful to other command such as builtin-diff. This patch move the related code form builtin-kvm.c to util/util.c and wrap them in a function named get_filename_for_perf_kvm. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com

[PATCH] perf tools: Correct the message in feature-dwarf Checking

2014-03-18 Thread Dongsheng Yang
The package required for dwarf is named libdwarf-devel, rather than elfutils-devel. This patch corrects the package name in warning message in feature-dwarf checking. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/perf/config/Makefile | 4 ++-- 1 file changed, 2 insertions

Re: [PATCH] perf tools: Correct the message in feature-dwarf Checking

2014-03-18 Thread Dongsheng Yang
Hi Arnaldo, Sorry for the noise, please ignore this patch. On 03/18/2014 05:12 PM, Dongsheng Yang wrote: The package required for dwarf is named libdwarf-devel, rather than elfutils-devel. This patch corrects the package name in warning message in feature-dwarf checking. Signed-off

Re: [PATCH 9/9] trace: Replace hardcoding of 19 with MAX_NICE.

2014-02-22 Thread Dongsheng Yang
Hi Peter. It seems the all other patches in this set were all applied to tip except this one. What is the problem with the [9/9]? Is there any thing I can do? Thanx On 02/11/2014 03:34 PM, Dongsheng Yang wrote: Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Steven Rostedt

Re: [PATCH 9/9] trace: Replace hardcoding of 19 with MAX_NICE.

2014-02-24 Thread Dongsheng Yang
On 02/24/2014 06:46 PM, Peter Zijlstra wrote: On Sat, Feb 22, 2014 at 05:05:36PM +0800, Dongsheng Yang wrote: Hi Peter. It seems the all other patches in this set were all applied to tip except this one. What is the problem with the [9/9]? Is there any thing I can do? The problem

[PATCH Resend] trace: Replace hardcoding of 19 with MAX_NICE.

2014-02-24 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Steven Rostedt rost...@goodmis.org cc: Frederic Weisbecker fweis...@gmail.com cc: Ingo Molnar mi...@redhat.com cc: Peter Zijlstra pet...@infradead.org --- kernel/trace/ring_buffer_benchmark.c | 6 +++--- 1 file changed, 3 insertions

[PATCH tip] perf/x86/uncore: Add __init for uncore_cpumask_init().

2014-03-05 Thread Dongsheng Yang
() function. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Peter Zijlstra a.p.zijls...@chello.nl cc: Paul Mackerras pau...@samba.org cc: Ingo Molnar mi...@redhat.com cc: Arnaldo Carvalho de Melo a...@ghostprotocols.net cc: Thomas Gleixner t...@linutronix.de cc: H. Peter Anvin h

[PATCH 2/3] sched: Use clamp() and clamp_val() to make it more readable.

2014-03-05 Thread Dongsheng Yang
As Kees suggested, I use clamp() function to replace the if and else branch, making it more readable and modular. Suggested-by: Kees Cook keesc...@chromium.org Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/sched/core.c | 11 ++- 1 file changed, 2 insertions(+), 9

[PATCH 3/3] sched/prio: Replace hardcoding of 40 with NICE_WIDTH.

2014-03-05 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5273037..7ed08ad 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3070,7 +3070,7

[PATCH 1/3] tracing: Use inline task_nice() to get rid of an open coded implementation of it.

2014-03-05 Thread Dongsheng Yang
Function task_nice() was reimplemented as inline function, we can use it here to replace the open coded implementation. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Steven Rostedt rost...@goodmis.org --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH] kernel/sys: Replace hardcoding of 20 with MAX_NICE + 1

2014-03-10 Thread Dongsheng Yang
Hi Joe, On 03/11/2014 06:23 AM, Joe Perches wrote: Convert the use of 20 to NICE_MAX + 1. What about adding a macro in prio.h to convert nice value [19,-20] to rlimit style value [1,40]? It seems that it will be used in several places. - Dongsheng Reduce the indent the switch case

Re: [PATCH] kernel/sys: Replace hardcoding of 20 with MAX_NICE + 1

2014-03-10 Thread Dongsheng Yang
On 03/11/2014 10:21 AM, Joe Perches wrote: On Tue, 2014-03-11 at 09:17 +0800, Dongsheng Yang wrote: Hi Joe, On 03/11/2014 06:23 AM, Joe Perches wrote: Convert the use of 20 to NICE_MAX + 1. What about adding a macro in prio.h to convert nice value [19,-20] to rlimit style value [1,40

[PATCH 00/15] A series patch for priority.

2014-03-10 Thread Dongsheng Yang
[-20, 19] to io priority [0, 7]. 3. Others are all about replace hardcoding value about nice to MIN_NICE or MAX_NICE. Dongsheng Yang (14): sched/prio: Add a macro named NICE_TO_RLIMIT in prio.h. workqueue: Replace hardcoding of -20 with MIN_NICE. locktorture: Replace hardcoding of 19

[PATCH 04/15] locktorture: Replace hardcoding of 19 with MAX_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/locking/locktorture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index f26b1a1..23343be 100644 --- a/kernel/locking/locktorture.c +++ b/kernel

[PATCH 09/15] driver/block: Replace hardcoding of -20 with MIN_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: nbd-gene...@lists.sourceforge.net cc: Wei Yongjun yongjun_...@trendmicro.com.cn cc: Tejun Heo t...@kernel.org --- drivers/block/loop.c| 2 +- drivers/block/nbd.c | 2 +- drivers/block/pktcdvd.c | 2 +- 3 files changed, 3

[PATCH 15/15] driver/scsi: Replace hardcoding of 20 with MIN_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: fcoe-de...@open-fcoe.org cc: James Smart james.sm...@emulex.com cc: Robert Jennings r...@linux.vnet.ibm.com cc: Robert Love robert.w.l...@intel.com --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 4 ++-- drivers/scsi/bnx2i/bnx2i_hwi.c| 2

[PATCH 11/15] drivers/s390: Replace hardcoding of 19 with MAX_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: linux-s...@vger.kernel.org cc: Heiko Carstens heiko.carst...@de.ibm.com cc: Martin Schwidefsky schwidef...@de.ibm.com cc: Ingo Tuchscherer ingo.tuchsche...@de.ibm.com --- drivers/s390/crypto/ap_bus.c | 2 +- 1 file changed, 1 insertion

[PATCH 02/15] kernel/sys: Replace opened code implementation with NICE_TO_RLIMIT macro.

2014-03-10 Thread Dongsheng Yang
void k_getrusage(struct task_struct *p, int who, struct rusage *r) - + /* fall-through */ Signed-off-by: Joe Perches j...@perches.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Eric W. Biederman ebied...@xmission.com cc: Robin Holt h...@sgi.com cc: Oleg Nesterov o

[PATCH 06/15] mm: Replace hardcoding of 19 with MAX_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: linux...@kvack.org cc: Bob Liu lliu...@gmail.com cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com cc: Kirill A. Shutemov kirill.shute...@linux.intel.com cc: Mel Gorman mgor...@suse.de cc: Rik van Riel r...@redhat.com cc: Andrew

[PATCH 14/15] driver/staging/lustre: Replace hardcoding of -20 with MIN_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: de...@driverdev.osuosl.org cc: Xiong Zhou jencce.ker...@gmail.com cc: Andreas Dilger andreas.dil...@intel.com cc: Cyril Roelandt tipec...@gmail.com cc: Kent Overstreet k...@daterainc.com cc: Peng Tao bergw...@gmail.com --- drivers

[PATCH 12/15] driver/staging/android: Use RLIMIT_TO_NICE to replace opened code implementation.

2014-03-10 Thread Dongsheng Yang
There is a macro RLINIT_TO_NICE in linux/sched/prio.h to convert priority in rlimit to nice value. This patch replace the opened implementation with RLINIT_TO_NICE. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: de...@driverdev.osuosl.org cc: Masanari Iida standby2...@gmail.com cc

[PATCH 10/15] driver/char: Replace hardcoding of 19 with MAX_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: openipmi-develo...@lists.sourceforge.net cc: Corey Minyard miny...@acm.org --- drivers/char/ipmi/ipmi_si_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi

[PATCH 05/15] tools/mq_perf_tests: Replace hardcoding of -20 with MIN_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/testing/selftests/mqueue/mq_perf_tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c b/tools/testing/selftests/mqueue/mq_perf_tests.c index 2fadd4b

[PATCH 13/15] sched/prio: Add a macro named RLIMIT_TO_NICE in prio.h.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- include/linux/sched/prio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/sched/prio.h b/include/linux/sched/prio.h index 8e78c47..e34bf0a 100644 --- a/include/linux/sched/prio.h +++ b/include/linux/sched/prio.h

[PATCH 08/15] fs/hearbeat: Replace hardcoding of -20 with MIN_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: ocfs2-de...@oss.oracle.com cc: Dong Fang yp.fangd...@gmail.com --- fs/ocfs2/cluster/heartbeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index

[PATCH 03/15] workqueue: Replace hardcoding of -20 with MIN_NICE.

2014-03-10 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Tejun Heo t...@kernel.org --- kernel/workqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 3fa5b8f..7528bec 100644 --- a/kernel/workqueue.c +++ b/kernel

[PATCH 07/15] ioprio: Add a macro named NICE_TO_IOPRIO.

2014-03-10 Thread Dongsheng Yang
-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- include/linux/ioprio.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index beb9ce1..0164584 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h @@ -18,6 +18,11

[PATCH 01/15] sched/prio: Add a macro named NICE_TO_RLIMIT in prio.h.

2014-03-10 Thread Dongsheng Yang
This patch add a macro named NICE_TO_RLIMIT in prio.h to convert nice value [19,-20] to rlimit style value [1,40]. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- include/linux/sched/prio.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/sched/prio.h b/include

Re: [PATCH 1/3] tracing: Use inline task_nice() to get rid of an open coded implementation of it.

2014-03-10 Thread Dongsheng Yang
Hi steve, Could you take these three patches if they looks fine to you?? Thanx On 03/05/2014 08:36 PM, Dongsheng Yang wrote: Function task_nice() was reimplemented as inline function, we can use it here to replace the open coded implementation. Signed-off-by: Dongsheng Yang yangds.f

[PATCH for-tip V2] perf/x86/uncore: Add __init for uncore_cpumask_init().

2014-03-10 Thread Dongsheng Yang
() is only called by __init intel_uncore_init(), then we can free it after system initialization. This patch add __init for uncore_cpumask_init() function. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com Acked-by: Stephane Eranian eran...@google.com --- Changlogs: -v1: Add

Re: [PATCH 01/15] sched/prio: Add a macro named NICE_TO_RLIMIT in prio.h.

2014-03-11 Thread Dongsheng Yang
On 03/11/2014 04:17 PM, Heiko Carstens wrote: On Tue, Mar 11, 2014 at 12:59:16PM +0800, Dongsheng Yang wrote: This patch add a macro named NICE_TO_RLIMIT in prio.h to convert nice value [19,-20] to rlimit style value [1,40]. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com

Re: [PATCH 01/15] sched/prio: Add a macro named NICE_TO_RLIMIT in prio.h.

2014-03-11 Thread Dongsheng Yang
On 03/11/2014 04:36 PM, Heiko Carstens wrote: On Tue, Mar 11, 2014 at 04:20:24PM +0800, Dongsheng Yang wrote: On 03/11/2014 04:17 PM, Heiko Carstens wrote: On Tue, Mar 11, 2014 at 12:59:16PM +0800, Dongsheng Yang wrote: +#define NICE_TO_RLIMIT(nice) (MAX_NICE - nice + 1) Where is MAX_NICE

[PATCH 14/16] driver/staging/lustre: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: de...@driverdev.osuosl.org cc: Xiong Zhou jencce.ker...@gmail.com cc: Andreas Dilger andreas.dil...@intel.com cc: Cyril Roelandt tipec...@gmail.com cc: Kent Overstreet k...@daterainc.com cc: Peng Tao bergw...@gmail.com --- drivers

[PATCH 03/16] workqueue: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Tejun Heo t...@kernel.org --- kernel/workqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 3fa5b8f..7528bec 100644 --- a/kernel/workqueue.c +++ b/kernel

[PATCH 07/16] ioprio: Add a macro named NICE_TO_IOPRIO.

2014-03-11 Thread Dongsheng Yang
-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- include/linux/ioprio.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index beb9ce1..c0faa0b 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h @@ -18,6 +18,11

[PATCH 08/16] fs/hearbeat: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: ocfs2-de...@oss.oracle.com cc: Dong Fang yp.fangd...@gmail.com --- fs/ocfs2/cluster/heartbeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index

[PATCH 13/16] driver/staging/android: Use rlimit_to_nice to replace opened code implementation.

2014-03-11 Thread Dongsheng Yang
There is a macro rlimit_to_nice in linux/sched/prio.h to convert priority in rlimit to nice value. This patch replace the opened implementation with rlimit_to_nice. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: de...@driverdev.osuosl.org cc: Masanari Iida standby2...@gmail.com cc

[PATCH 11/16] drivers/s390: Replace hardcoding of 19 with MAX_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: linux-s...@vger.kernel.org cc: Heiko Carstens heiko.carst...@de.ibm.com cc: Martin Schwidefsky schwidef...@de.ibm.com cc: Ingo Tuchscherer ingo.tuchsche...@de.ibm.com --- drivers/s390/crypto/ap_bus.c | 2 +- 1 file changed, 1 insertion

[PATCH 06/16] mm: Replace hardcoding of 19 with MAX_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: linux...@kvack.org cc: Bob Liu lliu...@gmail.com cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com cc: Kirill A. Shutemov kirill.shute...@linux.intel.com cc: Mel Gorman mgor...@suse.de cc: Rik van Riel r...@redhat.com cc: Andrew

[PATCH 10/16] driver/char: Replace hardcoding of 19 with MAX_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: openipmi-develo...@lists.sourceforge.net cc: Corey Minyard miny...@acm.org --- drivers/char/ipmi/ipmi_si_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi

[PATCH 15/16] driver/scsi: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: fcoe-de...@open-fcoe.org cc: James Smart james.sm...@emulex.com cc: Robert Jennings r...@linux.vnet.ibm.com cc: Robert Love robert.w.l...@intel.com --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 4 ++-- drivers/scsi/bnx2i/bnx2i_hwi.c| 2

[PATCH 16/16] sched: Get rid of opened code implementation of funtion nice_to_rlimit().

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ee8004c..d2735eb 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3046,7 +3046,7

[PATCH 12/16] sched/prio: Add an inline function named rlimit_to_nice in prio.h.

2014-03-11 Thread Dongsheng Yang
This patch add an inline function named rlimit_to_nice to convert rlimit style value in [1, 40] to nice value in [-20, 19]. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- include/linux/sched/prio.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/sched

[PATCH 09/16] driver/block: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: nbd-gene...@lists.sourceforge.net cc: Wei Yongjun yongjun_...@trendmicro.com.cn cc: Tejun Heo t...@kernel.org --- drivers/block/loop.c| 2 +- drivers/block/nbd.c | 2 +- drivers/block/pktcdvd.c | 2 +- 3 files changed, 3

[PATCH 04/16] locktorture: Replace hardcoding of 19 with MAX_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/locking/locktorture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index f26b1a1..23343be 100644 --- a/kernel/locking/locktorture.c +++ b/kernel

[PATCH 01/16] sched/prio: Add a inline function named nice_to_rlimit() in prio.h.

2014-03-11 Thread Dongsheng Yang
This patch add an inline function named nice_to_rlimit() in prio.h to convert nice value [19,-20] to rlimit style value [1,40]. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- include/linux/sched/prio.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/sched

[PATCH 02/16] kernel/sys: Replace opened code implementation with nice_to_rlimit().

2014-03-11 Thread Dongsheng Yang
void k_getrusage(struct task_struct *p, int who, struct rusage *r) - + /* fall-through */ Signed-off-by: Joe Perches j...@perches.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Eric W. Biederman ebied...@xmission.com cc: Robin Holt h...@sgi.com cc: Oleg Nesterov o

[PATCH 05/16] tools/mq_perf_tests: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/testing/selftests/mqueue/mq_perf_tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c b/tools/testing/selftests/mqueue/mq_perf_tests.c index 2fadd4b

[PATCH 00/16 for-tip V2] A series patches about sched priority.

2014-03-11 Thread Dongsheng Yang
opened code implement with nice_to_rlimit(). Dongsheng Yang (15): sched/prio: Add a inline function named nice_to_rlimit() in prio.h. workqueue: Replace hardcoding of -20 with MIN_NICE. locktorture: Replace hardcoding of 19 with MAX_NICE. tools/mq_perf_tests: Replace hardcoding of -20

Re: [PATCH 02/16] kernel/sys: Replace opened code implementation with nice_to_rlimit().

2014-03-11 Thread Dongsheng Yang
On 03/11/2014 05:26 PM, Peter Zijlstra wrote: On Tue, Mar 11, 2014 at 05:20:23PM +0800, Dongsheng Yang wrote: From: Joe Perches j...@perches.com Convert 20 - task_nice(p) to nice_to_rlimit(task_nice(p)). Reduce the indent the switch case labels while there. git diff -w shows 3 lines changed

Re: [PATCH 07/16] ioprio: Add a macro named NICE_TO_IOPRIO.

2014-03-11 Thread Dongsheng Yang
On 03/11/2014 05:28 PM, Peter Zijlstra wrote: On Tue, Mar 11, 2014 at 05:20:28PM +0800, Dongsheng Yang wrote: As the task nice value is in [-20, 19] and the io priority is in [0, 7], and the convert method from niceval to ioprio is implemented with an opened code in task_nice_ioprio

[PATCH] kernel/sys: Fix the indent issue in switch.

2014-03-11 Thread Dongsheng Yang
From: Joe Perches j...@perches.com Fix the indent issue and add a comment line for /* fall-through */. Signed-off-by: Joe Perches j...@perches.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/sys.c | 204 +-- 1 file

Re: [PATCH] kernel/sys: Fix the indent issue in switch.

2014-03-11 Thread Dongsheng Yang
Peter, Sorry for the noise, I should add this patch into my thread 'A series patchse about sched priority', as some patch depends on this patch. Otherwise, there will be a conflict. Thanx., On 03/11/2014 05:44 PM, Dongsheng Yang wrote: From: Joe Perches j...@perches.com Fix

[PATCH 15/17] driver/staging/lustre: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: de...@driverdev.osuosl.org cc: Xiong Zhou jencce.ker...@gmail.com cc: Andreas Dilger andreas.dil...@intel.com cc: Cyril Roelandt tipec...@gmail.com cc: Kent Overstreet k...@daterainc.com cc: Peng Tao bergw...@gmail.com --- drivers

[PATCH 16/17] driver/scsi: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: fcoe-de...@open-fcoe.org cc: James Smart james.sm...@emulex.com cc: Robert Jennings r...@linux.vnet.ibm.com cc: Robert Love robert.w.l...@intel.com --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 4 ++-- drivers/scsi/bnx2i/bnx2i_hwi.c| 2

[PATCH 12/17] drivers/s390: Replace hardcoding of 19 with MAX_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: linux-s...@vger.kernel.org cc: Heiko Carstens heiko.carst...@de.ibm.com cc: Martin Schwidefsky schwidef...@de.ibm.com cc: Ingo Tuchscherer ingo.tuchsche...@de.ibm.com --- drivers/s390/crypto/ap_bus.c | 2 +- 1 file changed, 1 insertion

[PATCH 07/17] mm: Replace hardcoding of 19 with MAX_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: linux...@kvack.org cc: Bob Liu lliu...@gmail.com cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com cc: Kirill A. Shutemov kirill.shute...@linux.intel.com cc: Mel Gorman mgor...@suse.de cc: Rik van Riel r...@redhat.com cc: Andrew

[PATCH 14/17] driver/staging/android: Use rlimit_to_nice to replace opened code implementation.

2014-03-11 Thread Dongsheng Yang
There is a macro rlimit_to_nice in linux/sched/prio.h to convert priority in rlimit to nice value. This patch replace the opened implementation with rlimit_to_nice. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: de...@driverdev.osuosl.org cc: Masanari Iida standby2...@gmail.com cc

[PATCH 10/17] driver/block: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: nbd-gene...@lists.sourceforge.net cc: Wei Yongjun yongjun_...@trendmicro.com.cn cc: Tejun Heo t...@kernel.org --- drivers/block/loop.c| 2 +- drivers/block/nbd.c | 2 +- drivers/block/pktcdvd.c | 2 +- 3 files changed, 3

[PATCH 17/17] sched: Get rid of opened code implementation of funtion nice_to_rlimit().

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index ee8004c..d2735eb 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3046,7 +3046,7

[PATCH 11/17] driver/char: Replace hardcoding of 19 with MAX_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: openipmi-develo...@lists.sourceforge.net cc: Corey Minyard miny...@acm.org --- drivers/char/ipmi/ipmi_si_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi

[PATCH 09/17] fs/hearbeat: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: ocfs2-de...@oss.oracle.com cc: Dong Fang yp.fangd...@gmail.com --- fs/ocfs2/cluster/heartbeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index

[PATCH 13/17] sched/prio: Add an inline function named rlimit_to_nice in prio.h.

2014-03-11 Thread Dongsheng Yang
This patch add an inline function named rlimit_to_nice to convert rlimit style value in [1, 40] to nice value in [-20, 19]. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- include/linux/sched/prio.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/sched

[PATCH 02/17] kernel/sys: Fix the indent issue in switch.

2014-03-11 Thread Dongsheng Yang
From: Joe Perches j...@perches.com Fix the indent issue and add a comment line for /* fall-through */. Signed-off-by: Joe Perches j...@perches.com Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/sys.c | 204 +-- 1 file

[PATCH 03/17] kernel/sys: Replace opened code implementation with nice_to_rlimit().

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/sys.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 61a2ae9..1bfe79a 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -250,7 +250,7 @@ SYSCALL_DEFINE2(getpriority, int

[PATCH 05/17] locktorture: Replace hardcoding of 19 with MAX_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- kernel/locking/locktorture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index f26b1a1..23343be 100644 --- a/kernel/locking/locktorture.c +++ b/kernel

[PATCH 08/17] ioprio: Add a macro named NICE_TO_IOPRIO.

2014-03-11 Thread Dongsheng Yang
-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- include/linux/ioprio.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h index beb9ce1..c0faa0b 100644 --- a/include/linux/ioprio.h +++ b/include/linux/ioprio.h @@ -18,6 +18,11

[PATCH 04/17] workqueue: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Tejun Heo t...@kernel.org --- kernel/workqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 3fa5b8f..7528bec 100644 --- a/kernel/workqueue.c +++ b/kernel

[PATCH 06/17] tools/mq_perf_tests: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- tools/testing/selftests/mqueue/mq_perf_tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c b/tools/testing/selftests/mqueue/mq_perf_tests.c index 2fadd4b

[PATCH 00/17 for-tip V3] A series patches about sched priority.

2014-03-11 Thread Dongsheng Yang
: *Implement nice_to_rlimit and rlimit_to_nice with inline functions rather than macro. *Add a patch[16/16] to replace opened code implement with nice_to_rlimit(). Dongsheng Yang (16): sched/prio: Add a inline function named nice_to_rlimit() in prio.h. kernel/sys

[PATCH 01/17] sched/prio: Add a inline function named nice_to_rlimit() in prio.h.

2014-03-11 Thread Dongsheng Yang
This patch add an inline function named nice_to_rlimit() in prio.h to convert nice value [19,-20] to rlimit style value [1,40]. Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com --- include/linux/sched/prio.h | 8 1 file changed, 8 insertions(+) diff --git a/include/linux/sched

Re: [PATCH 04/17] workqueue: Replace hardcoding of -20 with MIN_NICE.

2014-03-11 Thread Dongsheng Yang
Hi Tejun, On 03/11/2014 08:55 PM, Tejun Heo wrote: On Tue, Mar 11, 2014 at 08:22:25AM -0400, Tejun Heo wrote: On Tue, Mar 11, 2014 at 06:09:12PM +0800, Dongsheng Yang wrote: Signed-off-by: Dongsheng Yang yangds.f...@cn.fujitsu.com cc: Tejun Heo t...@kernel.org Applied to wq/for-3.15

[PATCH 0/3 for-tip] use task_nice() in tracing to git rid of an open coded impolementation of it.

2014-03-12 Thread Dongsheng Yang
, please take a look at the other patches in this thread. Thank you. Dongsheng Yang (3): tracing: Use inline task_nice() to get rid of an open coded implementation of it. sched/prio: Replace hardcoding of 40 with NICE_WIDTH. sched: Use clamp() and clamp_val() to make it more readable

Re: [PATCH 08/17] ioprio: Add a macro named NICE_TO_IOPRIO.

2014-03-12 Thread Dongsheng Yang
On 03/11/2014 06:09 PM, Dongsheng Yang wrote: As the task nice value is in [-20, 19] and the io priority is in [0, 7], and the convert method from niceval to ioprio is implemented with an opened code in task_nice_ioprio(). This patch move the implementation to a macro NICE_TO_IOPRIO, making

  1   2   3   4   5   6   7   8   >