mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@xenotime.net>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Ingo Molnar <mingo@elte.hu>, Jens Axboe <jens.axboe@oracle.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Christian Borntraeger <cborntra@de.ibm.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Arjan van de Ven <arjan@infradead.org>
Subject: Re: [PATCH RFC 1/3] Add a trigger API for efficient non-blocking waiting
Date: Sun, 17 Aug 2008 16:02:27 -0700	[thread overview]
Message-ID: <20080817160227.cfe6e40c.rdunlap@xenotime.net> (raw)
In-Reply-To: <48A70185.2020600@goop.org>

On Sat, 16 Aug 2008 09:34:13 -0700 Jeremy Fitzhardinge wrote:

> --- /dev/null
> +++ b/include/linux/trigger.h
> @@ -0,0 +1,145 @@
> +#ifndef _LINUX_TRIGGER_H
> +#define _LINUX_TRIGGER_H
> +
> +
> +
> +/**
> + * trigger_init - Initialize a trigger for use
> + * @t - trigger to be initialized

kernel-doc format for function parameters is like:

 * @t: trigger to be initialized

so please change all occurrences to be like that.  Thanks.


> + */
> +static inline void trigger_init(trigger_t *t)
> +{
> +	__raw_trigger_init(t);
> +}
> +
> +/**
> + * trigger_reset - reset a trigger
> + * @t - trigger to be reset
> + *
> + * This resets the trigger state, allowing a trigger_wait to block.
> + * Note that preemption must be disabled between trigger_reset() and
> + * trigger_finish().
> + *
> + * The use of these functions is:
> + *	trigger_reset(&t);
> + *	while(!condition)
> + *		trigger_wait(&t);
> + *	trigger_finish(&t);
> + *
> + * and where the condition is set:
> + *	condition = true;
> + *	trigger_kick(&t);
> + */
> +static inline void trigger_reset(trigger_t *t)
> +{
> +	__raw_trigger_reset(t);
> +}
> +
> +/**
> + * trigger_wait - wait for a trigger to be kicked
> + * @t - trigger to be waited on
> + *
> + * This blocks until the trigger has been kicked.  If the trigger has
> + * already been kicked, it will return immediately.  It may also
> + * return without the trigger having been kicked at all; the caller
> + * must test the condition before calling trigger_wait() again.
> + *
> + * trigger_wait() acts as a read barrier.
> + *
> + * On return, the trigger will have always be reset.
> + */
> +static inline void trigger_wait(trigger_t *t)
> +{
> +	__raw_trigger_wait(t);
> +}
> +
> +/**
> + * trigger_kick - kick a trigger
> + * @t - trigger to kick
> + *
> + * This causes anyone waiting in trigger_wait to continue.  It may be
> + * called in any context.
> + *
> + * trigger_kick() acts as a write barrier.
> + */
> +static inline void trigger_kick(trigger_t *t)
> +{
> +	__raw_trigger_kick(t);
> +}
> +
> +/**
> + * trigger_finish - clean up trigger
> + * @t - trigger to be cleaned up
> + *
> + * This cleans up any implementation trigger state once we've finished
> + * with it.
> + */
> +static inline void trigger_finish(trigger_t *t)
> +{
> +	__raw_trigger_finish(t);
> +}
> +#endif	/* _LINUX_TRIGGER_H */


---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/

  parent reply	other threads:[~2008-08-17 23:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-16 16:34 Jeremy Fitzhardinge
2008-08-16 17:47 ` Arjan van de Ven
2008-08-17 23:02 ` Randy Dunlap [this message]
2008-08-20  6:21 ` Andrew Morton
2008-08-20 18:42   ` Jeremy Fitzhardinge
2008-08-20 19:25     ` Andrew Morton
2008-08-20 20:14       ` Jeremy Fitzhardinge
2008-08-25  0:53       ` Rusty Russell
2008-08-28 12:27 ` Christian Borntraeger

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=20080817160227.cfe6e40c.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=arjan@infradead.org \
    --cc=cborntra@de.ibm.com \
    --cc=jens.axboe@oracle.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®