linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RT 4/5] allow preemption in mem_cgroup_move_account_page_stat
@ 2014-02-10 15:39 Nicholas Mc Guire
  2014-02-14 13:09 ` Sebastian Andrzej Siewior
  2014-02-14 13:17 ` Sebastian Andrzej Siewior
  0 siblings, 2 replies; 5+ messages in thread
From: Nicholas Mc Guire @ 2014-02-10 15:39 UTC (permalink / raw)
  To: linux-rt-users
  Cc: LKML, Sebastian Andrzej Siewior, Steven Rostedt, Peter Zijlstra,
	Carsten Emde, Thomas Gleixner, Andreas Platschek


allow preemption in mem_cgroup_move_account_page_stat

as the call sites of mem_cgroup_move_account_page_stat are under 
move_lock_mem_cgroup move_unlock_mem_cgroup (spin_lock_irqsave/
spin_unlock_irqrestore respectively) the move operations 
preempt_disable/enable seem to be purely for migration protection so 
a migrate_disable/enable should be fine here.

patch on top of 3.12.10-rt15

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---
 mm/memcontrol.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index a67e630f..e7cc35a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3784,10 +3784,10 @@ void mem_cgroup_move_account_page_stat(struct mem_cgroup *from,
 					enum mem_cgroup_stat_index idx)
 {
 	/* Update stat data for mem_cgroup */
-	preempt_disable();
+	migrate_disable();
 	__this_cpu_sub(from->stat->count[idx], nr_pages);
 	__this_cpu_add(to->stat->count[idx], nr_pages);
-	preempt_enable();
+	migrate_enable();
 }
 
 /**
-- 
1.7.2.5

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

* Re: [PATCH RT 4/5] allow preemption in mem_cgroup_move_account_page_stat
  2014-02-10 15:39 [PATCH RT 4/5] allow preemption in mem_cgroup_move_account_page_stat Nicholas Mc Guire
@ 2014-02-14 13:09 ` Sebastian Andrzej Siewior
  2014-02-14 13:17 ` Sebastian Andrzej Siewior
  1 sibling, 0 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-02-14 13:09 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: linux-rt-users, LKML, Steven Rostedt, Peter Zijlstra,
	Carsten Emde, Thomas Gleixner, Andreas Platschek

* Nicholas Mc Guire | 2014-02-10 16:39:33 [+0100]:

>
>allow preemption in mem_cgroup_move_account_page_stat
>
>as the call sites of mem_cgroup_move_account_page_stat are under 
>move_lock_mem_cgroup move_unlock_mem_cgroup (spin_lock_irqsave/
>spin_unlock_irqrestore respectively) the move operations 
>preempt_disable/enable seem to be purely for migration protection so 
>a migrate_disable/enable should be fine here.
>
>patch on top of 3.12.10-rt15
>
>Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>

Applied.

Sebastian

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

* Re: [PATCH RT 4/5] allow preemption in mem_cgroup_move_account_page_stat
  2014-02-10 15:39 [PATCH RT 4/5] allow preemption in mem_cgroup_move_account_page_stat Nicholas Mc Guire
  2014-02-14 13:09 ` Sebastian Andrzej Siewior
@ 2014-02-14 13:17 ` Sebastian Andrzej Siewior
  2014-02-14 13:19   ` Sebastian Andrzej Siewior
  1 sibling, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-02-14 13:17 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: linux-rt-users, LKML, Steven Rostedt, Peter Zijlstra,
	Carsten Emde, Thomas Gleixner, Andreas Platschek

* Nicholas Mc Guire | 2014-02-10 16:39:33 [+0100]:

>index a67e630f..e7cc35a 100644
>--- a/mm/memcontrol.c
>+++ b/mm/memcontrol.c
>@@ -3784,10 +3784,10 @@ void mem_cgroup_move_account_page_stat(struct mem_cgroup *from,
> 					enum mem_cgroup_stat_index idx)
> {
> 	/* Update stat data for mem_cgroup */
>-	preempt_disable();
>+	migrate_disable();
> 	__this_cpu_sub(from->stat->count[idx], nr_pages);
> 	__this_cpu_add(to->stat->count[idx], nr_pages);
>-	preempt_enable();
>+	migrate_enable();
> }

Now, that I look at it again. Isn't it more efficient to keep preemption
disabled for this very short time instead instead of invoking
migrate_disable() which includes preempt_disable()/enable() and a few
more opcodes…
Therefore, I drop it again.

Sebastian

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

* Re: [PATCH RT 4/5] allow preemption in mem_cgroup_move_account_page_stat
  2014-02-14 13:17 ` Sebastian Andrzej Siewior
@ 2014-02-14 13:19   ` Sebastian Andrzej Siewior
  2014-02-14 15:30     ` Nicholas Mc Guire
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-02-14 13:19 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: linux-rt-users, LKML, Steven Rostedt, Peter Zijlstra,
	Carsten Emde, Thomas Gleixner, Andreas Platschek

* Sebastian Andrzej Siewior | 2014-02-14 14:17:05 [+0100]:

>Now, that I look at it again. Isn't it more efficient to keep preemption
>disabled for this very short time instead instead of invoking
>migrate_disable() which includes preempt_disable()/enable() and a few
>more opcodes…
>Therefore, I drop it again.

I think doing the same for the 1/5 of this series since it also disables
migration for a handfull of asm opcodes.

Sebastian

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

* Re: [PATCH RT 4/5] allow preemption in mem_cgroup_move_account_page_stat
  2014-02-14 13:19   ` Sebastian Andrzej Siewior
@ 2014-02-14 15:30     ` Nicholas Mc Guire
  0 siblings, 0 replies; 5+ messages in thread
From: Nicholas Mc Guire @ 2014-02-14 15:30 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-rt-users, LKML, Steven Rostedt, Peter Zijlstra,
	Carsten Emde, Thomas Gleixner, Andreas Platschek

On Fri, 14 Feb 2014, Sebastian Andrzej Siewior wrote:

> * Sebastian Andrzej Siewior | 2014-02-14 14:17:05 [+0100]:
> 
> >Now, that I look at it again. Isn't it more efficient to keep preemption
> >disabled for this very short time instead instead of invoking
> >migrate_disable() which includes preempt_disable()/enable() and a few
> >more opcodes???
> >Therefore, I drop it again.
> 
> I think doing the same for the 1/5 of this series since it also disables
> migration for a handfull of asm opcodes.
>
yup - nice run in the wrong direction :)
those short pushdowns make no sense - should have looked at that first...
the execution length/complexity (notably worst case on migrate_enable()) is
actually very high compared to a preempt_enable.

thx!
hofrat

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

end of thread, other threads:[~2014-02-14 15:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-10 15:39 [PATCH RT 4/5] allow preemption in mem_cgroup_move_account_page_stat Nicholas Mc Guire
2014-02-14 13:09 ` Sebastian Andrzej Siewior
2014-02-14 13:17 ` Sebastian Andrzej Siewior
2014-02-14 13:19   ` Sebastian Andrzej Siewior
2014-02-14 15:30     ` Nicholas Mc Guire

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).