public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: Len Brown via Libc-alpha <libc-alpha@sourceware.org>,
	"H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: Pthread QOS interface
Date: Wed, 18 May 2022 10:55:36 -1000	[thread overview]
Message-ID: <CAJvTdK=675tqRag33RqPrNwv2PqQoZvY_D_3ZfNfjO++OZFjjw@mail.gmail.com> (raw)
In-Reply-To: <87v8u36t3y.fsf@oldenburg.str.redhat.com>

On Wed, May 18, 2022 at 12:19 AM Florian Weimer <fweimer@redhat.com> wrote:

> > Can we implement EXACTLY the same interface as Apple has -- so a
> > cross-platform application doesn't have to change?  (I see an Apple
> > source license on that qos.h -- is that an issue with an API?)

> Isn't this traditionally handled by cgroups and/or rtkit?

Yes, cgroups have been used to address some of this in the past.  But
cgroups have their benefits and weaknesses.

The fundamental problem with cgroups is that somebody with a lot of
knowledge has to manage both what they do, and what tasks belong to
what group.  Further, cgroups only work in a strict hierarchy.

An API, on the other hand, allows a task to say something that it may
actually know about -- what kind of task it is -- and not require it
or anybody outside the kernel to know, for example, how the scheduler
may want to schedule a background task relative to other tasks at a
particular time.

What is rkit?

> If we can get a syscall interface for this from the kernel, we could add
> something in parallel to that to glibc, but I doubt it would have the
> same semantics as the Darwin interface even if we keep the API the same.
> For example, Linux may require different permissions for making these
> changes, and apply them to different aspects of system behavior (CPU,
> mass storage I/O, memory bandwidth, network traffic).

Yes, this is what I propose.  I can supply/propose the system call
interface.  My question is if there is hope that pthreads can be
plumbed to talk to it.

The semantics of the Darwin interface are documented, and Indeed, I
propose we match them EXACTLY.  For that is what the multi-platform
app wants.

Of course, under the hood, the implementation will be entirely
different, as the OS under the hood is entirely different, but he APP
will be giving each OS exactly the same message to work with.

Yes, under the hood on Linux, some scheduler attributes require more
than default permission.  We can grant that permission in the
important cases.  We can also still make a positive difference in
places where no permission is required.

thanks,
-Len Brown, Intel

  reply	other threads:[~2022-05-18 20:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 23:03 H.J. Lu
2022-05-17 23:59 ` Len Brown
2022-05-18 10:19   ` Florian Weimer
2022-05-18 20:55     ` Len Brown [this message]
2022-05-24  9:39       ` Florian Weimer

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='CAJvTdK=675tqRag33RqPrNwv2PqQoZvY_D_3ZfNfjO++OZFjjw@mail.gmail.com' \
    --to=lenb@kernel.org \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).