netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 03/39] net: sched: Use hrtimer_resolution instead of hrtimer_get_res()
       [not found] <20150414203303.702062272@linutronix.de>
@ 2015-04-14 21:08 ` Thomas Gleixner
  2015-04-16 16:04   ` David Miller
  2015-04-14 21:09 ` [patch 31/39] net: core: pktgen: Remove bogus hrtimer_active() check Thomas Gleixner
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2015-04-14 21:08 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Ingo Molnar, Preeti U Murthy, Viresh Kumar,
	Marcelo Tosatti, Frederic Weisbecker, Jamal Hadi Salim,
	David S. Miller, netdev

[-- Attachment #1: net-sched-use-hrtimer-resolution.patch --]
[-- Type: text/plain, Size: 984 bytes --]

No point in converting a timespec now that the value is directly
accessible.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---

@David: Depends on a previous patch in this series

 net/sched/sch_api.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Index: tip/net/sched/sch_api.c
===================================================================
--- tip.orig/net/sched/sch_api.c
+++ tip/net/sched/sch_api.c
@@ -1879,13 +1879,10 @@ EXPORT_SYMBOL(tcf_destroy_chain);
 #ifdef CONFIG_PROC_FS
 static int psched_show(struct seq_file *seq, void *v)
 {
-	struct timespec ts;
-
-	hrtimer_get_res(CLOCK_MONOTONIC, &ts);
 	seq_printf(seq, "%08x %08x %08x %08x\n",
 		   (u32)NSEC_PER_USEC, (u32)PSCHED_TICKS2NS(1),
 		   1000000,
-		   (u32)NSEC_PER_SEC/(u32)ktime_to_ns(timespec_to_ktime(ts)));
+		   (u32)NSEC_PER_SEC / hrtimer_resolution);
 
 	return 0;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 31/39] net: core: pktgen: Remove bogus hrtimer_active() check
       [not found] <20150414203303.702062272@linutronix.de>
  2015-04-14 21:08 ` [patch 03/39] net: sched: Use hrtimer_resolution instead of hrtimer_get_res() Thomas Gleixner
@ 2015-04-14 21:09 ` Thomas Gleixner
  2015-04-16 16:04   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2015-04-14 21:09 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Ingo Molnar, Preeti U Murthy, Viresh Kumar,
	Marcelo Tosatti, Frederic Weisbecker, David S. Miller, netdev

[-- Attachment #1: net-core-pktgen-remove-bogus-hrtimer-is-active-check.patch --]
[-- Type: text/plain, Size: 776 bytes --]

The check for hrtimer_active() after starting the timer is
pointless. If the timer is inactive it has expired already and
therefor the task pointer is already NULL.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
 net/core/pktgen.c |    2 --
 1 file changed, 2 deletions(-)

Index: tip/net/core/pktgen.c
===================================================================
--- tip.orig/net/core/pktgen.c
+++ tip/net/core/pktgen.c
@@ -2212,8 +2212,6 @@ static void spin(struct pktgen_dev *pkt_
 		do {
 			set_current_state(TASK_INTERRUPTIBLE);
 			hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS);
-			if (!hrtimer_active(&t.timer))
-				t.task = NULL;
 
 			if (likely(t.task))
 				schedule();

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 03/39] net: sched: Use hrtimer_resolution instead of hrtimer_get_res()
  2015-04-14 21:08 ` [patch 03/39] net: sched: Use hrtimer_resolution instead of hrtimer_get_res() Thomas Gleixner
@ 2015-04-16 16:04   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-04-16 16:04 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, peterz, mingo, preeti, viresh.kumar, mtosatt,
	fweisbec, jhs, netdev

From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 14 Apr 2015 21:08:28 -0000

> No point in converting a timespec now that the value is directly
> accessible.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 31/39] net: core: pktgen: Remove bogus hrtimer_active() check
  2015-04-14 21:09 ` [patch 31/39] net: core: pktgen: Remove bogus hrtimer_active() check Thomas Gleixner
@ 2015-04-16 16:04   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-04-16 16:04 UTC (permalink / raw)
  To: tglx
  Cc: linux-kernel, peterz, mingo, preeti, viresh.kumar, mtosatt,
	fweisbec, netdev

From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 14 Apr 2015 21:09:16 -0000

> The check for hrtimer_active() after starting the timer is
> pointless. If the timer is inactive it has expired already and
> therefor the task pointer is already NULL.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-16 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20150414203303.702062272@linutronix.de>
2015-04-14 21:08 ` [patch 03/39] net: sched: Use hrtimer_resolution instead of hrtimer_get_res() Thomas Gleixner
2015-04-16 16:04   ` David Miller
2015-04-14 21:09 ` [patch 31/39] net: core: pktgen: Remove bogus hrtimer_active() check Thomas Gleixner
2015-04-16 16:04   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).