public inbox for linux-integrity@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Tadeusz Struk <tstruk@gmail.com>,
	Tadeusz Struk <tadeusz.struk@intel.com>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: jgg@ziepe.ca, linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, philip.b.tricca@intel.com, "Dock,
	Deneen T" <deneen.t.dock@intel.com>
Subject: Re: [PATCH v3 0/2] tpm: add support for nonblocking operation
Date: Thu, 21 Jun 2018 14:26:07 +0900	[thread overview]
Message-ID: <1529558767.3118.1.camel@HansenPartnership.com> (raw)
In-Reply-To: <0e46c2e9-af2b-550f-2b3d-98cbc1840bc1@gmail.com>

On Wed, 2018-06-20 at 18:24 -0700, Tadeusz Struk wrote:
> On 06/20/2018 04:59 PM, James Bottomley wrote:
> > I'm slightly surprised by this statement.  I thought IoT Node.js
> > runtimes (of which there are far too many, so I haven't looked at
> > all of them) use libuv or one of the forks:
> > 
> > http://libuv.org/
> > 
> > As the basis for their I/O handling?  While libuv can do polling
> > for event driven interfaces it also support the worker thread model
> > just as easily:
> > 
> > http://docs.libuv.org/en/v1.x/threadpool.html
> 
> Yes, it does polling:
> http://docs.libuv.org/en/v1.x/design.html#the-i-o-loop

But that's for networking.  You'll be talking to the TPM RM over the
file descriptor so that follows the thread pool model in

http://docs.libuv.org/en/v1.x/design.html#file-i-o

This precisely describes the current file descriptor abstraction we'd
use for the TPM.

> > > Similarly embedded applications, which are basically just a
> > > single threaded event loop, quite often don't use threads because
> > > of resources constrains.
> > 
> > It's hard for me, as a kernel developer, to imagine any embedded
> > scenario using the Linux kernel that would not allow threads unless
> > the writers simply didn't bother with synchronization: The kernel
> > schedules at the threads level and can't be configured not to use
> > them plus threads are inherently more lightweight than processes so
> > they're a natural fit for resource constrained scenarios.
> > 
> > That's still not to say we shouldn't do this, but I've got to say I
> > think the only consumers would be old fashioned C code: the code we
> > used to write before we had thread libraries that did use signals
> > and poll() for a single threaded event driven monolith (think green
> > threads), because all the new webby languages use threading either
> > explicitly or at the core of their operation.
> 
> Regardless of how it actually might be used, I'm happy that we agree
> on that this *is* the right thing to do.

I didn't say that.  I think using a single worker thread queue is the
correct abstraction for the TPM.  If there's a legacy use case for
poll(), I don't see why not since the code seems to be fairly small and
self contained, but I don't really see it as correct or necessary to do
it that way.

James

  reply	other threads:[~2018-06-21  5:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 17:58 [PATCH v3 0/2] tpm: add support for nonblocking operation Tadeusz Struk
2018-06-12 17:58 ` [PATCH v3 1/2] tpm: add ptr to the tpm_space struct to file_priv Tadeusz Struk
2018-06-12 17:58 ` [PATCH v3 2/2] tpm: add support for nonblocking operation Tadeusz Struk
2018-06-13 17:55   ` J Freyensee
2018-06-13 18:05     ` Tadeusz Struk
2018-06-19 13:10 ` [PATCH v3 0/2] " Jarkko Sakkinen
2018-06-20  0:45   ` Tadeusz Struk
2018-06-20 23:59     ` James Bottomley
2018-06-21  1:24       ` Tadeusz Struk
2018-06-21  5:26         ` James Bottomley [this message]
2018-06-21 16:20           ` Tadeusz Struk
2018-06-21 17:17     ` Jarkko Sakkinen
2018-06-21 17:36       ` Tadeusz Struk

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=1529558767.3118.1.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=deneen.t.dock@intel.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=philip.b.tricca@intel.com \
    --cc=tadeusz.struk@intel.com \
    --cc=tstruk@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