mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Peter Korsgaard <peter@korsgaard.com>
Cc: barebox@lists.infradead.org, Stafford Horne <shorne@gmail.com>,
	sha@pengutronix.de, Jules Maselbas <jmaselbas@kalray.eu>
Subject: Re: [PATCH v2 02/11] common: introduce bthreads, co-operative barebox threads
Date: Tue, 2 Mar 2021 09:56:29 +0100	[thread overview]
Message-ID: <0cfdd66a-16c6-fe94-4f10-2e70ce62c8b6@pengutronix.de> (raw)
In-Reply-To: <87im6bqc4g.fsf@dell.be.48ers.dk>

Hello Peter,

On 01.03.21 13:42, Peter Korsgaard wrote:
>>>>>> "Ahmad" == Ahmad Fatoum <a.fatoum@pengutronix.de> writes:
> 
> Hi,
>  
>  > +bthreads
>  > +--------
>  > +
>  > +barebox threads are co-operative green threads, which are scheduled whenever
>  > +``is_timeout()`` is called.  This has a few implications. First of all,
>  > +bthreads are not scheduled when ``is_timeout()`` is not called.
>  > +For this and other reasons, loops polling for hardware events should always
>  > +use a timeout, which is best implemented with ``is_timeout()``.
>  > +Another thing to remember is that bthreads can be scheduled anywhere
>  > +in the middle of other device accesses whenever ``is_timeout()`` is
>  > +called. Care must be taken that a green thread doesn't access the very same device
>  > +again itself. See "slices" below on how devices can safely be accessed from
>  > +bthreads.
>  > +
>  > +Unlike pollers, which bthreads are replacing, bthreads are allowed
>  > +access to virtual filesystem. The macro ``assert_command_context()`` is added
>  > +to entry points of the VFS to have the thread yield until it may execute in
>  > +in the correct context. The poller interface is declared in
> 
> s/poller/bthread/
> 
>  > +``include/bthread.h``.  ``bthread_create()`` is used to allocate a bthread
>  > +control block along with its stack. ``bthread_wake()`` can be used to hang
>  > +it into the run queue. From this moment on and until the thread terminates,
> 
> s/hang it into/add/
> 
>  > +the thread will be switched to regularly as long as someone calls
>  > +``is_timeout()``. bthreads are allowed to call ``is_timeout()``, which will
>  > +arrange for other threads to execute.
>  > +
>  > +barebox threads replace previous the previous pollers and workqueues. Poller
> 
> s/previous the previous/the previous infrastructure,/

Thanks! Just sent out a fixup.

> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-03-02  8:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 11:00 [PATCH v2 00/11] common: introduce bthreads, co-operative Ahmad Fatoum
2021-03-01 11:00 ` [PATCH v2 01/11] console: unconditionally run poller_call in ctrlc() Ahmad Fatoum
2021-03-03 10:20   ` [PATCH] fixup! common: introduce bthreads, co-operative barebox threads Ahmad Fatoum
2021-03-04  8:49     ` Sascha Hauer
2021-03-04  9:17       ` Ahmad Fatoum
2021-03-01 11:00 ` [PATCH v2 02/11] " Ahmad Fatoum
2021-03-01 12:42   ` Peter Korsgaard
2021-03-02  8:56     ` Ahmad Fatoum [this message]
2021-03-02  8:56   ` [PATCH] fixup! " Ahmad Fatoum
2021-03-01 11:00 ` [PATCH v2 03/11] ARM: asm: setjmp: annotate setjmp/longjmp for GCC Ahmad Fatoum
2021-03-01 11:00 ` [PATCH v2 04/11] ARM: asm: setjmp: implement coroutine dependency initjmp() Ahmad Fatoum
2021-03-01 11:01 ` [PATCH v2 05/11] sandbox: asm: implement setjmp/longjmp/initjmp Ahmad Fatoum
2021-03-01 11:01 ` [PATCH v2 06/11] riscv: Add asm/asm.h Ahmad Fatoum
2021-03-01 11:01 ` [PATCH v2 07/11] riscv: Add asm/linkage.h Ahmad Fatoum
2021-03-01 11:01 ` [PATCH v2 08/11] riscv: Implement setjmp/longjmp/initjmp Ahmad Fatoum
2021-03-01 11:01 ` [PATCH v2 09/11] mips: Add linkage.h Ahmad Fatoum
2021-03-01 11:01 ` [PATCH v2 10/11] mips: Implement setjmp/longjmp/initjmp Ahmad Fatoum
2021-03-02 22:19   ` Peter Mamonov
2021-03-04  8:38     ` Sascha Hauer
2021-03-07 12:00       ` Peter Mamonov
2021-03-10  8:17         ` Ahmad Fatoum
2021-03-14 12:40           ` Ahmad Fatoum
2021-03-01 11:01 ` [PATCH v2 11/11] powerpc: Implement initjmp/setjmp/longjmp Ahmad Fatoum
2021-03-03 12:15 ` [PATCH v2 00/11] common: introduce bthreads, co-operative Stafford Horne
2021-03-03 13:35   ` Stafford Horne
2021-03-03 13:58   ` Ahmad Fatoum
2021-03-03 15:12   ` Sascha Hauer

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=0cfdd66a-16c6-fe94-4f10-2e70ce62c8b6@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jmaselbas@kalray.eu \
    --cc=peter@korsgaard.com \
    --cc=sha@pengutronix.de \
    --cc=shorne@gmail.com \
    /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