+ sched-introduce-this_rq_lock_irq.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: sched: introduce this_rq_lock_irq()
has been added to the -mm tree.  Its filename is
     sched-introduce-this_rq_lock_irq.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/sched-introduce-this_rq_lock_irq.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/sched-introduce-this_rq_lock_irq.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Johannes Weiner <hannes@xxxxxxxxxxx>
Subject: sched: introduce this_rq_lock_irq()

do_sched_yield() disables IRQs, looks up this_rq() and locks it.  The next
patch is adding another site with the same pattern, so provide a
convenience function for it.

Link: http://lkml.kernel.org/r/20180828172258.3185-8-hannes@xxxxxxxxxxx
Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx>
Tested-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
Tested-by: Daniel Drake <drake@xxxxxxxxxxxx>
Cc: Christopher Lameter <cl@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Johannes Weiner <jweiner@xxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Peter Enderborg <peter.enderborg@xxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Cc: Shakeel Butt <shakeelb@xxxxxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: Vinayak Menon <vinmenon@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/sched/core.c  |    4 +---
 kernel/sched/sched.h |   12 ++++++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

--- a/kernel/sched/core.c~sched-introduce-this_rq_lock_irq
+++ a/kernel/sched/core.c
@@ -4932,9 +4932,7 @@ static void do_sched_yield(void)
 	struct rq_flags rf;
 	struct rq *rq;
 
-	local_irq_disable();
-	rq = this_rq();
-	rq_lock(rq, &rf);
+	rq = this_rq_lock_irq(&rf);
 
 	schedstat_inc(rq->yld_count);
 	current->sched_class->yield_task(rq);
--- a/kernel/sched/sched.h~sched-introduce-this_rq_lock_irq
+++ a/kernel/sched/sched.h
@@ -1150,6 +1150,18 @@ rq_unlock(struct rq *rq, struct rq_flags
 	raw_spin_unlock(&rq->lock);
 }
 
+static inline struct rq *
+this_rq_lock_irq(struct rq_flags *rf)
+	__acquires(rq->lock)
+{
+	struct rq *rq;
+
+	local_irq_disable();
+	rq = this_rq();
+	rq_lock(rq, rf);
+	return rq;
+}
+
 #ifdef CONFIG_NUMA
 enum numa_topology_type {
 	NUMA_DIRECT,
_

Patches currently in -mm which might be from hannes@xxxxxxxxxxx are

mm-workingset-tell-cache-transitions-from-workingset-thrashing.patch
delayacct-track-delays-from-thrashing-cache-pages.patch
sched-loadavg-consolidate-load_int-load_frac-calc_load.patch
sched-loadavg-make-calc_load_n-public.patch
sched-schedh-make-rq-locking-and-clock-functions-available-in-statsh.patch
sched-introduce-this_rq_lock_irq.patch
psi-pressure-stall-information-for-cpu-memory-and-io.patch
psi-pressure-stall-information-for-cpu-memory-and-io-fix.patch
psi-pressure-stall-information-for-cpu-memory-and-io-fix-2.patch
psi-pressure-stall-information-for-cpu-memory-and-io-fix-3.patch
psi-cgroup-support.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux