From: Marcelo Tosatti <mtosatti@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
x86@kernel.org, Luiz Capitulino <lcapitulino@redhat.com>,
Vikas Shivappa <vikas.shivappa@intel.com>,
Tejun Heo <tj@kernel.org>, Yu Fenghua <fenghua.yu@intel.com>
Subject: Re: [RFD] CAT user space interface revisited
Date: Fri, 20 Nov 2015 12:15:49 -0200 [thread overview]
Message-ID: <20151120141549.GA8797@amt.cnet> (raw)
In-Reply-To: <alpine.DEB.2.11.1511190911550.3898@nanos>
On Thu, Nov 19, 2015 at 09:35:34AM +0100, Thomas Gleixner wrote:
> On Wed, 18 Nov 2015, Marcelo Tosatti wrote:
> > On Wed, Nov 18, 2015 at 08:34:07PM -0200, Marcelo Tosatti wrote:
> > > On Wed, Nov 18, 2015 at 07:25:03PM +0100, Thomas Gleixner wrote:
> > > > Assume that you have isolated a CPU and run your important task on
> > > > it. You give that task a slice of cache. Now that task needs kernel
> > > > services which run in kernel threads on that CPU. We really don't want
> > > > to (and cannot) hunt down random kernel threads (think cpu bound
> > > > worker threads, softirq threads ....) and give them another slice of
> > > > cache. What we really want is:
> > > >
> > > > 1 1 1 1 0 0 0 0 <- Default cache
> > > > 0 0 0 0 1 1 1 0 <- Cache for important task
> > > > 0 0 0 0 0 0 0 1 <- Cache for CPU of important task
> > > >
> > > > It would even be sufficient for particular use cases to just associate
> > > > a piece of cache to a given CPU and do not bother with tasks at all.
> >
> > Well any work on behalf of the important task, should have its cache
> > protected as well (example irq handling threads).
>
> Right, but that's nothing you can do automatically and certainly not
> from a random application.
>
> > But for certain kernel tasks for which L3 cache is not beneficial
> > (eg: kernel samepage merging), it might useful to exclude such tasks
> > from the "important, do not flush" L3 cache portion.
>
> Sure it might be useful, but this needs to be done on a case by case
> basis and there is no way to do this in any automated way.
>
> > > > It's hard. Policies are hard by definition, but this one is harder
> > > > than most other policies due to the inherent limitations.
> >
> > That is exactly why it should be allowed for software to automatically
> > configure the policies.
>
> There is nothing you can do automatically.
Every cacheline brought in the L3 has a reaccess time (the time when it
was first brought in to the time it was reaccessed).
Assume you have a single threaded app, a sequence of cacheline
accesses.
Now if there are groups of accesses which have long reaccess times
(meaning that keeping them in L3 is not beneficial), that are large
enough to justify the OS notification, the application can notify the OS
to switch to a constrained COSid (so that L3 misses reclaim from that
small portion of the L3 cache).
> If you want to allow
> applications to set the policies themself, then you need to assign a
> portion of the bitmask space and a portion of the cos id space to that
> application and then let it do with that space what it wants.
Thats why you should specify the requirements independently of each
other (the requirement in this case the size of the reservation and
type, which is tied to the application), and let something else figure
out how they all fit together.
> That's where cgroups come into play. But that does not solve the other
> issues of "global" configuration, i.e. CPU defaults etc.
I don't understand what you mean issues of global configuration.
CPU defaults: A task is associated with a COSid. A COSid points to
a set of CBMs (one CBM per socket). What defaults are you talking about?
But the interfaces do not exclude each other (the ioctl or syscall
interfaces and the manual direct MSR interface can coexist). There is
time pressure to integrate something workable for the present use cases
(none are in the class "applications set reservation themselves").
Peter has some objection against ioctls. So for something workable,
well have to handle the numbered issues pointed in the other e-mail
(2,3,4), in userspace.
next prev parent reply other threads:[~2015-11-20 16:31 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 18:25 [RFD] CAT user space interface revisited Thomas Gleixner
2015-11-18 19:38 ` Luiz Capitulino
2015-11-18 19:55 ` Auld, Will
2015-11-18 22:34 ` Marcelo Tosatti
2015-11-19 0:34 ` Marcelo Tosatti
2015-11-19 8:35 ` Thomas Gleixner
2015-11-19 13:44 ` Luiz Capitulino
2015-11-20 14:15 ` Marcelo Tosatti [this message]
2015-11-19 8:11 ` Thomas Gleixner
2015-11-19 0:01 ` Marcelo Tosatti
2015-11-19 1:05 ` Marcelo Tosatti
2015-11-19 9:09 ` Thomas Gleixner
2015-11-19 20:59 ` Marcelo Tosatti
2015-11-20 7:53 ` Thomas Gleixner
2015-11-20 17:51 ` Marcelo Tosatti
2015-11-19 20:30 ` Marcelo Tosatti
2015-11-19 9:07 ` Thomas Gleixner
2015-11-24 8:27 ` Chao Peng
[not found] ` <20151124212543.GA11303@amt.cnet>
2015-11-25 1:29 ` Marcelo Tosatti
2015-11-24 7:31 ` Chao Peng
2015-11-24 23:06 ` Marcelo Tosatti
2015-12-22 18:12 ` Yu, Fenghua
2015-12-23 10:28 ` Marcelo Tosatti
2015-12-29 12:44 ` Thomas Gleixner
2015-12-31 19:22 ` Marcelo Tosatti
2015-12-31 22:30 ` Thomas Gleixner
2016-01-04 17:20 ` Marcelo Tosatti
2016-01-04 17:44 ` Marcelo Tosatti
2016-01-05 23:09 ` Thomas Gleixner
2016-01-06 12:46 ` Marcelo Tosatti
2016-01-06 13:10 ` Tejun Heo
2016-01-08 20:21 ` Thomas Gleixner
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=20151120141549.GA8797@amt.cnet \
--to=mtosatti@redhat.com \
--cc=fenghua.yu@intel.com \
--cc=lcapitulino@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=vikas.shivappa@intel.com \
--cc=x86@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