linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Mc Guire <der.herr@hofr.at>
To: linux-rt-users@vger.kernel.org
Subject: [PATCH 0/4] migration cleanup patches
Date: Sat, 30 Nov 2013 04:05:56 +0100	[thread overview]
Message-ID: <20131130030556.GA8101@opentech.at> (raw)

Hi !

 These patches are migrate_disable/enable cleanups only
 basically migrate_disabe/enable is in all of the locking primitives because
 it is not known (or not differenciatable) if the lock is protecting a per
 cpu object or not - so all lock primitives that potentially could also be 
 used for concurrency management of per cpu objects must include 
 migrate_disable/enable to make them safely preemptible (it could get pushed 
 of the cpu and the reference would then be invalid). 

 The location of the migration though is prety much irrelevant as long as the
 access is ensured to be while holding the lock and migration being disabled.
 Locking/migrate_disable patters thus can be any of:

  lock/disable  access  enable/unlock
  disable/lock  access  unlock/enable
  disable/lock  access  enable/unlock
  lock/disable  access  unlock/enable

 Based on this the migrate_disable is pushed down to the latest point before
 signaling a successfully acquired lock

 Further more the first migrate_disable of the task will try to push the task 
 of the CPU before actually disabling migration. For cases of unsuccessful
 lock acquisition this would lead to unnecessary migration of task like in

        int __locked;                           \
        migrate_disable();                      \
        __locked = spin_do_trylock(lock);       \
        if (!__locked)                          \
                migrate_enable();               \
        __locked;                               \

 This patch set pushes the migrate_disable down to the end of the success
 path in the different trylock primitives. 

 patchs are on top of 3.12-rt4

 No change of functional behavior

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>

             reply	other threads:[~2013-11-30  3:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-30  3:05 Nicholas Mc Guire [this message]
2013-12-15 14:31 ` [PATCH 0/4] migration cleanup patches Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131130030556.GA8101@opentech.at \
    --to=der.herr@hofr.at \
    --cc=linux-rt-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).