public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Seigh <jseigh_02@xemaps.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC,PATCH] RCUify single-thread case of clock_gettime()
Date: Mon, 31 Oct 2005 14:37:05 -0500	[thread overview]
Message-ID: <dk5ro9$3h8$1@sea.gmane.org> (raw)
In-Reply-To: <20051031174416.GA2762@us.ibm.com>

Paul E. McKenney wrote:
> Hello!
> 
> The attached patch uses RCU to avoid the need to acquire tasklist_lock
> in the single-thread case of clock_gettime().  Still acquires tasklist_lock
> when asking for the time of a (potentially multithreaded) process.
> 
> Experimental, has been touch-tested on x86 and POWER.  Requires RCU on
> task_struct.  Further more focused testing in progress.
> 
> Thoughts?  (Why?  Some off-list users want to be able to monitor CPU
> consumption of specific threads.  They need to do so quite frequently,
> so acquiring tasklist_lock is inappropriate.)


I'd like to see the time the thread is dispatched put into a read only
memory segment along with a virtual timer and real timer offsets.  The
thread gets the read or virtual time by reading the virtual offset,
reading the real clock (whatever that is), rereading the virtual offset,
and if that hasn't changed, getting the desired timer value by adding the
appropiate offset.  No kernel entanglements required.  This is an old
trick VM used to support virtual timers for MVS.

And while we're at it, throw in the rest of the thread usage stats.

The use of mapped memory segments to avoid syscalls is a good idea.  relayfs
has already established that precedent.  relayfs only handles circular
producer/consumer queues but you could use RCU for preeemptive user threads
or RCU+SMR for other data structures in mapped memory managed by the kernel
or another process even.


--
Joe Seigh


  parent reply	other threads:[~2005-10-31 19:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-31 17:44 [RFC,PATCH] RCUify single-thread case of clock_gettime() Paul E. McKenney
2005-10-31 18:08 ` Hugh Dickins
2005-10-31 19:54   ` Ingo Molnar
2005-10-31 20:07     ` Hugh Dickins
2005-10-31 21:50       ` Ingo Molnar
2005-10-31 19:37 ` Joe Seigh [this message]
2005-10-31 21:44 ` Ingo Molnar

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='dk5ro9$3h8$1@sea.gmane.org' \
    --to=jseigh_02@xemaps.com \
    --cc=linux-kernel@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